[databinding] ObservableTreeContentProvider and WritableList used together? [message #522673] |
Tue, 23 March 2010 14:59 |
Marco Vettorello Messages: 4 Registered: March 2010 |
Junior Member |
|
|
Hello everybody,
I'm working in a project where we currently want need to provide a simple view in form of tree of a WritableList.
Since I start using WritableList and TableViewer there was no problem using the ObservableListContentProvider.
Now, that i need to use a TreeViewer, I have problem with the respective ObservableTreeContentProvider.
It need 2 the implementation of an ObservableFactory and a TreeSctureAdvisor.
Inside the WritableList I have either parents and childrens all toghether and at the moment I can't change the implementation of this list.
I really can't understand how to implement the ObservableFactory having this WritableList as unique a model.
Somebody can help me?
Thanks
Marco
[Updated on: Tue, 23 March 2010 15:00] Report message to a moderator
|
|
|
|
Re: ObservableTreeContentProvider and WritableList used together? [message #523404 is a reply to message #523350] |
Fri, 26 March 2010 10:32 |
Marco Vettorello Messages: 4 Registered: March 2010 |
Junior Member |
|
|
Dear Matthew,
Thanks so much for your help, this partially solve my problem.
your solution put a light on my darkness onside the IObservableFactory.
I managed to change a little bit my Model separating parents and leafs, using inside each parents a WritableList for the children like this:
public IObservable createObservable(final Object element){
if (element instanceof WritableList) { //parents
return ModelProvider.getInstance().getGateways(); //writableList
}
else if (element instanceof Gateway) { //childrens
return ((Gateway)element).getChilds(); //writablelist
}
return BeanProperties.list("children").observe(element);
}
This solve my problem on the IObservableFactory, looking for elements and returning childrens WritableList or parents WritableList.
However, did you think I really neccessary to bind my model WritableList to a new one inside the IObservableFactory, or i ca just return my model WritableList?
Thanks for your help!
Marco
[Updated on: Fri, 26 March 2010 10:34] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02464 seconds