How To Add Perspectives In Eclipse

If I have two versions of Eclipse installed, how do I add a perspective that I've installed in one [version of eclipse] to the other? How do perspectives get added in the first place? I.e., where do they come from (don't tell me "the 'Open Perspective' dialog")?


Solution 1:

Since the chosen answer is a little bit "poor" on the details on "where do the perspectives come from", here are some precisions:

A perspective in Eclipse is really just a named organization of views, menus, and toolbars that can be saved and switched to - a unique tab of the application organized for a particular task or set of tasks.

So a perspective comes either from:

  • you: you can modify any perspective, adding view, removing menus, adding toolbars, ... and then saving the result (the current modified perspective) under a new name.

alt text http://www.javalobby.org/images/postings/rj/eclipse_perspective/1.gif

  • a plugin: for that, a plugin declares a extension point for perspective contribution: org.eclipse.ui.perspectives. A new perspective is added to the workbench by defining an extension for this point. In the example below a perspective extension is defined for the Test Perspective. This declaration contains the basic elements: id, name and class.

A complete description of the extension point and the syntax are available in the developer documentation for org.eclipse.ui. The attributes are described as follows.

  • id - a unique name that will be used to identify this perspective.
  • name - a translatable name that will be used in the workbench window menu bar to represent this perspective.
  • class – a fully qualified name of the class that implements org.eclipse.ui.IPerspectiveFactory interface.
  • icon - a relative name of the icon that will be associated with this perspective.

This extension point is used to add perspective factories to the workbench.
A perspective factory is used to define the initial layout and visible action sets for a perspective. The user can select a perspective by invoking the "Open Perspective" submenu of the "Window" menu.


This is why copying a plugin from one installation of eclipse into the dropin folder of the other eclipse will make the perspective available to your second Eclipse installation.
(As the last link suggests, you could define a plugin bundle location in order for your two Eclipse to share a common bundle of plugins).

More details on the transfer of plugins between diffent Eclipse (of different versions) in this SO question "How Do You Reinstall Installed Eclipse Plugins?".

Solution 2:

Eclipse perspectives are usually defined by features / plugins. If you are missing a certain perspective check the list of installes features / plugins.