java - How to select a treeview node from code in eclipse-plugin -


i have custom outline in eclipse plug-in, implemented using class treeviewer , created outline using code:

public class myoutlinepage extends contentoutlinepage (...)             object[] data = (...)             treeviewer treeviewer = gettreeviewer();             treeviewer.setinput(data); 

and after set input need select 1 specific element in outline. example, need select element data[2] in outline. must same click in element using mouse.

the tree viewer has setselection method programmatically change selection. if wrap domain object structuredseletion corresponding treeitem selected.

treeviewer.setselection( new structuredselection( data[2] ) ); 

Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -