How To Add Perspectives In Eclipse

后端 未结 3 1841
走了就别回头了
走了就别回头了 2020-11-30 11:32

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

相关标签:
3条回答
  • 2020-11-30 12:00

    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?".

    0 讨论(0)
  • 2020-11-30 12:09

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

    0 讨论(0)
  • 2020-11-30 12:11

    Editors and other plug-ins might add their own perspectives. You can also create and save your own perspectives, but I believe you're asking about perspectives added by plug-ins.

    The solution is to install the same plug-ins.

    0 讨论(0)
提交回复
热议问题