Hi,
I am creating a RCP application. I need to open multiple instances of the same view but with different data. I did it by setting secondary id for different instances of the same view. Specifically, my problem is as follows: Please take a look,
i have a graph view called "Views.GraphView". I opened different instances of it from a command called "openGraphView" to show different graphs. the command is as follows:
page.showView("Views.GraphView", Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
Now, I have a command called "TreeLayout" on this "Views.GraphView" toolbar, which suppose to change the layout of the graph and it will operate on each instace of the view. But for this, i think, i need to identify which instance of the view is active. the "TreeLayout" command looks something like this:
IViewPart findView = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage(). findView( "Views.GraphView"); //i think in the findView i need to give the id of the view [but how can i put the secondary id!!]
GraphView view = (GraphView) findView; view.changeLayout(); //i wrote this method in the graph view to change the layout
//i just tried to print the secondary id, but it did not print anyting System.out.println("From treelayout command:- " + view.getViewSite().getSecondaryId());
So how can i identify whcih instance of the view is currently active and to operate on it? Please, provide some solution.
Thanks,
-Syeed