![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Eclipse
文章平均质量分 51
Stroot_Zhang
这个作者很懒,什么都没留下…
展开
-
What does $NON-NLS-1$ mean?
They silence a warning that Eclipse emits when it encounters string literals (and has been configured to complain).The idea is that UI messages should not be embedded as string literals, but rathe原创 2013-07-12 17:26:16 · 1022 阅读 · 0 评论 -
RCP 通过代码调用Commands
代码示例:// From a view you get the site which allow to get the serviceIHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);try { handlerService.executeCo原创 2013-09-13 14:09:15 · 1445 阅读 · 0 评论 -
动态生成command
目的:在程序运行时动态生成各菜单子项。实现思路:通过menuContribution的class属性类实现。步骤:1、在org.eclipse.ui.menus中定义一个menuContribution项,同时通过locationURI设置此menuContribution的依附对象。2、实现menuContribution项的class类。注意此类必须继承自E原创 2013-09-13 15:41:00 · 1281 阅读 · 0 评论 -
Eclipse RCP 中Site与各组件之间的关系
Site为各组件提供了一个接口,供其访问workbench的各种资源。各Site与各组件之间的关系如下:参考资料:1、Eclipse RCP 中 Part 和 Site、菜单和工具栏2、Eclipse RCP 中组件解析原创 2013-09-13 21:57:19 · 1099 阅读 · 0 评论 -
[Editing]Get current active view reference instance
.Example code:PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart()1Reference:1. http://stackoverflow.com/questions/3201248/how-can原创 2013-09-13 20:13:09 · 1173 阅读 · 0 评论 -
Eclipse RCP 中组件解析
Eclipse 平台核心的组件包括如下5类:WorkbenchWorkbenchWindowWorkbenchPageWorkbenchPartViewPart 和 EditorPart各组件意义:1、WorkbenchWorkbench 代表 Eclipse 工作台,是 Eclipse 平台 GUI 总控制器,其作用类似于SWT的Display类。Workbe原创 2013-09-13 21:49:49 · 1724 阅读 · 0 评论 -
RCP 自定义用于visible/enable when表达式的变量
目的:定义类似于selection的变量,用于visible when表达式的判定。实现思路:使用source provider来实现。具体步骤:1、定义source provider:添加org.eclipse.ui.services扩展项sourceProvider,实现其provider属性类,此类为本文的重点所在,其功能为对外提供变量值,同时通过priority原创 2013-09-13 15:23:51 · 1656 阅读 · 0 评论 -
RCP handler处理函数中获取当前选择项。
目的:在command的处理函数中获取触发当前command时被选中的条目。方法:使用HandlerUtil工具类获取。代码示例: public Object execute(ExecutionEvent event) throws ExecutionException { // 获取需要导出的线路。 ISelection selection = Handl原创 2013-09-14 20:50:00 · 2079 阅读 · 0 评论 -
获取当前RCP应用路径数据存储路径
代码: final IPreferenceStore store = TourbookPlugin.getDefault() .getPreferenceStore(); // 电塔图标注册。 store.setDefault("TowerImageFilePath", (Platform.getInstanceLocation() .getURL().getP原创 2013-09-17 21:22:41 · 1012 阅读 · 0 评论 -
RCP 扩展点扩展属性类获取代码示例
代码示例: public static void registerOverlays(final Map map) { final IExtensionRegistry registry = RegistryFactory.getRegistry(); final IExtensionPoint point = registry .getExtensionPoint("net原创 2013-09-17 22:03:23 · 1021 阅读 · 0 评论 -
RCP 已发布程序Debug信息获取
目的:获取已发布的RCP程序抛出的异常。解决方法:使用Command方式启动,同时附加启动参数 -debuglog。实例:RCP.exe -debuglog参考资料:1、Eclipse 4 RCP - Tutorial原创 2013-09-17 19:24:24 · 926 阅读 · 0 评论 -
RCP TableViewer获取CheckBox 状态
代码示例:viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.CHECK);// 设置表格显示方式。table = viewer.getTable();table.setHeaderVisible(true);table.se原创 2013-09-26 14:37:54 · 1750 阅读 · 1 评论 -
RCP右键菜单添加
RCP右键菜单添加步骤:1、菜单项生成。菜单项的生成可以通过plugin.XML编辑器添加,或者通过手动编码实现。plugin.XML编辑器添加:在org.eclipse.ui.menus扩展点添加一个menuContribution,并通过locationURI为其指定好依附对象,然后为其添加菜单项。手动编码实现忽略。2、使用菜单项。光有菜单项还不行,原创 2013-09-13 10:39:01 · 2816 阅读 · 0 评论 -
RCP动态菜单添加
目标效果:对于一个List VIew,仅当其中至少有一元素被选中时,右键菜单中才显示菜单项。实现思路:使用visible when表达式。具体步骤:1、在menuContribute中添加Command项。2、为Command项添加所有必要关联,如:CommandID。3、为此Command添加visibleWhen元素,checkEnabled属性设置为fal原创 2013-09-13 11:38:58 · 2312 阅读 · 0 评论 -
【未完成】Eclipse-BuddyPolicy 设置作用
The Eclipse-BuddyPolicy HeaderThe Eclipse-BuddyPolicy header is used to specify the buddy classloading policies for a bundle. The Eclipse-BuddyPolicy header must use the following syntax:Eclipse-B转载 2013-07-21 17:26:46 · 1551 阅读 · 0 评论 -
RCP 启动时提示缺少插件,问题解决方法
Might be the launch configuration that's out-of-step with your build projects. Open up the launch config (Run-Run...) and then go to theplugins tab to see if the plugins are there. You could cli翻译 2013-07-22 17:00:34 · 904 阅读 · 0 评论 -
关于Preference的一点理解
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://allenyoung.blogbus.com/logs/1694872.html稍微正规一点儿的plug-in都会有Preference page,在那里我们可以设置一个plug-in的profile,来个性化plug-in的显示及运行效果。Eclipse把Preference作为一个ex转载 2013-07-21 20:53:48 · 1198 阅读 · 0 评论 -
Eclipse JDT Icons
Eclipse 各种小图标的含义 缺省类型(可视包)公共类型缺省接口(包可视)公共接口 缺省内部类型(包可视)私有内部类型受保护内部类型公共内部类型 缺省内部接口(包可视)私有内部接口受保转载 2013-07-12 17:03:11 · 1109 阅读 · 0 评论 -
Velocity Reference Notation "$!" Meaning.
$! means Quiet Reference Notation When Velocity encounters an undefined reference, its normal behavior is to output the image of the reference. For example, suppose the following reference appea原创 2013-08-01 15:01:56 · 973 阅读 · 0 评论 -
RCP获取插件目录中图像文件
代码示例: // 获取类所在插件。 Bundle bundle = FrameworkUtil.getBundle(View.class); // 获取相对与插件的位置。 URL url = FileLocator.find(bundle, new Path("icons/" + file), null); // 获取图像描述符。 ImageDescripto原创 2013-08-03 16:46:09 · 906 阅读 · 0 评论 -
全球化 Eclipse RCP 应用程序
原文地址:http://www.ibm.com/developerworks/cn/opensource/os-eclipse-globalrcp/index.html?ca=dat-cn-0727简介Eclipse Rich Client Platform(RCP)有着许多优势,如开发迅速、自然的感观、可扩展性和多平台支持。许多公司都采用 RCP 来开发他们的软件。对于跨转载 2013-07-29 17:40:28 · 1185 阅读 · 0 评论 -
Set RCP Application's default perspective
在 ApplicationWorkbenchAdvisor.java, 中修改其getInitialWindowPerspectiveId方法:设置其返回值为需要设置为默认透视图的ID,如: @Override public String getInitialWindowPerspectiveId() { // set default perspective return Pe原创 2013-07-29 16:02:39 · 743 阅读 · 0 评论 -
RCP 国际化
原文地址:http://jjxliu306.iteye.com/blog/1882002Eclipse体系已对国际化功能封装的很不错了,因此在RCP中处理国际化很方便,下面借用jjxliu306的一个例子来展示如何在RCP中使用国际化。 1. 首先创建一个RCP应用工程。注意将工程设置为RCP工程。 为方便测试,选择He转载 2013-07-29 17:27:22 · 1870 阅读 · 0 评论 -
RCP: 代码方式设置View为不可关闭样式
原文地址:http://stackoverflow.com/questions/10146058/eclipse-rcp-programmatically-setting-a-view-to-not-be-closeable在Perspective的初始化函数createInitialLayout(final IPageLayout layout)中设置指定视图的样式。代码翻译 2013-08-03 21:13:23 · 1376 阅读 · 0 评论 -
RCP 右键菜单片段
public void createContexMenu(Composite parent) { testAction = new Action("a") { @Override public void run() { System.out.println("Context menu clicked!"); } }; // 创建菜单管理工具类。 Men原创 2013-09-11 21:09:57 · 1244 阅读 · 0 评论 -
RCP 自定义启动界面
自定义界面的过程实际上就是实现一个自定义扩展类(继承自AbstractSplashHandler)的过程。主要步骤;1、为RCP工程增加org.eclipse.core.runtime.products扩展点,并设定ID属性,此ID即为RCP程序的ProductID。2、在org.eclipse.core.runtime.products扩展点中增加product扩展项原创 2013-09-28 11:42:49 · 3790 阅读 · 0 评论