Programmatically showing a View from an Eclipse Plug-in

Brian picture Brian · Oct 5, 2008 · Viewed 24.1k times · Source

I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu.

I would think that there would be something in the workbench singleton that could handle this, but I have not found out how anywhere.

Answer

ILikeCoffee picture ILikeCoffee · Oct 5, 2008

You are probably looking for this:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("viewId");