TreeViewer - setSelection [message #266973] |
Sat, 14 August 2004 16:26 |
Jochen Kressin Messages: 9 Registered: July 2009 |
Junior Member |
|
|
Hi,
Using Eclipse 3.0, i have two questions on TreeViewer´s setSelection
method. Background: I create a TreeViewer where some particular,
identical items (objects) are inserted multiple times at different
positions in the tree hierarchy. The objects are equal in terms of the
equals() - method.
1) When I call setSelection with an object which was inserted in the
tree multiple times, the TreeViewer chooses one of them arbitrarily. Is
there any way to influence this behaviour, e.g. tell the TreeViewer that
it should start the search for the object starting from a particular
node in the tree?
2) When the TreeViewer was initialized, i.e. the setInput() method was
called, but the user did not click any node, the setSelection() - method
does not work. No item is selected whatsoever. If the user expands one
node in the tree before setSelection() is called, it works. Is this
behaviour known? Right now I use a workaround: Before the tree is
visible, I programmatically expand and the collapse all the nodes.
Thanks in advance for your answers.
Jochen
|
|
|
Powered by
FUDForum. Page generated in 0.02914 seconds