Subversion Repository Public Repository

litesoft

Diff Revisions 548 vs 551 for /trunk/GWT_Sandbox/MultiModule/groupFront/src/org/litesoft/sandbox/multimodule/groupfront/client/GroupFront.java

Diff revisions: vs.
  @@ -19,66 +19,127 @@
19 19 {
20 20 System.out.println( "GroupFront.onModuleLoad" );
21 21
22 - ActivityFactoryRegistry.register( new ActivityFactory.Synchronous<ClientFactory, FrontView, FrontPlace>()
22 + ActivityFactoryRegistry.register( new ActivityFactory.Asynchronous<ClientFactory, FrontView, FrontPlace>()
23 23 {
24 24 @Override
25 - public FrontView getView()
26 - {
27 - return new FrontViewImpl();
28 - }
29 -
30 - @Override
31 - public Activity createActivity( ClientFactory pCommonActivityParam, FrontView pView, FrontPlace pPlace )
32 - {
33 - return new FrontActivity( pCommonActivityParam, pView, pPlace );
34 - }
35 -
36 - @Override
37 25 public String getPlaceId()
38 26 {
39 27 return Places.Front.name();
40 28 }
41 - } );
42 -
43 - ActivityFactoryRegistry.register( new ActivityFactory.Synchronous<ClientFactory, LeftView, LeftPlace>()
44 - {
45 - @Override
46 - public LeftView getView()
47 - {
48 - return new LeftViewImpl();
49 - }
50 29
51 30 @Override
52 - public Activity createActivity( ClientFactory pCommonActivityParam, LeftView pView, LeftPlace pPlace )
31 + public void load( ClientFactory pCommonActivityParam, final Callback<ClientFactory, FrontView, FrontPlace> pCallback )
53 32 {
54 - return new LeftActivity( pCommonActivityParam, pView, pPlace );
33 + GWT.runAsync( new RunAsyncSyncActivityFactoryCallBack( getPlaceId(), pCommonActivityParam )
34 + {
35 + @Override
36 + public void onSuccess()
37 + {
38 + pCallback.loaded( new CachedViewSynchronousActivityFactory<ClientFactory, FrontView, FrontPlace>()
39 + {
40 +
41 + @Override
42 + public String getPlaceId()
43 + {
44 + return Places.Front.name();
45 + }
46 +
47 + @Override
48 + public FrontView createView()
49 + {
50 + return new FrontViewImpl();
51 + }
52 +
53 + @Override
54 + public Activity createActivity( ClientFactory pCommonActivityParam, FrontView pView, FrontPlace pPlace )
55 + {
56 + return new FrontActivity( pCommonActivityParam, pView, pPlace );
57 + }
58 + } );
59 + }
60 + } );
55 61 }
62 + } );
56 63
64 + ActivityFactoryRegistry.register( new ActivityFactory.Asynchronous<ClientFactory, LeftView, LeftPlace>()
65 + {
57 66 @Override
58 67 public String getPlaceId()
59 68 {
60 69 return Places.Left.name();
61 70 }
62 - } );
63 71
64 - ActivityFactoryRegistry.register( new ActivityFactory.Synchronous<ClientFactory, RightView, RightPlace>()
65 - {
66 72 @Override
67 - public RightView getView()
73 + public void load( ClientFactory pCommonActivityParam, final Callback<ClientFactory, LeftView, LeftPlace> pCallback )
68 74 {
69 - return new RightViewImpl();
75 + GWT.runAsync( new RunAsyncSyncActivityFactoryCallBack( getPlaceId(), pCommonActivityParam )
76 + {
77 + @Override
78 + public void onSuccess()
79 + {
80 + pCallback.loaded( new CachedViewSynchronousActivityFactory<ClientFactory, LeftView, LeftPlace>()
81 + {
82 + @Override
83 + public String getPlaceId()
84 + {
85 + return Places.Left.name();
86 + }
87 +
88 + @Override
89 + public LeftView createView()
90 + {
91 + return new LeftViewImpl();
92 + }
93 +
94 + @Override
95 + public Activity createActivity( ClientFactory pCommonActivityParam, LeftView pView, LeftPlace pPlace )
96 + {
97 + return new LeftActivity( pCommonActivityParam, pView, pPlace );
98 + }
99 + } );
100 + }
101 + } );
70 102 }
103 + } );
71 104
105 + ActivityFactoryRegistry.register( new ActivityFactory.Asynchronous<ClientFactory, RightView, RightPlace>()
106 + {
72 107 @Override
73 - public Activity createActivity( ClientFactory pCommonActivityParam, RightView pView, RightPlace pPlace )
108 + public String getPlaceId()
74 109 {
75 - return new RightActivity( pCommonActivityParam, pView, pPlace );
110 + return Places.Right.name();
76 111 }
77 112
78 113 @Override
79 - public String getPlaceId()
114 + public void load( ClientFactory pCommonActivityParam, final Callback<ClientFactory, RightView, RightPlace> pCallback )
80 115 {
81 - return Places.Right.name();
116 + GWT.runAsync( new RunAsyncSyncActivityFactoryCallBack( getPlaceId(), pCommonActivityParam )
117 + {
118 + @Override
119 + public void onSuccess()
120 + {
121 + pCallback.loaded( new CachedViewSynchronousActivityFactory<ClientFactory, RightView, RightPlace>()
122 + {
123 + @Override
124 + public String getPlaceId()
125 + {
126 + return Places.Right.name();
127 + }
128 +
129 + @Override
130 + public RightView createView()
131 + {
132 + return new RightViewImpl();
133 + }
134 +
135 + @Override
136 + public Activity createActivity( ClientFactory pCommonActivityParam, RightView pView, RightPlace pPlace )
137 + {
138 + return new RightActivity( pCommonActivityParam, pView, pPlace );
139 + }
140 + } );
141 + }
142 + } );
82 143 }
83 144 } );
84 145 }