views:

20

answers:

1

I don't know RCP very well yet, but I've been reading a lot of the docs. I don't know if my question makes sense; I apologize if not and beg that you try to work out what I mean and come up with some kind of answer.

I have a tree view element, which has a double click listener on it. In another part of the window there is a layout folder which contains views that are supposed to be inspectors for the items double-clicked on.

The only way I know to make another inspector appear is:

getActivePage().showView(Inspector.ID). 

showView() doesn't give any opportunity to pass extra information to the view, so can it know which element to inspect?

Pointers in different directions appreciated. The Vogel tutorial doesn't seem to cover this, or I don't understand it.

A: 

You could check if the article "Link to Editor" can help you here.
That is, instead of trying to access the right view, define a Listener for the Editors:

private IPartListener2 partListener2 = new IPartListener2() {
  public void partActivated(IWorkbenchPartReference ref) {
    if (ref.getPart(true) instanceof IEditorPart)
      editorActivated(getViewSite().getPage().getActiveEditor());
}

That way, you can get back the right Editor, and ask that Editor all you need for your View to update accordingly.

VonC