GWT with Gears
自分の中で密かに盛り上がっていたgwt-google-apisの
gwt-gears-1.1.0だったのですが
先日、MASHUP AWARDでついにgoogleさんの対象APIとして発表されました。
[新API紹介]Google の審査対象 API を発表!
——————–
GWT with Gears
Gearsのインストール/未インストールにより表示するメッセージを変えてみる。
0.プロジェクトを作成し、GWTモジュールを作成します。
モジュール名は、com.gethapp.sample.gwg.App
としています。
1.上に書いているgwt-gears-1.1.0.zipをダウンロードし、
プロジェクトにgwt-gears.jarを追加します。
2.モジュール.gwt.xmlファイルへgears-apiを使います宣言を追加
<inherits name='com.google.gwt.gears.Gears'/>
3.モジュール.gwt.xmlファイルにgearsのinstall判定を行います。
gearsインストールされている場合は、App、
未インストールの場合はAppNoGearsが起動します。
<replace-with class="com.gethapp.sample.gwg.client.AppNoGears">
<when-type-is class="com.gethapp.sample.gwg.client.App"/>
<when-property-is name="gears.installed" value="false"/>
</replace-with>
App.gwt.xml
<module>
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.gears.Gears'/>
<entry-point class='com.gethapp.sample.gwg.client.App'/>
<inherits name="com.google.gwt.user.theme.standard.Standard"/>
<replace-with class="com.gethapp.sample.gwg.client.AppNoGears">
<when-type-is class="com.gethapp.sample.gwg.client.App"/>
<when-property-is name="gears.installed" value="false"/>
</replace-with>
</module>
4.App.javaと同じフォルダーに
新規クラスとしてAppNoGears.javaを作成し、
それぞれの以下の通り修正します。
App.java#onModuleLoad
public void onModuleLoad() {
RootPanel […]
Posted on 9月 2nd, 2008 by mitsu
Filed under: GWT, Google, 開発メモ | No Comments »