GWT开发笔记

一般我们首先要通过projectCreator 命令工具来建立一个eclipse项目:
1。Create an Eclipse project with projectCreator

If you're using Eclipse, the first utility you'll run is
projectCreator (if you're not using Eclipse, skip ahead to the section on applicationCreator). The projectCreator utility will generate a shell Eclipse project for our application. Open a command shell and browse to the StockWatcher directory you created. Run the command:

projectCreator -eclipse StockWatcher -out StockWatcher

After the projectCreator utility runs, you should see that it has generated a new directory called StockWatcher containing a couple of subdirectories (src and test for storing the project source code and unit tests) and a pair of Eclipse files (.project and .classpath).

2。Create a GWT project with applicationCreator

Next we're going to use the applicationCreator utility to generate a minimal but functional GWT project. We'll need to pass it the fully-qualified name of our application's main entry point class. Based on the
recommended GWT project structure , this class should always be in a subpackage client. For our StockWatcher application we'll name our main class com.google.gwt.sample.stockwatcher.client.StockWatcher.

The applicationCreator utility can also generate Eclipse launch config files for easy hosted mode debugging. Just specify the -eclipse flag followed by the name of your Eclipse project.
In a command shell, browse to the StockWatcher directory. If you're using Eclipse, run the command:
applicationCreator -eclipse StockWatcher -out StockWatcher com.google.gwt.sample.stockwatcher.client.StockWatcher
If you're using another IDE, omit the -eclipse flag and project name:
applicationCreator -out StockWatcher com.google.gwt.sample.stockwatcher.client.StockWatcher
Now take a look inside the StockWatcher directory. You'll see that the applicationCreator has generated two scripts for us named StockWatcher-compile and StockWatcher-shell. These scripts will help us prepare StockWatcher for deployment, or run the application in hosted mode
, respectively.

3。Import the project into Eclipse
这样的话就可以在eclipse下,进入java代码开发,从而大大优于以往的js开发了
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值