精简 Eclipse 上下文菜单

发布于 2024-10-14 12:49:46 字数 461 浏览 1 评论 0原文

我的 Eclipse 3.5.2 (Ubuntu 10.10) 安装中安装了多个插件(Apatana、SVN、Pydev、Zend Debugger、PHP)。自从几年前我第一次使用 Eclipse 以来,一直困扰我的一个问题是,每个插件都会将新条目放入上下文菜单中。

不幸的是,似乎各个角度都无法确定,哪些菜单项是无用的。因此,在进行 PHP 编程时,菜单中充满了 java 和 pydev 的东西,我真的没有用!

安装的插件越多,菜单就越混乱。这似乎有点奇怪,如此丰富的 IDE 不支持上下文敏感的“上下文”菜单...:-(

我的希望是,在互联网上的某个地方,有人知道如何删除未使用的菜单项,或者甚至为此创建了一个小插件

屏幕截图: https://i.sstatic.net /D9HjN.png

I have several plugins (Apatana, SVN, Pydev, Zend Debugger, PHP) installed in my Eclipse 3.5.2 (Ubuntu 10.10) installation. The one problem that keeps bugging me since I first used Eclipse years ago is, that each plugin puts new entries into the context menus.

Unfortunately, it seems that the various perspectives are not able to determine, what menu entries are useless. So while programming PHP the menus are full of java and pydev stuff, I really have no use for!

The more plugins are installed the messier the menus get. It seems a bit odd, that such a rich IDE doesn't have support for context sensitive "context" menus ... :-(

My hope is, that somewhere out there on the internet, someone knows how to remove unused menu entries, or even has created a small plugin for that??

Any ideas?

Screenshot: https://i.sstatic.net/D9HjN.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

も让我眼熟你 2024-10-21 12:49:46

Eclipse 为插件开发人员提供“功能”作为功能,为用户提供一种禁用其插件的功能和 UI 贡献的方法。我真的不知道该功能是否对您的情况有帮助(也就是说:提供困扰您的菜单条目的插件是否已定义了禁用它们的必要功能)。

如果您转到 Window >首选项,然后常规>功能,您可以看到许多要启用或禁用的“功能”类别。我不建议禁用类别本身(例如“开发”),因为您会立即禁用所有 Ant、Java、Python...菜单和扩展。相反,使用本页底部的“高级...”菜单不仅可以查看类别,还可以查看它们包含的内容。在“开发”下,您应该能够禁用“java 开发”(JDT) 扩展和菜单、“Ant 开发”(还记得“Run Ant Tool”按钮在“Run”按钮旁边的所有视角上都可见吗?这将删除它)...您应该能够通过此禁用大部分混乱。

请注意,如果提供的功能不够,您可以非常轻松地创建自己的功能,甚至可以禁用其他插件的贡献。为此,步骤很简单:

  1. 使用 File >新的>其他... 菜单项
  2. 选择插件项目并根据需要命名新项目,单击完成
  3. 在打开的编辑器中,选择“扩展”选项卡
  4. 单击添加,取消选中“仅显示所需插件中的扩展点”,
  5. 搜索扩展点 org.eclipse.ui.activities,选择它,然后点击完成
  6. 右键单击左侧的项目org.eclipse.ui.activities并选择New > Activity
  7. 在页面右侧输入新活动的 ID,例如 my.disable.activity.id。在其下方输入一个人类可读的名称;例如“禁用 JDT”。
  8. 右键单击左侧的项目 org.eclipse.ui.activities 并选择 New >活动模式绑定
  9. 在“activityId”字段中重新输入您的活动 ID (my.disable.activity.id),然后输入“模式”您希望禁用的贡献。这是一个正则表达式。要禁用所有“JDT”(java 开发)贡献,请输入 org\.eclipse\.jdt\..*
  10. 右键单击​​该项目 org.eclipse.ui.activities > 并选择新建 > categoryActivityBinding
  11. 在“activityId”字段中再次输入您的活动 ID (my.disable.activity.id);然后点击“categoryId”字段右侧的浏览...。双击 org.eclipse.categories.developmentCategory,使其出现在功能启用的首选项菜单中。

现在,如果您导出此插件(我不会在这里详细介绍更新站点的创建,您应该能够适应 Stephane Begaudeau 的博客),JDT 中的所有菜单都将被禁用(我对此进行了测试,所以我知道它至少会禁用我检查过的那些(右键单击 Java 文件的“源”和“重构”菜单)当您指定类别时,您可以从我在开头暗示的功能首选项页面中重新启用这些菜单项。这个答案。

Eclipse provides "capabilities" as a functionality for the plugin developpers to provide a way to the users to disable the features and UI contributions of their plugins. I don't really know if that feature will help in your case (that is : if the plugins contributing the menu entries that bother you have defined the necessary capability to disable them).

If you go to Window > Preferences, then General > Capabilities, you can see a number of "capabilities" categories to enable or disable. I don't recommend disabling the categories themselves (for example "development") as you would disable all of Ant, Java, Python... menus and extension at once. Rather, use the "Advanced..." menu at the bottom of this page to see not only the categories, but also what they contain. There, under "Development", you should be able to disable "java development" (JDT) extensions and menus, "Ant Development" (remember that "Run Ant Tool" button that is visible on all perspectives beside the "Run" button? That would remove it)... You should be able to disable most of the clutter with this.

Note that if the provided capabilities are not sufficient, you can create your own very easily, allowing you to disable even the contributions from other plugins. For this the steps are simple :

  1. Use the File > New > Other... menu item
  2. Select Plug-in Project and name the new project as you desire, click Finish
  3. In the editor that has opened, select the "Extensions" tab
  4. Click Add, untick "Show only extensions points from the required plug-ins"
  5. search for the extension point org.eclipse.ui.activities, select it, and hit Finish
  6. Right click the item org.eclipse.ui.activities on the left and select New > Activity
  7. enter the id of your new activity on the right of the page, for example my.disable.activity.id. Enter a human-readable name below it; for example "disable JDT".
  8. Right click the item org.eclipse.ui.activities on the left and select New > activityPatternBinding.
  9. re-enter your activity Id (my.disable.activity.id) in the "activityId" field, then enter the "pattern" of the contributions you wish to disable. This is a regex. In order to disable all "JDT" (java development) contributions, enter org\.eclipse\.jdt\..*
  10. Right click the item org.eclipse.ui.activities on the left and select New > categoryActivityBinding
  11. re-enter your activity Id (my.disable.activity.id) in the "activityId" field once again; then click Browse... at the right of the "categoryId" field. Double click the org.eclipse.categories.developmentCategory so that it appears in the preference menu for capability enablement.

Now, if you export this plugin (I won't detail the update site creation here, you should be able to adapt the explanation from Stephane Begaudeau's blog), all menus from the JDT will be disabled (I tested this, so I know it at least disables those I checked (the "source" and "refactor" menus from a right-click on a Java file). As you specified a category, you can re-enable these menu items from the capabilities preference page I hinted at in the beginning of this answer.

寄意 2024-10-21 12:49:46

并不是真正解决您的问题,但无论如何值得一提:Eclipse 确实支持上下文相关菜单,但插件开发人员定义了应显示菜单条目的上下文。
不幸的是,许多开发人员并不关心并说“让它随处可见”。解决办法就是大声向他们抱怨。

Not really a solution for your problem, but worth mentioning anyway: Eclipse does support the context sensitive menus, but in a way where the plug-in developer defines the contexts where the menu entries should be displayed.
Unfortunately many developers don't care and say "Make it visible everywhere". The solution then is to complain loudly to them.

清眉祭 2024-10-21 12:49:46

不是一个完整的解决方案,而是更多的解决方法。您可以为 Ubuntu 安装 clearlooks compact 主题。它大大减小了组件的大小,即使在 Eclipse 中也是如此。

Not a complete solution, but more of a workaround. You can install clearlooks compact theme for Ubuntu. It considerably reduces the size of components, even in Eclipse.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文