Han*_*sen 14 eclipse rcp preferences
我有一个eclipse rcp,想要隐藏安全性并帮助prerence页面.我怎样才能做到这一点?
小智 19
我正在寻找相同的东西,并在此链接中找到了解决方案:
http://sourceforge.net/apps/trac/fable/wiki/Preferences
干杯.斯特凡
将以下代码放入您的子类中org.eclipse.ui.application.WorkbenchAdvisor,并从RCP首选项对话框中删除"帮助"组:
public void postStartup() {
PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager( );
pm.remove( "org.eclipse.help.ui.browsersPreferencePage" );
}
Run Code Online (Sandbox Code Playgroud)
" org.eclipse.help.ui.browsersPreferencePage"是首选项扩展点的ID.
添加透视首选项
备注:要查找插件ID首选项,请选择Window-->show view--> PDE Runtime--> Plugin Registry.....并尝试查找您要查找的内容.....
例如,对于" Workbench preferences",请查看fable.eclipse.ui.ide和扩展名org.eclipse.ui.preferencePages:id="org.eclipse.ui.preferencePages.Workbench"
如果您只想添加透视(例如)首选项,请在MANIFEST.XML以下位置添加首选项扩展名:
id : org.eclipse.ui.preferencePages.Perspectives
name:perspective(fable)
class:org.eclipse.ui.internal.ide.dialogs.IDEPerspectivesPreferencePage
//Add : org.eclipse.ui.ide in your Dependencies
Run Code Online (Sandbox Code Playgroud)
在ApplicationWorkBenchAdvisor中:
public void postStartup() {
PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager( );
pm.remove( ""org.eclipse.ui.preferencePages.Workbench"browsersPreferencePage" );
}
public String getInitialWindowPerspectiveId() {
IPreferenceStore pref = Activator.getDefault().getPreferenceStore();
String ret = pref.getDefaultString(IWorkbenchPreferenceConstants.DEFAULT_PERSPECTIVE_ID);
ret=(ret==null || ret.equals(""))?"yourDefaultPerspectiveID":ret;
return ret;
}//
Run Code Online (Sandbox Code Playgroud)
- 定义与不同访问级别相对应的单独活动
- 在常规操作集中定义您的操作,根据访问级别进行分组
- 通过
activityPatternBinding元素将每个活动与适当的动作集相关联- 在工作台生命周期的早期,例如从您
WorkbenchAdvisor的preStartup()方法中,在身份验证之后设置启用的活动ID .
(注意,上面是基于用户权限的过滤,但它可以推广到其他标准.)
关于存储和帮助的首选项页面,您应该将这些页面的ID与您知道可以禁用的活动绑定:
<activityPatternBinding
activityId="org.eclipse.javaDevelopment"
pattern="org\.eclipse\.help\..*/.*">
</activityPatternBinding>
Run Code Online (Sandbox Code Playgroud)
将禁用与帮助相关的所有菜单/首选项/视图.
如果你使用org.eclipse.help.ui.PrefPageHelp\..*,它只会绑定prefPageHelp和prefPageHelpContent.
如果您添加了另一个活动绑定扩展
org.eclipse.equinox.security.ui.sec_storage_preferences_context,那么它也会处理安全存储首选项页面.
| 归档时间: |
|
| 查看次数: |
7258 次 |
| 最近记录: |