一、概述
在做项目的过程中,处理编辑区的保存机制的时候。发现,同样是扩展eclipse 自带的保存和全部保存按钮时 候,rcp 工程下,保存按钮可以正常的灰显和可用,但是rap 的按钮就是始终呈现灰显的状态,无论编辑区是否有变化。为了解决这个问题,经过研究在rap 上做了以下处理,问题得以解决。
二、rap 保存按钮显示的处理
在项目中保存按钮和全部保存按钮是通过扩展点的方式加载的,而且这个扩展点是eclipse 自身带有的扩展点,可以直接调用,并且调用这个保存扩展点,可以直接拥有和eclipse 编辑区类似的功能操作
扩展点的添加方式:
1 、保存的commandId 直接扩展:org.eclipse.ui.file.save
2 、全部保存的commandId 扩展:org.eclipse.ui.file.saveAll
这样保存和全部保存添加上了。
处理rap 下保存按钮可用的处理逻辑和代码如下,处理了类 ApplicationActionBarAdvisor 中的相关方法 。
处理之前的类:
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
super(configurer);
}
protected void makeActions(IWorkbenchWindow window) {
}
protected void fillMenuBar(IMenuManager menuBar) {
}
}
在 ApplicationActionBarAdvisor 这个类中,在 makeActions (IWorkbenchWindow window) 方法中将按钮注册进去就可以了。
处理之后的类:
/**
*
* 工具按钮等相关功能注册
*
*/
public class ApplicationActionBarAdvisor extends ActionBarAdvisor
{
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer){
super(configurer);
}
/**
* 工具栏保存、全部保存按钮注册
*/
protected void makeActions(IWorkbenchWindow window) {
//保存、全部保存按钮的注册
register(ActionFactory.SAVE.create(window));
register(ActionFactory.SAVE_ALL.create(window));
//历史记录回退、重做按钮的注册。
register(ActionFactory.UNDO.create(window));
register(ActionFactory.REDO.create(window));
}
protected void fillMenuBar(IMenuManager menuBar) {
}
}
分享到:
相关推荐
Eclipse IDE for RCP and RAP Developers(eclipse-rcp-2022-06-R-linux-gtk-x86_64.tar.gz) 适用于Linux x86_64: A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client ...
Eclipse IDE for RCP and RAP Developers(eclipse-rcp-2022-06-R-win32-x86_64.zip) 适用于Windows x86_64: A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client ...
Eclipse IDE for RCP and RAP Developers(eclipse-rcp-2022-06-R-linux-gtk-aarch64.tar.gz) 适用于Linux aarch64: A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client ...
Eclipse IDE for RCP and RAP Developers(eclipse-rcp-2022-06-R-macosx-cocoa-x86_64.dmg) 适用于macOS x86_64: A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client ...
Eclipse IDE for RCP and RAP Developers(eclipse-rcp-2022-06-R-macosx-cocoa-aarch64.dmg) 适用于macOS aarch64: A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client ...
Eclipse IDE for RCP and RAP Developers (includes Incubating components) Version: 2020-06 (4.16.0) Build id: 20200615-1200
Eclipse IDE for RCP and RAP linux x86_64 适用于 RCP 和 RAP 开发的工具,需要JDK11及以上运行环境。
Eclipse For RCP and RAP Developers开发包主要针对开发Eclipse插件,Eclipse RCP(富客户端应用程序),RAP(富客户端ajax应用程序)的程序员,还包含CVS、Mylyn和xml编辑器,EGit分布式版本控制等插件。...
Instant Eclipse 4 RCP Development How-to 不错的一本书
本人只会用RCP开发个C/S的程序,最近看到RAP项目想试一下,在百度上看了很多文章关于如何部署RAP到Tomcat,有些文章已经过时的了,还是没能理解清楚,最后弄了2天时间,搞来搞去没办法调试出来,最后都想放弃了。...
Eclipse Rich Ajax Platform is the first book on the new Eclipse RAP, and it introduces the required RCP and OSG/i concepts used by Eclipse RAP. This firstPress title demonstrates the functionality ...
安装 Eclipse RCP/RAP 发行版。 克隆 git,即从 archiv-editor.git 导入所有项目 转到插件 org.bbaw.pdr.ae.standalone,在 Product-Editor (PDE-Tools) 中打开 Product-Configuration 文件 org.bbaw.pdr.ae....
RCP和RAP。 从其更新站点https://update.rascal-mpl.org/unstable安装不稳定版本的Rascal插件。 单击以获取更多信息。 从其中克隆Rascal项目java-build-manager并将其导入到您的工作空间中。 去! 准备好环境后: 将...
CodeMirror Eclipse 使您能够在三个上下文中使用 codemirror:Eclipse SWT、RCP 和 RAP。 它在 SWT 浏览器中嵌入了 javascript codemirror 编辑器。 它提供了几个功能: 仅使用带有 SWT/RWT 的 codemirror。 这是...
例如,从Git存储库根目录开始的以下命令将针对同时发布暂存p2存储库构建RCP / RAP软件包: mvn clean verify -Pepp.package.rcp 此版本在两个位置创建输出: tar.gz / zip归档文件,其中的软件包位于archive/和 ...
可以直接安装 官方地址:http://www.eclipse.org/downloads/ ...Eclipse IDE for RCP and RAP Developers Eclipse Modeling Tools Eclipse IDE for Scientific Computing Eclipse IDE for Scout Developers
JBizMo支持Angular,Eclipse RCP / RAP,JavaFX,JSF(Primefaces),Swing和Vaadin应用程序的构建。 生成的应用程序可以独立运行,也可以部署在Java EE服务器(Wildfly 16,Payara 5)上。 另外,还支持Spring平台...