2007-06-27
GWT开发利器之Cypal Studio for GWT
关键字: GWT
一)什么是Cypal Studio for GWT?
,从File->New->Other->Cypal Studio-> Module,输入Module名称,注意package不能为空,否则无法创建com.yourcompany.server和com.yourcompany.clinet目录。
打开com.yourcompany.gwt.test.public下的test.html,添加一个表格。
Cypal Studio for GWT 其实就是Googlipse(http://www.googlipse.com),但Googlipse已经不再更新。该项目作者创建了一个新产品来替代Googlipse,这就是Cypal Studio for GWT。从下面的配置过程大家也可以看到二者基本一致。
二)环境配置及示例
1.Eclipse 3.2 + WTP1.5
2.GWT,从http://code.google.com/webtoolkit/download.html下载并解压缩至D:/gwt-windows-1.4.10目录
3.Cypal Studio for GWT,从http://www.cypal.in/studio 下载并解压缩至Eclipse目录
4.运行Eclipse,打开Window-> Preferences->Cypal Studio,设置GWT Home(步骤2)
5.创建Dynamic Web Project,在configurations选项选中Default Cypal Studio Project
打开com.yourcompany.gwt.test.public下的test.html,添加一个表格。
html 代码
- <table align=center>
- <tr>
- <td id="slot1"></td><td id="slot2"></td>
- </tr>
- </table>
Test类实现EntryPoint接口,需要手工实现onModuleLoad方法。
java 代码
- public void onModuleLoad() {
- // TODO Auto-generated method stub
- final Button button = new Button("Click me");
- final Label label = new Label();
- button.addClickListener(new ClickListener() {
- public void onClick(Widget sender) {
- if (label.getText().equals(""))
- label.setText("Hello World!");
- else
- label.setText("");
- }
- });
- // Assume that the host HTML has elements defined whose
- // IDs are "slot1", "slot2". In a real app, you probably would not want
- // to hard-code IDs. Instead, you could, for example, search for all
- // elements with a particular CSS class and replace them with widgets.
- //
- RootPanel.get("slot1").add(button);
- RootPanel.get("slot2").add(label);
- }
- 运行
点击Run->Run/Debug,打开运行配置对话框,双击GWT Hosted Mode Application,在右侧选择项目和模块,然后可以运行或调试。
- 浏览: 69537 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
基于MVC的Flex framework ...
PureMVC 不错。 简单易学,也好用
-- by zhouzhao21 -
PSP开发环境
请问一下这段代码有什么问题么?? bool flag = mResourceMg ...
-- by wangshu3000 -
Tomcat下设置session超时 ...
"Tomcat默认的会话超时是1800秒,测试一次需要等太久" -- 把系统时 ...
-- by sam.ds.chen -
[翻译]Ext vs. Dojo
netfishx 写道ext始终没有机会用于正式的项目中,但它确实是我所见过最协 ...
-- by blackanger -
TDD in AJAX
现在yui,jquery,dojo等都用自己的testcase框架,很是郁闷,为 ...
-- by hyysguyang






评论排行榜