|
@@ -31,10 +31,8 @@ |
31 |
31 |
|
import com.google.gwt.user.client.ui.*; |
32 |
32 |
|
|
33 |
33 |
|
public class DATT extends AbstractClientMainAppEntryPoint implements ViewDefs, |
34 |
|
- |
RestrictedResourceSwitcherCallBack |
35 |
|
- |
{ |
36 |
|
- |
static |
37 |
|
- |
{ |
|
34 |
+ |
RestrictedResourceSwitcherCallBack { |
|
35 |
+ |
static { |
38 |
36 |
|
UserViewAccessControlFactory.setViewDefSecuritySets( ViewDefs.SECURITY_SETS ); |
39 |
37 |
|
} |
40 |
38 |
|
|
|
@@ -61,8 +59,7 @@ |
61 |
59 |
|
// HOME! |
62 |
60 |
|
new HomeFactory() ); |
63 |
61 |
|
|
64 |
|
- |
public DATT() |
65 |
|
- |
{ |
|
62 |
+ |
public DATT() { |
66 |
63 |
|
super( new AppNames( "Distributed Agile Team Tracker", "DATT" ) ); |
67 |
64 |
|
|
68 |
65 |
|
// add in all the factory-less screens. This can be broken out into different modules if compile becomes too slow. |
|
@@ -70,8 +67,7 @@ |
70 |
67 |
|
} |
71 |
68 |
|
|
72 |
69 |
|
@Override |
73 |
|
- |
public void onAppLoad() |
74 |
|
- |
{ |
|
70 |
+ |
public void onAppLoad() { |
75 |
71 |
|
System.out.println( "DevMode " + Dev.state() ); |
76 |
72 |
|
|
77 |
73 |
|
replaceAppPanel(); |
|
@@ -81,8 +77,7 @@ |
81 |
77 |
|
CScomm.setInstance( new GwtCScomm( null, mVM, new AppInitializationCallback() ) ); |
82 |
78 |
|
} |
83 |
79 |
|
|
84 |
|
- |
public void finishAppLoad() |
85 |
|
- |
{ |
|
80 |
+ |
public void finishAppLoad() { |
86 |
81 |
|
ClientContext zContext = ClientContext.get(); |
87 |
82 |
|
|
88 |
83 |
|
Dev.init( zContext ); |
|
@@ -100,20 +95,19 @@ |
100 |
95 |
|
RestrictedResourcePickerDialogViewFactory zRRPDF = |
101 |
96 |
|
new RestrictedResourcePickerDialogFactory<RestrictedResourceView>( "Select Queue", RestrictedResourceViewDataProvider.getInstance(), |
102 |
97 |
|
RestrictedResourceViewMetaData.getInstance(), |
103 |
|
- |
new RestrictedResourceViewSupportFactory<RestrictedResourceView>() |
104 |
|
- |
{ |
|
98 |
+ |
new RestrictedResourceViewSupportFactory<RestrictedResourceView>() { |
105 |
99 |
|
@Override |
106 |
100 |
|
public TableDataReloadable createTable( |
107 |
101 |
|
FilteringTableModel<RestrictedResourceView> pFilter, |
108 |
|
- |
TableClickCommand<RestrictedResourceView> pRestrictedResourceViewTableClickCommand ) |
109 |
|
- |
{ |
|
102 |
+ |
TableClickCommand<RestrictedResourceView> |
|
103 |
+ |
pRestrictedResourceViewTableClickCommand ) { |
110 |
104 |
|
return new RestrictedResourceViewTable( pFilter, |
111 |
105 |
|
pRestrictedResourceViewTableClickCommand ); |
112 |
106 |
|
} |
113 |
107 |
|
|
114 |
108 |
|
@Override |
115 |
|
- |
public QBEinputPanelAccessorWithCtrlMap<RestrictedResourceView> createFieldPanel() |
116 |
|
- |
{ |
|
109 |
+ |
public QBEinputPanelAccessorWithCtrlMap<RestrictedResourceView> |
|
110 |
+ |
createFieldPanel() { |
117 |
111 |
|
return new RestrictedResourcePickerFieldsPanel(); |
118 |
112 |
|
} |
119 |
113 |
|
} ); |
|
@@ -155,26 +149,20 @@ |
155 |
149 |
|
zAppPanel.setInfoMessage( "Hello" ); |
156 |
150 |
|
} |
157 |
151 |
|
|
158 |
|
- |
protected void initializeLoggerFactory() |
159 |
|
- |
{ |
|
152 |
+ |
protected void initializeLoggerFactory() { |
160 |
153 |
|
//noinspection NonJREEmulationClassesInClientCode |
161 |
154 |
|
LoggerFactory.init( new ConfigurationLoggerLevel(), BrowserAsLogSyncFactory.INSTANCE ); |
162 |
155 |
|
} |
163 |
156 |
|
|
164 |
|
- |
private class AppInitializationCallback implements AsyncCallback<AppInitializationResult> |
165 |
|
- |
{ |
|
157 |
+ |
private class AppInitializationCallback implements AsyncCallback<AppInitializationResult> { |
166 |
158 |
|
@Override |
167 |
|
- |
public void onFailure( Throwable pThrowable ) |
168 |
|
- |
{ |
|
159 |
+ |
public void onFailure( Throwable pThrowable ) { |
169 |
160 |
|
String message; |
170 |
161 |
|
|
171 |
|
- |
if ( pThrowable instanceof InvocationException ) |
172 |
|
- |
{ |
|
162 |
+ |
if ( pThrowable instanceof InvocationException ) { |
173 |
163 |
|
// see javadoc for InvocationException |
174 |
164 |
|
message = "A connection could not be established with the server"; |
175 |
|
- |
} |
176 |
|
- |
else if ( pThrowable instanceof IncompatibleRemoteServiceException ) |
177 |
|
- |
{ |
|
165 |
+ |
} else if ( pThrowable instanceof IncompatibleRemoteServiceException ) { |
178 |
166 |
|
/* |
179 |
167 |
|
* This _should_ not happen to users, so long as the .nocache |
180 |
168 |
|
* file isn't cached by the client. |
|
@@ -182,9 +170,7 @@ |
182 |
170 |
|
message = "Client and server versions are incompatible. Try ctrl-clicking\n" + // |
183 |
171 |
|
"or shift-clicking the browser refresh button, or clearing your\n" + // |
184 |
172 |
|
"browser's cache in 'Internet Options' / your browser's preferences. "; |
185 |
|
- |
} |
186 |
|
- |
else |
187 |
|
- |
{ |
|
173 |
+ |
} else { |
188 |
174 |
|
// probably an application-specific execption on the server |
189 |
175 |
|
message = "An application error occured on the server"; |
190 |
176 |
|
} |
|
@@ -193,18 +179,15 @@ |
193 |
179 |
|
} |
194 |
180 |
|
|
195 |
181 |
|
@Override |
196 |
|
- |
public void onSuccess( AppInitializationResult result ) |
197 |
|
- |
{ |
|
182 |
+ |
public void onSuccess( AppInitializationResult result ) { |
198 |
183 |
|
System.err.println( new UtilDateAdaptor() + " | Client AppInitialization" ); |
199 |
184 |
|
|
200 |
|
- |
if ( result == null ) |
201 |
|
- |
{ |
|
185 |
+ |
if ( result == null ) { |
202 |
186 |
|
UtilsGwt.closeWindowNoConfirm( 5 ); |
203 |
187 |
|
return; |
204 |
188 |
|
} |
205 |
189 |
|
|
206 |
|
- |
try |
207 |
|
- |
{ |
|
190 |
+ |
try { |
208 |
191 |
|
new ClientConfiguration( result.getClientConfig() ); // This line must preceed the next |
209 |
192 |
|
initializeLoggerFactory(); // ......................... This line must follow the previous |
210 |
193 |
|
|
|
@@ -212,14 +195,12 @@ |
212 |
195 |
|
|
213 |
196 |
|
finishAppLoad(); |
214 |
197 |
|
} |
215 |
|
- |
catch ( RuntimeException e ) |
216 |
|
- |
{ |
|
198 |
+ |
catch ( RuntimeException e ) { |
217 |
199 |
|
reportFailure( e, "onSuccess()", null ); |
218 |
200 |
|
} |
219 |
201 |
|
} |
220 |
202 |
|
|
221 |
|
- |
private void reportFailure( Throwable pThrowable, String method, String message ) |
222 |
|
- |
{ |
|
203 |
+ |
private void reportFailure( Throwable pThrowable, String method, String message ) { |
223 |
204 |
|
pThrowable.printStackTrace(); // prints the trace in the GWT hosted shell |
224 |
205 |
|
String html = "<h1>Application Initialization Failed</h1>" + // |
225 |
206 |
|
"<p>" + message + "</p>" + // |
|
@@ -230,16 +211,12 @@ |
230 |
211 |
|
} |
231 |
212 |
|
} |
232 |
213 |
|
|
233 |
|
- |
private static class NextDemoUserRequestHandlerImpl implements NextDemoUserRequestHandler |
234 |
|
- |
{ |
|
214 |
+ |
private static class NextDemoUserRequestHandlerImpl implements NextDemoUserRequestHandler { |
235 |
215 |
|
@Override |
236 |
|
- |
public void nextDemoUser() |
237 |
|
- |
{ |
238 |
|
- |
UserViewDataProvider.getInstance().nextDemoUser( new SimpleDataProviderCallBack() |
239 |
|
- |
{ |
|
216 |
+ |
public void nextDemoUser() { |
|
217 |
+ |
UserViewDataProvider.getInstance().nextDemoUser( new SimpleDataProviderCallBack() { |
240 |
218 |
|
@Override |
241 |
|
- |
public void error( String pError ) |
242 |
|
- |
{ |
|
219 |
+ |
public void error( String pError ) { |
243 |
220 |
|
new ShowScreenCommand( ViewDefs.HOME, pError ).execute(); |
244 |
221 |
|
} |
245 |
222 |
|
} ); |
|
@@ -247,18 +224,13 @@ |
247 |
224 |
|
} |
248 |
225 |
|
|
249 |
226 |
|
@Override |
250 |
|
- |
public void switchToRestrictedResource( AlternateRestrictedResourceOption pAlternateOption ) |
251 |
|
- |
{ |
252 |
|
- |
UserViewDataProvider.getInstance().attemptSwitchToRestrictedResource( (RestrictedResourceView) pAlternateOption, new SimpleDataProviderCallBack() |
253 |
|
- |
{ |
|
227 |
+ |
public void switchToRestrictedResource( AlternateRestrictedResourceOption pAlternateOption ) { |
|
228 |
+ |
UserViewDataProvider.getInstance().attemptSwitchToRestrictedResource( (RestrictedResourceView) pAlternateOption, new SimpleDataProviderCallBack() { |
254 |
229 |
|
@Override |
255 |
|
- |
public void error( String pError ) |
256 |
|
- |
{ |
257 |
|
- |
if ( Strings.isNullOrEmpty( pError ) ) |
258 |
|
- |
{ |
|
230 |
+ |
public void error( String pError ) { |
|
231 |
+ |
if ( Strings.isNullOrEmpty( pError ) ) { |
259 |
232 |
|
PageRefreshableProxy zRefreshableProxy = ClientContext.get().checkGet( PageRefreshableProxy.class ); |
260 |
|
- |
if ( zRefreshableProxy != null ) |
261 |
|
- |
{ |
|
233 |
+ |
if ( zRefreshableProxy != null ) { |
262 |
234 |
|
zRefreshableProxy.refreshPage(); |
263 |
235 |
|
return; |
264 |
236 |
|
} |