Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » TreeViewer+ObservableListTreeContentProvider: how to limit visualization depth?
TreeViewer+ObservableListTreeContentProvider: how to limit visualization depth? [message #1385154] Wed, 04 June 2014 16:03 Go to next message
Andriy Fomenko is currently offline Andriy FomenkoFriend
Messages: 21
Registered: May 2013
Junior Member
I have a working model, where TreeViewer gets data from the model supplied by the ObservableListTreeContentProvider:

IListProperty childrenProperty = new MultiListProperty( new IListProperty[] { BeanProperties.list(ModelSetObject.class, "children") }, ModelAbstractEntity.class );
contentProvider = new ObservableListTreeContentProvider( childrenProperty.listFactory(), null );
resTree.setContentProvider(contentProvider);


I'm also supplying ObservableMapLabelProvider as needed

What I want to accomplish is to limit the visualization depth to 2 layers deep (my model is 3-layers).

Is it something which can be forced on ObservableListTreeContentProvider ?
Re: TreeViewer+ObservableListTreeContentProvider: how to limit visualization depth? [message #1385355 is a reply to message #1385154] Thu, 05 June 2014 19:16 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 761
Registered: July 2009
Senior Member
You can override the hasChildren(Object) method and determine if the given element has the required depth (<=2) and return super.hasChildren(), else return false...

Andriy Fomenko wrote on Wed, 04 June 2014 18:03
I have a working model, where TreeViewer gets data from the model supplied by the ObservableListTreeContentProvider:

IListProperty childrenProperty = new MultiListProperty( new IListProperty[] { BeanProperties.list(ModelSetObject.class, "children") }, ModelAbstractEntity.class );
contentProvider = new ObservableListTreeContentProvider( childrenProperty.listFactory(), null );
resTree.setContentProvider(contentProvider);


I'm also supplying ObservableMapLabelProvider as needed

What I want to accomplish is to limit the visualization depth to 2 layers deep (my model is 3-layers).

Is it something which can be forced on ObservableListTreeContentProvider ?

Re: TreeViewer+ObservableListTreeContentProvider: how to limit visualization depth? [message #1385369 is a reply to message #1385355] Thu, 05 June 2014 21:46 Go to previous message
Andriy Fomenko is currently offline Andriy FomenkoFriend
Messages: 21
Registered: May 2013
Junior Member
Thank you, your suggestion helped.
Previous Topic:not able to compile latest source code of eclipse
Next Topic:How to change font size of open-files list?
Goto Forum:
  


Current Time: Sun Apr 19 03:26:51 GMT 2015

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

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