Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] How to bind Tree that contains nodes with different types.
[Databinding] How to bind Tree that contains nodes with different types. [message #331057] Fri, 22 August 2008 10:04
Eclipse UserFriend
Originally posted by: ilya.khodyakov.gmail.com

Hi there,
I am trying to learn databinding and I have a following problem:
I have a model where bean contains same lists with different types, for
example:

Model.class as root.

-ParentNode1 (Parent.class)
-- Type1Nodes (list "types1" with Type1.class)
-- Type2Nodes (list "types2" with Type2.class)
-ParentNode2 (Parent.class)
-- Type1Nodes (list "types1" with Type1.class)
-- Type3Nodes (list "types3" with Type3.class)

How to write correct observable content provider for this Tree?
Now, I use ObservableListTreeContentProvider and create
ModelObservableFactory:

public class ModelObservableFactory implements IObservableFactory{


public ModelObservableFactory() {
super();
}

public IObservable createObservable(Object target) {
if( target instanceof Model ){
return BeansObservables.observeList(Realm.getDefault(),
target, "parents", Parent.class);
}else if( target instanceof Parent ){
// What should I write here to create IObservable for
"types1", "types2", "types3" ????
}else{
return new EmptyObservableList(Realm.getDefault(), null);
}
}
}
Previous Topic:Add/Edit Watch expression and code completion
Next Topic:Error while updating RCP app through Eclipse Update Framework
Goto Forum:
  


Current Time: Sun Jun 30 00:05:00 GMT 2024

Powered by FUDForum. Page generated in 0.02594 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top