litesoft
Diff Revisions
947
vs
948
for /trunk/GWT_Sandbox/gwtUITrimmed/src/com/gwtmobile/ui/kitchensink/client/communication/RpcPage.java
|
@@ -7,34 +7,29 @@ |
7 |
7 |
|
import com.gwtmobile.ui.client.event.*; |
8 |
8 |
|
import com.gwtmobile.ui.client.page.*; |
9 |
9 |
|
|
10 |
|
- |
public class RpcPage extends Page |
11 |
|
- |
{ |
|
10 |
+ |
public class RpcPage extends Page { |
12 |
11 |
|
|
13 |
12 |
|
private static RpcPageUiBinder uiBinder = GWT.create( RpcPageUiBinder.class ); |
14 |
13 |
|
|
15 |
14 |
|
@UiField HTML text; |
16 |
15 |
|
|
17 |
|
- |
interface RpcPageUiBinder extends UiBinder<Widget, RpcPage> |
18 |
|
- |
{ |
|
16 |
+ |
interface RpcPageUiBinder extends UiBinder<Widget, RpcPage> { |
19 |
17 |
|
} |
20 |
18 |
|
|
21 |
|
- |
public RpcPage() |
22 |
|
- |
{ |
|
19 |
+ |
public RpcPage() { |
23 |
20 |
|
initWidget( uiBinder.createAndBindUi( this ) ); |
24 |
21 |
|
} |
25 |
22 |
|
|
26 |
|
- |
@UiHandler("list") void onListSelectionChanged( SelectionChangedEvent e ) |
27 |
|
- |
{ |
28 |
|
- |
switch ( e.getSelection() ) |
29 |
|
- |
{ |
|
23 |
+ |
@UiHandler("list") |
|
24 |
+ |
void onListSelectionChanged( SelectionChangedEvent e ) { |
|
25 |
+ |
switch ( e.getSelection() ) { |
30 |
26 |
|
case 0: |
31 |
27 |
|
makeRpcCall(); |
32 |
28 |
|
break; |
33 |
29 |
|
} |
34 |
30 |
|
} |
35 |
31 |
|
|
36 |
|
- |
private void makeRpcCall() |
37 |
|
- |
{ |
|
32 |
+ |
private void makeRpcCall() { |
38 |
33 |
|
final RpcServiceAsync greetingService = GWT.create( RpcService.class ); |
39 |
34 |
|
|
40 |
35 |
|
//The code below sets service entry point to a server url. |
|
@@ -42,17 +37,14 @@ |
42 |
37 |
|
String address = "http://gwtmobile-services.appspot.com/rpc"; |
43 |
38 |
|
service.setServiceEntryPoint( address ); |
44 |
39 |
|
|
45 |
|
- |
greetingService.greetServer( "GWT Mobile UI", new AsyncCallback<String>() |
46 |
|
- |
{ |
|
40 |
+ |
greetingService.greetServer( "GWT Mobile UI", new AsyncCallback<String>() { |
47 |
41 |
|
@Override |
48 |
|
- |
public void onSuccess( String result ) |
49 |
|
- |
{ |
|
42 |
+ |
public void onSuccess( String result ) { |
50 |
43 |
|
text.setHTML( result ); |
51 |
44 |
|
} |
52 |
45 |
|
|
53 |
46 |
|
@Override |
54 |
|
- |
public void onFailure( Throwable caught ) |
55 |
|
- |
{ |
|
47 |
+ |
public void onFailure( Throwable caught ) { |
56 |
48 |
|
text.setHTML( caught.getMessage() ); |
57 |
49 |
|
} |
58 |
50 |
|
} ); |