Chris
Chris

Reputation: 4588

How do I create a dockable "perspective-like" view in Eclipse PDE?

I've been searching for this information via Google but can't seem to get a satisfactory answer.

I wish to create a dockable view (similar to the "perspective" selection toolbar item) in Eclipse but don't really know which is the appropriate extension point to use.

The intent of this is to create some buttons on the top left of the toolbar when a certain perspective is activated. The "perspective" type view matches the behavior I wish to see.

So my question is:

Upvotes: 1

Views: 149

Answers (1)

Paul Webster
Paul Webster

Reputation: 10654

You can add a toolbar with your own commands to the main toolbar using org.eclipse.ui.menus. You would put a visibleWhen element on the command elements if you want it only visible when a certain perspective is open.

<visibleWhen>
   <with variable="activeWorkbenchWindow.activePerspective">
      <equals value="the.perspective.id"/>
   </with>
</visibleWhen>

See Toolbar Example for an example of the org.eclipse.ui.menus extension point, and Plugging into the Workbench for some basics on commands.

Upvotes: 1

Related Questions