Question

The official site is quite scarce and most of the examples are EMF- related and for Eclipse 3.5 But what if one uses 3.4 target Eclipse platform and does not use EMF. I am specifically interested in Tree Viewer examples, but good example and documentation is always appreciated.

Was it helpful?

Solution

Here are some good resources:

I do not think, there's a major difference between JFace databinding in eclipse 3.4 and 3.5. The concepts are still the same (ISWTObservables, etc).

Edit

Lars Vogel demonstrates an observable Listviewer with the following code:

// Define the viewer
viewer = new ListViewer(parent);
viewer.setContentProvider(new ObservableListContentProvider());
List<Person> persons = new ArrayList<Person>();
// Just for testing we create sample data
createExampleData(persons);
input = new WritableList(persons, Person.class);
// Set the writeableList as input for the viewer
viewer.setInput(input);

The introduction encourages that this works with TreeViewers aswell. The Content provider you need it org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider. It's a bit more complicated, because you need a list factory and a TreeStructureAdvisor to construct this content provider. That's all help I can provide. Didn't find an example either and didn't use databinding with tree viewers so far. So from now on the JFace API doc has to be your friend ;)

OTHER TIPS

Here is a comprehensive list of samples. This one is specifically related to TreeViewer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top