peacess

统计

留言簿(14)

积分与排名

阅读排行榜

评论排行榜

gwt学习--新增包(一)


    在一个gwt(google web toolkit)中,一般有一个默认的包“client”,如果我新增了一个包“lib”应该怎么做呢?
    方法一(直接增加资源路径):
       比如你的项目名为“AX”,那么会有一个对应的文件“AX.gwt.xml”,在此文件中加入如下内容
       <module>
          。。。。。
           <source path="lib"/>
          。。。。。
        </module>
    方法二(多重包含):
       首先找到文件“AX.gwt.xml”在文件中加入对另外一个文件(比如“YY.gwt.xml”)的引用,如下
       。。。。
       <inherits name='com.KF.YY'></inherits>
       。。。。
       然后在文件“YY.gwt.xml”中加入与方法一相似的代码,如下
       <module>
           <source path="lib"/>
        </module>
    方法三(新增包与包“client”不在同一目录时)(参考)
       这里举一个定义组件的例子
       自定义组件包为“com.gwt.components.client
       在增加文件:在“com.gwt.components”下增加文件“user.gwt.xml”
          内容:
<module>
  <inherits name="com.google.gwt.core.Core"/>
</module>
       在
AX.gwt.xml中加入如下
       。。。。
       <inherits name='com.gwt.components.user'></inherits>
       。。。。
       此时默认的会包含文件“user.gwt.xml”所在目录下的“client”,如果在此目录下你还有其它的目录,就需要用文件“user.gwt.xml”中加入“<source path='你的目录'”。

在google的网站上有对“module”更专业的说明:http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.Modules.html

posted on 2006-05-27 09:06 中东 阅读(2071) 评论(0)  编辑  收藏 所属分类: gwt(google web toolkit)


只有注册用户登录后才能发表评论。


网站导航: