OSDN Git Service

初期インポート
[u6kcommons/money-notebook.git] / money-notebook / src / jp / gr / java_conf / u6k / money_notebook / gwt / client / IndexEntryPoint.java
1 \r
2 package jp.gr.java_conf.u6k.money_notebook.gwt.client;\r
3 \r
4 import com.google.gwt.core.client.EntryPoint;\r
5 import com.google.gwt.core.client.GWT;\r
6 import com.google.gwt.event.dom.client.ClickEvent;\r
7 import com.google.gwt.event.dom.client.ClickHandler;\r
8 import com.google.gwt.user.client.Window;\r
9 import com.google.gwt.user.client.rpc.AsyncCallback;\r
10 import com.google.gwt.user.client.ui.Button;\r
11 import com.google.gwt.user.client.ui.RootPanel;\r
12 \r
13 public class IndexEntryPoint implements EntryPoint {\r
14 \r
15     private final IndexServiceAsync indexService = GWT.create(IndexService.class);\r
16 \r
17     @Override\r
18     public void onModuleLoad() {\r
19         Button sendButton = new Button("Now time.");\r
20         sendButton.addClickHandler(new ClickHandler() {\r
21 \r
22             @Override\r
23             public void onClick(ClickEvent event) {\r
24                 IndexEntryPoint.this.indexService.send(new AsyncCallback<String>() {\r
25 \r
26                     @Override\r
27                     public void onSuccess(String result) {\r
28                         Window.alert(result);\r
29                     }\r
30 \r
31                     @Override\r
32                     public void onFailure(Throwable caught) {\r
33                         Window.alert("error");\r
34                     }\r
35 \r
36                 });\r
37             }\r
38 \r
39         });\r
40 \r
41         RootPanel.get("content").add(sendButton);\r
42     }\r
43 \r
44 }\r