`
dyllove98
  • 浏览: 1383980 次
  • 性别: Icon_minigender_1
  • 来自: 济南
博客专栏
73a48ce3-d397-3b94-9f5d-49eb2ab017ab
Eclipse Rcp/R...
浏览量:38377
4322ac12-0ba9-3ac3-a3cf-b2f587fdfd3f
项目管理checkList...
浏览量:78736
4fb6ad91-52a6-307a-9e4f-816b4a7ce416
哲理故事与管理之道
浏览量:131906
社区版块
存档分类
最新评论

Eclipse rcp/rap 开发经验总结(13) -Rap/Rcp保存按钮处理方式

阅读更多

一、概述

在做项目的过程中,处理编辑区的保存机制的时候。发现,同样是扩展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) {
    }
}

 

 

0
0
分享到:
评论

相关推荐

    eclipse-rcp-2022-06-R-linux-gtk-x86_64.tar.gz

    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-rcp-2022-06-R-win32-x86_64.zip

    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-rcp-2022-06-R-linux-gtk-aarch64.tar.gz

    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-rcp-2022-06-R-macosx-cocoa-x86_64.dmg

    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-rcp-2022-06-R-macosx-cocoa-aarch64.dmg

    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 2020-06 国际化资源包

    Eclipse IDE for RCP and RAP Developers (includes Incubating components) Version: 2020-06 (4.16.0) Build id: 20200615-1200

    eclipse-rcp-2022-06-R-linux-gtk-x86_64.tar

    Eclipse IDE for RCP and RAP linux x86_64 适用于 RCP 和 RAP 开发的工具,需要JDK11及以上运行环境。

    eclipse-rcp-galileo-SR2-win32.zip

    Eclipse For RCP and RAP Developers开发包主要针对开发Eclipse插件,Eclipse RCP(富客户端应用程序),RAP(富客户端ajax应用程序)的程序员,还包含CVS、Mylyn和xml编辑器,EGit分布式版本控制等插件。...

    Instant Eclipse 4 RCP Development How-to.pdf

    Instant Eclipse 4 RCP Development How-to 不错的一本书

    Eclipse RAP2.1部署到Tomcat总结

    本人只会用RCP开发个C/S的程序,最近看到RAP项目想试一下,在百度上看了很多文章关于如何部署RAP到Tomcat,有些文章已经过时的了,还是没能理解清楚,最后弄了2天时间,搞来搞去没办法调试出来,最后都想放弃了。...

    Eclipse Rich Ajax Platform: Bringing Rich Client to the Web

    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 ...

    archiv-editor

    安装 Eclipse RCP/RAP 发行版。 克隆 git,即从 archiv-editor.git 导入所有项目 转到插件 org.bbaw.pdr.ae.standalone,在 Product-Editor (PDE-Tools) 中打开 Product-Configuration 文件 org.bbaw.pdr.ae....

    java源码剖析-maracas:Maracas是用Rascal编写的源代码和字节码分析框架,旨在支持JavaAPI和客户端代码的共同发展。

    RCP和RAP。 从其更新站点https://update.rascal-mpl.org/unstable安装不稳定版本的Rascal插件。 单击以获取更多信息。 从其中克隆Rascal项目java-build-manager并将其导入到您的工作空间中。 去! 准备好环境后: 将...

    CodeMirror-Eclipse:CodeMirror-Eclipse

    CodeMirror Eclipse 使您能够在三个上下文中使用 codemirror:Eclipse SWT、RCP 和 RAP。 它在 SWT 浏览器中嵌入了 javascript codemirror 编辑器。 它提供了几个功能: 仅使用带有 SWT/RWT 的 codemirror。 这是...

    packages:构建Enide 2015和AjsIDE软件包

    例如,从Git存储库根目录开始的以下命令将针对同时发布暂存p2存储库构建RCP / RAP软件包: mvn clean verify -Pepp.package.rcp 此版本在两个位置创建输出: tar.gz / zip归档文件,其中的软件包位于archive/和 ...

    java在线安装包.rar

    可以直接安装 官方地址: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:Java应用程序的强大生成器(JPA,Java EE ...)-开源

    JBizMo支持Angular,Eclipse RCP / RAP,JavaFX,JSF(Primefaces),Swing和Vaadin应用程序的构建。 生成的应用程序可以独立运行,也可以部署在Java EE服务器(Wildfly 16,Payara 5)上。 另外,还支持Spring平台...

Global site tag (gtag.js) - Google Analytics