I need to add an element on a tree object in an Eclipse plug-in into a specified position.
I use org.eclipse.jfa ce.viewers.Tree Viewer for the viewer.
I want to insert an item before the current selected one, for having the selected item I use the viewer.getTree( ).getSelection( )[0] instruction, but I can't find the right position. if I use the viewer.getTree( ).getItems() I only receive the root elements and not all items (also under the roots elements).
so when I pass the selected item on viewer.getTree. indexOf( elem ) instruction, I receive -1
Any suggestions?
Thanks
I use org.eclipse.jfa ce.viewers.Tree Viewer for the viewer.
I want to insert an item before the current selected one, for having the selected item I use the viewer.getTree( ).getSelection( )[0] instruction, but I can't find the right position. if I use the viewer.getTree( ).getItems() I only receive the root elements and not all items (also under the roots elements).
so when I pass the selected item on viewer.getTree. indexOf( elem ) instruction, I receive -1
Any suggestions?
Thanks
Comment