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

Eclipse rcp/rap 开发经验总结(15) -rap如何使用js

阅读更多

欢迎大家访问我的个人网站 萌萌的IT人,后续所有的文章都会在此发布

--------------------------------------------------------------------------------------------

1. 把输入的字符串当 javascript 执行

 

try { 
    RWT.getResponse().getWriter().println("alert('123');"); 
} catch (IOException ex) { 
    ex.printStackTrace(); 
}

2 .通过扩展点增加 js 文件的方法:

增加:org.eclipse.rap.ui.resources 扩展点


 

然后在resources 扩展点上新建resource


然后新建resource 扩展类:


 

类:

public class TestResource implements IResource {
    @Override
    public String getCharset() {
        return "ISO-8859-1";
    }
    
    @Override
    public RegisterOptions getOptions() {
        return RegisterOptions.VERSION;
    }
    
    @Override
public String getLocation() {
//js路径,会在workspace\.metadata\.plugins\org.eclipse.rap.ui.launch\RAPApplication\.metadata\.plugins\org.eclipse.rap.ui\context\rwt-resources\telecomui\js路径下生成test.js文件,供我们使用。

例如:test.js中有个方法:
Function a(){
Alert(“aaaaa”);
}

在代码中的任何一个方法中只要调用如下代码就能使用:
RWT.getResponse().getWriter().println("a();");
        return "telecomui/js/test.js";
    }
    
    @Override
    public boolean isJSLibrary() {
        return true;
    }
    
    @Override
    public ClassLoader getLoader() {
        return this.getClass().getClassLoader();
    }
    
    @Override
    public boolean isExternal() {
        return false;
    }
}

 

 

3.rap js 框架采用的是: qooxdoo

qooxdoo 是一个开源的综合性 Ajax 框架,是遵守 LGPL 、或 EPL Eclipse Public License )许可的,可以用于商业项目,利于它可以建立面向对象的 js 类,也可以开发富客户端的界面,甚至在网页上开发出单机程序那样的界面,是一个不错的 Ajax 框架。

以前一直使用 Eclipse RCP 进行开发,自从接触了 Eclipse RAP 后,对 AJAX 产生了兴趣,还有未来的 Eclipse 4.0  将会采用 Web 框架开发,以后可以在浏览器中运行 Eclipse 了,所以想研究研究 AJAX 框架, RAP 的底层是用 Qooxdoo 实现,关于 Qooxdoo ,好像名声明显没有其他框架那么有名,不过 Qooxdoo 的确是一个非常优秀的 AJAX 框架,关于 Qooxdoo ,你可以从它的主页上了解更多: http://qooxdoo.org/

  • 大小: 3.9 KB
  • 大小: 5.4 KB
  • 大小: 23.8 KB
分享到:
评论

相关推荐

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

    CodeMirror-Eclipse:CodeMirror-Eclipse

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

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

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

    archiv-editor

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

    packages:构建Enide 2015和AjsIDE软件包

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

    JBizMo:Java应用程序的强大生成器(JPA,Java EE ...)-开源

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

    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

Global site tag (gtag.js) - Google Analytics