1 / 26
文档名称:

GWT开发指南.doc

格式:doc   页数:26页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

GWT开发指南.doc

上传人:xxj16588 2015/10/4 文件大小:0 KB

下载得到文件列表

GWT开发指南.doc

相关文档

文档介绍

文档介绍:第一章编码基础
在eclipse中添加GWT插件。升级安装源如下:
Eclipse (Galileo)
http://dl./eclipse/plugin/
Eclipse (Ganymede)
http://dl./eclipse/plugin/
Eclipse (Europa)
http://dl./eclipse/plugin/
第一节客户端代码
创建入口点
新建GWT工程之后将生成的类文件都删除。:
<!-- Servlets -->
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-.</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/smallgwt/greet</url-pattern>
</servlet-mapping>
然后观察生成的模块配置文件
<?xml version="" encoding="UTF-8"?>
<module rename-to='smallgwt'>
<!—rename-to为模块起一个别名,使用起来简单-->
<!-- Inherit the core Web Toolkit stuff. -->
<!—下面是继承其他模块,User是必须继承的一个模块。-->
<inherits name=''/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by menting -->
<!-- any one of the following lines. -->
<!-- 继承缺省的GWT样式表. 你能够改变 GWT 程序的主题。只需要去掉下面几行其中一个的注释-->
<inherits name=''/>
<!-- <inherits name=''/> -->
<!-- <inherits name=''/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<!-- 指定应用的入口点类-->
<entry-point class=''/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
</module>
每一个模块都有一个入口点。这个模块的入口点就是“Smallgwt”类。.。.。
自动生成的代码如下:
.;
.;
public class Smallgwt implements EntryPoint {
***@Override
public void onModuleLoad() { x
// TODO Auto-generated method stub
}
}
入口点类
入口点类是整个GWT应用程序的入口,也就是说,GWT应用程序运行时会首先调用这段代码,工程的入口点类在工程模块的<entry-point>标签中指定。在入口点类中必须实现入口点方法onModuleLoad(),这个入口点方法是整个GWT应用程序开始执行的地方。
这个方法中主要做的事情是:
创建可视组件
设置事件处理句柄
将可视组件添加到网页上
.;
.g