1

I have a tree view that is acting as a selection provider. In response to different types of selected items I would like to show a view. (Instantiate it is needed).

Can I do this by VIEW_ID and the workbench getViewRegistry?

i-blis
  • 3,149
  • 24
  • 31
JeffV
  • 52,985
  • 32
  • 103
  • 124
  • possible duplicate of [Programmatically showing a View from an Eclipse Plug-in](http://stackoverflow.com/questions/171824/programmatically-showing-a-view-from-an-eclipse-plug-in) – Eduardo May 07 '14 at 02:32

1 Answers1

2

The basic technique is described best by the article
"Make your Eclipse applications richer with view linking",
based on a "selection provider-selection listener" pattern, which is a handy way to create views that respond to changes in other views, updated now with the Selection Service.

Something like:

IViewRegistry viewRegistry = this.getWorkbenchWindow().getWorkbench().getViewRegistry();
IViewDescriptor desc = viewRegistry.find(VIEW_ID);
window.getActivePage().showView(VIEW_ID);

should be able to open/create the view

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250