如何从Eclipse-RCP中的导入向导中删除类别? [英] How to remove a Category from Import wizard in Eclipse-RCP?

查看:193
本文介绍了如何从Eclipse-RCP中的导入向导中删除类别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的eclipse-rcp应用程序中添加导入向导。为此,我想使用只有我的类别的现有向导。我在互联网上找到了几个例子,但它们并没有多大帮助。

I need to add an import wizard into my eclipse-rcp app. For that I would like to use existing wizard with only my categories. I found couple of examples in the Internet, but they didn't help much.

我的问题是我不仅有我的类别,还有通用类别。如果可能的话,我想删除它。实际上我找到了一个这里的解决方案,但看起来,它似乎不管用。我试图在WorkbrenchWindowAdvisor和ActionBarAdvisor中提供提供的代码片段,甚至在创建向导之前执行它,但是仍有5个可能向导的常规类别。任何建议,如何删除它或至少隐藏?

My problem is that I have not only my category, but also the General category. I would like to remove it, if possible. Actually I have found one solution here, but it seems, that it is not working. I've tried to put provided code snippet in WorkbrenchWindowAdvisor and in ActionBarAdvisor and even execute it before my wizard is created, but General category with 5 possible wizards is still there. Any suggestions, how to remove it or at least hide?

BR,
AlexG。

BR, AlexG.

推荐答案

您可以使用 org.eclipse.ui.activities 具有相应<$ c $的扩展点c> activityPatternBinding (尽管他们在您链接的页面上说了什么)。

You can choose which contributions are visible in your RCP application by using org.eclipse.ui.activities extension point with appropriate activityPatternBinding (despite of what they say at the page that you linked).

使用此扩展点,您可以定义一个活动除了你自己的贡献之外什么都匹配的模式(例如 pattern =[^ \。] ++ \。(?!myplugin)。*匹配与ID的贡献 - 不是以com.myplugin开头的)。此活动在未启用时将排除来自UI的所有贡献,除了您自己的。

Using this extension point you can define one activity with a pattern that matches anything but your own contributions (e.g. pattern="[^\.]++\.(?!myplugin).*" matches contributions wiht ID-s not starting with com.myplugin). This activity, when not being enabled, will exclude all the contributions from UI except your own.

通过另一个活动,您将定义一个模式,其中包含您所做的贡献喜欢从其他插件中包含(例如 pattern =。* file\.import与文件菜单中的导入...菜单项匹配)。这是您将在 WorkbenchAdvisor 使用

With another acitvity you will define a pattern that includes the contributions that you'd like to include from other plugins (e.g. pattern=".*file\.import" matches the Import... menu item in File menu). This is the activity that you will enable in your WorkbenchAdvisor using

PlatformUI.getWorkbench().getActivitySupport().setEnabledActivityIds(...);

请注意,此特定解决方案将禁用(几乎)所有Eclipse贡献,但文件>导入除外。 ..如果您想要启用大量功能并且仅禁用小部件,则需要进行相当多的挖掘。但是,最有可能找出正确的模式来实现这一目标。

Please note that this particular solution will disable (almost) all of the Eclipse contributions except File > Import... It will take quite a bit of digging if you want to have a lot of functionality enabled and only small parts disabled. But it's mostly possible to figure out correct patterns to achieve this.

这篇关于如何从Eclipse-RCP中的导入向导中删除类别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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