插件开发或RCP中如何通过actions扩展点配置工具栏按钮(插入到指定的ToolBarManger中)
来源:互联网 发布:传智python视频百度云 编辑:程序博客网 时间:2024/05/15 16:12
在插件或RCP开发中,我们通常使用org.eclipse.ui.actions扩展点配置菜单和工具按钮。
eg:
<extension
point="org.eclipse.ui.actionSets">
<actionSet
id="test.actionSet"
label="Sample Action Set"
visible="true">
<action
class="test.actions.SampleAction"
icon="icons/sample.gif"
id="test.actions.SampleAction"
label="&Sample Action"
menubarPath="sampleMenu/sampleGroup"
toolbarPath="start/additions"//重点看这里,start是在代码中指定的ToolBarManager的id,additions是插入点
tooltip="Hello, Eclipse world">
</action>
</actionSet>
</extension>
我们这次主要看看toolBarPath。这个路径是以工具(id)开头,以"/"分隔的路径。
在RCP开发中,我们可能会先定义一些ToolBarManager,同时在ToolBarManger中添加一些插入点(InsertPoint)。
然后在actionSets扩展点中配置toolbarPath(形如toolbarMangerId/insertpointId)。
我们在RCP中可能会定义成这个样子:
IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
toolbar.add(openViewAction);
toolbar.add(messagePopupAction);
//ToolBar中定义一个插入点,GroupMarker与Separator的区别在于,后者分加一条分隔线,前者不会
toolbar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
coolBar.add(new ToolBarContributionItem(toolbar,"start"));//将ToolBarManager加到CoolBar中,并以"start"进行标志
eg:
<extension
point="org.eclipse.ui.actionSets">
<actionSet
id="test.actionSet"
label="Sample Action Set"
visible="true">
<action
class="test.actions.SampleAction"
icon="icons/sample.gif"
id="test.actions.SampleAction"
label="&Sample Action"
menubarPath="sampleMenu/sampleGroup"
toolbarPath="start/additions"//重点看这里,start是在代码中指定的ToolBarManager的id,additions是插入点
tooltip="Hello, Eclipse world">
</action>
</actionSet>
</extension>
我们这次主要看看toolBarPath。这个路径是以工具(id)开头,以"/"分隔的路径。
在RCP开发中,我们可能会先定义一些ToolBarManager,同时在ToolBarManger中添加一些插入点(InsertPoint)。
然后在actionSets扩展点中配置toolbarPath(形如toolbarMangerId/insertpointId)。
我们在RCP中可能会定义成这个样子:
IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
toolbar.add(openViewAction);
toolbar.add(messagePopupAction);
//ToolBar中定义一个插入点,GroupMarker与Separator的区别在于,后者分加一条分隔线,前者不会
toolbar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
coolBar.add(new ToolBarContributionItem(toolbar,"start"));//将ToolBarManager加到CoolBar中,并以"start"进行标志
- 插件开发或RCP中如何通过actions扩展点配置工具栏按钮(插入到指定的ToolBarManger中)
- eclipse RCP 开发中删除插件扩展点
- RCP插件开发时候,右键扩展点new中只有generic解决办法
- RCP中适配器扩展点
- rcp(插件开发) 如何查找自己定义的扩展点
- rcp(插件开发)扩展点逻辑
- RCP中利用扩展点org.eclipse.ui.actionSets创建菜单和工具栏
- 在Eclipse RCP应用中利用扩展点机制解藕插件的依赖关系
- 在Eclipse RCP中屏蔽第三方插件的扩展点
- 在Eclipse RCP应用中利用扩展点机制解藕插件的依赖关系
- 在Eclipse RCP中屏蔽第三方插件的扩展点
- 在Eclipse RCP中屏蔽第三方插件的扩展点
- 在Eclipse RCP中屏蔽第三方插件的扩展点
- 在Eclipse RCP中屏蔽第三方插件的扩展点
- 在Eclipse RCP中屏蔽第三方插件的扩展点
- 如何通过sed命令在文件中包含某个关键字的指定行的上面或下面插入内容
- 如何通过sed命令在文件中包含某个关键字的指定行的上面或下面插入内容
- rcp(插件开发)org.eclipse.core.resources.builders扩展点-转载二进制兄弟的文章
- 将windows下编辑好的文件(GBK)转换成Linux下的格式(UTF8)
- [赏析]10个最“优秀”的代码注释
- 清空剪切板和回收站
- 为非IE浏览器添加mouseenter,mouseleave事件
- POJ3264 Balanced Lineup 线段树基础
- 插件开发或RCP中如何通过actions扩展点配置工具栏按钮(插入到指定的ToolBarManger中)
- 玩转S3C6410之二 s3c-u-boot-1.1.6配置、编译、链接分析(一)
- 面向对象学习记录3
- 如何构建一个带有自己标签的Eclipse?
- 使用GDB调试Android 4.0中的WebKit
- UltraWinGrid使用心得(C#)
- C++实现Creational - Simple Factory模式
- Html学习笔记(2)列表/锚
- 驱动视频:windows驱动讲稿1.1 - 搭建编译环境