如何在Eclipse中添加透视图 [英] How To Add Perspectives In Eclipse

查看:165
本文介绍了如何在Eclipse中添加透视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我安装了两个版本的Eclipse,那么如何将一个[eclipse版本]中安装的透视图添加到另一个?首先如何添加观点?即,他们来自哪里(不要告诉我开放视角对话框)?

解决方案

关于透视来源的细节,选择的答案有点穷,这里有一些细节:



A 透视 实际上只是一个命名的组织的视图,菜单,和可以保存和切换到的工具栏 - 为特定任务或一组任务组织的应用程序的唯一选项卡。



所以一个透视来自: p>


  • 您可以修改任何视角,添加视图,删除菜单,添加工具栏,然后保存结果(当前修改的透视图)






  • 一个插件:为此,一个插件声明透视贡献的扩展点:org.eclipse.ui.perspectives 。通过为这一点定义一个扩展,将一个新的透视图添加到工作台。在下面的例子中,为透视扩展定义了测试透视图。此声明包含基本元素:id,name和class。









扩展点和语法的完整描述可在 org.eclipse.ui的开发人员文档 。属性描述如下。




  • id - 用于标识此透视图的唯一名称。

  • 名称 - 将在工作台窗口菜单栏中使用的可翻译名称来表示此视角。

  • class - 实现org.eclipse.ui.IPerspectiveFactory接口的类的完全限定名称。

  • 图标 - 相对名称与此透视图相关联的图标。



此扩展点用于将透视工具添加到工作台。

透视工厂用于定义透视图的初始布局和可见动作集。用户可以通过调用窗口菜单的开放透视子菜单来选择透视图。






这就是为什么将插件从一次安装的eclipse复制到 另一个Eclipse的dropin文件夹 将使您的第二个Eclipse安装的透视图可用。

(最后一个链接建议,您可以定义一个插件包位置,以使您的两个Eclipse共享一个常见的插件包)。



有关在此SO问题如何重新安装已安装的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")?

解决方案

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

这篇关于如何在Eclipse中添加透视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆