title: Identify which instance of the view is currently active in RCP?
body: <p>I am creating an 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</p>
  
  <p>I have a graph view called <code>Views.GraphView</code>. I opened different instances of it from a command called <code>openGraphView</code> to show different graphs. The command is as follows:</p>
  
  <pre><code>page.showView("Views.GraphView", Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
  </code></pre>
  
  <p>Now, I have a command called <code>TreeLayout</code> on this <code>Views.GraphView</code> toolbar, which suppose to change the layout of the graph and it will operate on each instance of the view. But for this, I think, I need to identify which instance of the view is active. The <code>TreeLayout</code> command looks something like this:</p>
  
  <pre><code>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());
  </code></pre>
  
  <p>So how can I identify which instance of the view is currently active and to operate on it?</p>