精简 Eclipse 上下文菜单
我的 Eclipse 3.5.2 (Ubuntu 10.10) 安装中安装了多个插件(Apatana、SVN、Pydev、Zend Debugger、PHP)。自从几年前我第一次使用 Eclipse 以来,一直困扰我的一个问题是,每个插件都会将新条目放入上下文菜单中。
不幸的是,似乎各个角度都无法确定,哪些菜单项是无用的。因此,在进行 PHP 编程时,菜单中充满了 java 和 pydev 的东西,我真的没有用!
安装的插件越多,菜单就越混乱。这似乎有点奇怪,如此丰富的 IDE 不支持上下文敏感的“上下文”菜单...:-(
我的希望是,在互联网上的某个地方,有人知道如何删除未使用的菜单项,或者甚至为此创建了一个小插件
?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Eclipse 为插件开发人员提供“功能”作为功能,为用户提供一种禁用其插件的功能和 UI 贡献的方法。我真的不知道该功能是否对您的情况有帮助(也就是说:提供困扰您的菜单条目的插件是否已定义了禁用它们的必要功能)。
如果您转到
Window >首选项
,然后常规>功能
,您可以看到许多要启用或禁用的“功能”类别。我不建议禁用类别本身(例如“开发”),因为您会立即禁用所有 Ant、Java、Python...菜单和扩展。相反,使用本页底部的“高级...”菜单不仅可以查看类别,还可以查看它们包含的内容。在“开发”下,您应该能够禁用“java 开发”(JDT) 扩展和菜单、“Ant 开发”(还记得“Run Ant Tool”按钮在“Run”按钮旁边的所有视角上都可见吗?这将删除它)...您应该能够通过此禁用大部分混乱。请注意,如果提供的功能不够,您可以非常轻松地创建自己的功能,甚至可以禁用其他插件的贡献。为此,步骤很简单:
File >新的>其他...
菜单项org.eclipse.ui.activities
,选择它,然后点击完成org.eclipse.ui.activities
并选择New > Activity
my.disable.activity.id
。在其下方输入一个人类可读的名称;例如“禁用 JDT”。org.eclipse.ui.activities
并选择New >活动模式绑定
。my.disable.activity.id
),然后输入“模式”您希望禁用的贡献。这是一个正则表达式。要禁用所有“JDT”(java 开发)贡献,请输入org\.eclipse\.jdt\..*
org.eclipse.ui.activities
> 并选择新建 > categoryActivityBinding
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
, thenGeneral > 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 :
File > New > Other...
menu itemorg.eclipse.ui.activities
, select it, and hit Finishorg.eclipse.ui.activities
on the left and selectNew > Activity
my.disable.activity.id
. Enter a human-readable name below it; for example "disable JDT".org.eclipse.ui.activities
on the left and selectNew > activityPatternBinding
.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, enterorg\.eclipse\.jdt\..*
org.eclipse.ui.activities
on the left and selectNew > categoryActivityBinding
my.disable.activity.id
) in the "activityId" field once again; then click Browse... at the right of the "categoryId" field. Double click theorg.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.
并不是真正解决您的问题,但无论如何值得一提: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.
不是一个完整的解决方案,而是更多的解决方法。您可以为 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.