jface Tag

Update: It turned out that there is already a solution to the problem described here. The bundle org.eclipse.equinox.supplement exports the packages needed by equinox.common. This bundle is available from https://download.eclipse.org/equinox/. If you want to run Eclipse databinding, simply inlude this bundle and org.eclipse.equinox.common and you're set. You can disregard the solution explained below. Thanks Pascal Rapicault for the pointer. Eclipse databinding is separated into a core...

Read More

JFace Data Binding allows you to attach only one validator to a binding. Putting all constraints into one validator is essentially bad design and compromises reusability. Here's a trick for dealing with this limitation of the data binding API and at the same time, keeping your validators small and reusable. When binding a source observable to a target observable in JFace Data Binding, it is possible...

Read More

When adding keybindings to an existing Eclipse RCP application, it is extremelly helpful to get realtime information about which keybinding registered and to what command handlers it is mapped to. Why is that?  Because sometimes the operating system or another widget will consume the keyboard event before it gets to the command framework. Other times there are several handlers bound to the same key causing a...

Read More

Were you ever curious how to get those pretty colored labels in your JFace viewers you see all over Eclipse? For example, the blue counter label in the search results view: Well, I'll tell you how! Let's start with famous RCP Mail example: Let's look at the current label provider in the RCP Mail example: [code lang="java"] class ViewLabelProvider extends LabelProvider { public String getText(Object...

Read More

In the last blog entry regarding databinding, we learned how to create a custom observable for a DateTime widget. Starting with Eclipse 3.5 there is a new approach to creating custom observables as described by Matthew Hall in the comments to that post. Which ever way you choose, we will now use the observable to showcase another cool databinding feature: Crossvalidation. Crossvalidation was introduced with...

Read More

The introduction of the databinding framework in Eclipse 3.3 is with no doubt one of the most useful tools in the hands of the form developer. The ability to transform and validate user input in such a flexible and reusable way is a great enhancement. But where there is light, there is shadow. Sometimes there is just no IObservable available for your target or model...

Read More