TreeViewer Adding items on expand Event [message #199815] |
Thu, 15 March 2007 23:08 |
Eclipse User |
|
|
|
Originally posted by: alexyermolovich.gmail.com
Hello.
I am trying to add items to a tree when the branch is epxanded. I
implemented the ITreeViewerListener. Problem is when I add the object to
the node on which expansion happens and do refresh everything disapears.
When it expands it just shows empty branch. The new object is added to the
parent node, just UI never gets updated. When I add an object by firing a
button event in my view, new object is added and branch shows all the
objects including previously added ones. The code is exactly the same for
adding an object and refreshing a tree. Only difference on expand event I
get the parent object from:
TreeExpansionEvent event.
Object tempObj = event.getElement();
And when I when I click on a button I get parent object by going doing
this:
IStructuredSelection selection = (IStructuredSelection)
treeViewer.getSelection();
Model selectedDomainObject = (Model) selection.getFirstElement();
Is this a bug or am I missing something?
|
|
|
Powered by
FUDForum. Page generated in 0.08938 seconds