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

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -