Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » getItems() only works on expanded TreeItems
getItems() only works on expanded TreeItems [message #280158] Mon, 31 January 2005 09:47 Go to next message
Eclipse User
Originally posted by: devin_steffler.ca.ibm.com

Can you explain the following? I don't see why TreeItems need to be
expanded in order for getItems() to return something useful.

// the following line only works if viewer.getTree().getItems()[0] is
expanded
TreeItem[] testing = viewer.getTree().getItems()[0].getItems();
viewer.setContentProvider(new ViewContentProvider(file));
// if I do viewer.expandAll(); here then below works fine, but not if I use
viewer.expandToLevel(Object, int)
testing = viewer.getTree().getItems()[0].getItems();
Re: getItems() only works on expanded TreeItems [message #280230 is a reply to message #280158] Tue, 01 February 2005 03:04 Go to previous message
Eclipse User
Originally posted by: scheglov_ke.nlmk.ru

Devin Steffler пишет:
> Can you explain the following? I don't see why TreeItems need to be
> expanded in order for getItems() to return something useful.
>
> // the following line only works if viewer.getTree().getItems()[0] is
> expanded
> TreeItem[] testing = viewer.getTree().getItems()[0].getItems();
> viewer.setContentProvider(new ViewContentProvider(file));
> // if I do viewer.expandAll(); here then below works fine, but not if I use
> viewer.expandToLevel(Object, int)
> testing = viewer.getTree().getItems()[0].getItems();
>
JFace TreeViewer is smart enough to don't ask for full tree content.
It creates real TreeItem's only when needed, i.e. when user expand some
visible item.

--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Previous Topic:bootup my plugin from an action
Next Topic:I have some question about eclipse 1.0
Goto Forum:
  


Current Time: Wed Apr 16 07:01:05 EDT 2014

Powered by FUDForum. Page generated in 0.01491 seconds