Viewpoints – Output all Eclipse views your are using
I received the question how someone could see all available views.
This is easy, Eclipse 3.x allows access to the current available views via PlatformUI.getWorkbench().getViewRegistry().
For example this command handler prints out the ID’s of all available views.
public class SampleHandler extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
// Views
System.out.println("All my View ID's");
IViewRegistry viewRegistry = PlatformUI.getWorkbench().getViewRegistry();
IViewDescriptor[] views = viewRegistry.getViews();
for (IViewDescriptor iViewDescriptor : views) {
System.out.println(iViewDescriptor.getId());
}
return null;
}
}
Filed under: Eclipse
September 20th, 2010 at 8:13 pm
How does one remove or hide a view that’s in the registry?
I’ve got a RCP application that I’m developing and I want to prevent the Outline view from showing up in the “Show View” dialog.
Thanks!
September 21st, 2010 at 12:00 pm
@david: don’t include it in your product configuration would be the simple answer.