Subversion Repository Public Repository

litesoft

Diff Revisions 546 vs 547 for /trunk/GWT_Sandbox/MultiModule/groupBack/src/org/litesoft/sandbox/multimodule/groupback/client/GroupBack.java

Diff revisions: vs.
  @@ -8,6 +8,7 @@
8 8 import org.litesoft.sandbox.multimodule.groupback.client.top.*;
9 9
10 10 import com.google.gwt.core.client.*;
11 + import com.google.gwt.user.client.*;
11 12
12 13 /**
13 14 * Entry point classes define <code>onModuleLoad()</code>
  @@ -61,24 +62,54 @@
61 62 }
62 63 } );
63 64
64 - ActivityFactoryRegistry.register( new ActivityFactory.Synchronous<ClientFactory, TopView, TopPlace>()
65 + ActivityFactoryRegistry.register( new ActivityFactory.Asynchronous<ClientFactory, TopView, TopPlace>()
65 66 {
66 67 @Override
67 - public TopView getView()
68 - {
69 - return new TopViewImpl();
70 - }
71 -
72 - @Override
73 - public Activity createActivity( ClientFactory pClientFactory, TopView pView, TopPlace pPlace )
68 + public String getPlaceId()
74 69 {
75 - return new TopActivity( pClientFactory, pView, pPlace );
70 + return Places.Top.name();
76 71 }
77 72
78 73 @Override
79 - public String getPlaceId()
74 + public void load( final Callback<ClientFactory, TopView, TopPlace> pCallback )
80 75 {
81 - return Places.Top.name();
76 + GWT.runAsync( new RunAsyncCallback()
77 + {
78 + @Override
79 + public void onFailure( Throwable pReason )
80 + {
81 + String zMessage = "Unable to create Top Activity Factory:";
82 + System.err.println( zMessage );
83 + pReason.printStackTrace();
84 + Window.alert( zMessage + " " + pReason.getMessage() );
85 + }
86 +
87 + @Override
88 + public void onSuccess()
89 + {
90 + pCallback.loaded( new CachedViewSynchronousActivityFactory<ClientFactory, TopView, TopPlace>()
91 + {
92 + @Override
93 + protected TopView createView()
94 + {
95 + return new TopViewImpl();
96 + }
97 +
98 + @Override
99 + public Activity createActivity( ClientFactory pClientFactory, TopView pView, TopPlace pPlace )
100 + {
101 + return new TopActivity( pClientFactory, pView, pPlace );
102 + }
103 +
104 + @Override
105 + public String getPlaceId()
106 + {
107 + return Places.Top.name();
108 + }
109 + } );
110 + //To change body of implemented methods use File | Settings | File Templates.
111 + }
112 + } );
82 113 }
83 114 } );
84 115 }