Straight from the horse's mouth:
"It’s new, it’s cool, and it helps you write better code!"
I soooooo want to write better code; I'm game. Please vote!
Recent developments in the JFace Data Binding project.
"It’s new, it’s cool, and it helps you write better code!"
Realm
s are now in HEAD and most provisional API has been removed. What that means is that with HEAD your code probably doesn't compile.ComboViewer
.1 //Create the observable for the domain list.
2 IObservableList lodgings = BeansObservables.observeList(Realm
3 .getDefault(), catalog, "lodgings");
4 //Create the content provider that corresponds to the observable list.
5 ObservableListContentProvider contentProvider = new ObservableListContentProvider();
6
7 //Create a mapping for the attribute to display.
8 IObservableMap[] attributeMaps = BeansObservables.observeMaps(
9 contentProvider.getKnownElements(), Lodging.class,
10 new String[] { "name" });
11
12 cviewer.setContentProvider(contentProvider);
13 cviewer.setLabelProvider(new ObservableMapLabelProvider(attributeMaps));
14 cviewer.setInput(lodgings);
attributeMaps
(line 8). In this case we're only specifying one attribute, name (line 10), because it's a Combo
. In the map returned the key will be the element and the value will be the display value of the name attribute of the element.IObservable
but branches out into:IObservableValue
IObservableList
List
. The notifications are notifications of when items are added or removed from the List
. If an object being maintained in the List
changes events are not fired from the IObservableList
implementation.IObservableSet
IObservableList
the change events are for items being added and removed from the Set
.IObservableMap
Map
. And you guess it, same type of behavior as the previous interfaces but for a Map
.WritableValue
WritableList
WritableSet
WritableMap