|
@@ -14,8 +14,7 @@ |
14 |
14 |
|
|
15 |
15 |
|
public abstract class AbstractClientMainAppEntryPoint implements EntryPoint, |
16 |
16 |
|
AppWindowLifeCycle, |
17 |
|
- |
DataTableStyle |
18 |
|
- |
{ |
|
17 |
+ |
DataTableStyle { |
19 |
18 |
|
/** |
20 |
19 |
|
* @noinspection NonJREEmulationClassesInClientCode |
21 |
20 |
|
*/ |
|
@@ -32,8 +31,7 @@ |
32 |
31 |
|
protected final String mShortAllLettersClientName; |
33 |
32 |
|
private static final String APP_PANEL = "AppPanel"; |
34 |
33 |
|
|
35 |
|
- |
protected AbstractClientMainAppEntryPoint( AppNames pAppNames ) |
36 |
|
- |
{ |
|
34 |
+ |
protected AbstractClientMainAppEntryPoint( AppNames pAppNames ) { |
37 |
35 |
|
mAppName = pAppNames.getAppName(); |
38 |
36 |
|
mShortAllLettersClientName = pAppNames.getShortAllLettersClientName(); |
39 |
37 |
|
} |
|
@@ -42,8 +40,7 @@ |
42 |
40 |
|
* This is the entry point method. |
43 |
41 |
|
*/ |
44 |
42 |
|
@Override |
45 |
|
- |
public final void onModuleLoad() |
46 |
|
- |
{ |
|
43 |
+ |
public final void onModuleLoad() { |
47 |
44 |
|
System.err.println( new UtilDateAdaptor() + " | Application Client Start Up" ); |
48 |
45 |
|
|
49 |
46 |
|
Window.addCloseHandler( this ); |
|
@@ -64,8 +61,7 @@ |
64 |
61 |
|
zBodyPanel.addStyleName( zUserAgent.isLegacyIE() ? "UserAgent-LegacyIE" : "UserAgent-Modern" ); |
65 |
62 |
|
|
66 |
63 |
|
String zReally = zUserAgent.getReally(); |
67 |
|
- |
if ( Strings.isNotNullOrEmpty( zReally ) ) |
68 |
|
- |
{ |
|
64 |
+ |
if ( Strings.isNotNullOrEmpty( zReally ) ) { |
69 |
65 |
|
zBodyPanel.addStyleName( "Really" + zReally ); |
70 |
66 |
|
} |
71 |
67 |
|
|
|
@@ -74,63 +70,54 @@ |
74 |
70 |
|
onAppLoad(); |
75 |
71 |
|
} |
76 |
72 |
|
|
77 |
|
- |
private RootPanel getAppPanel() |
78 |
|
- |
{ |
|
73 |
+ |
private RootPanel getAppPanel() { |
79 |
74 |
|
return RootPanel.get( APP_PANEL ); |
80 |
75 |
|
} |
81 |
76 |
|
|
82 |
77 |
|
@Override |
83 |
|
- |
public void onAppLoad() |
84 |
|
- |
{ |
|
78 |
+ |
public void onAppLoad() { |
85 |
79 |
|
nativeCodeInjection(); |
86 |
80 |
|
prefetchImages(); |
87 |
81 |
|
} |
88 |
82 |
|
|
89 |
83 |
|
@Override |
90 |
|
- |
public void onWindowClosing( Window.ClosingEvent pEvent ) |
91 |
|
- |
{ |
|
84 |
+ |
public void onWindowClosing( Window.ClosingEvent pEvent ) { |
92 |
85 |
|
} |
93 |
86 |
|
|
94 |
87 |
|
@Override |
95 |
|
- |
public void onClose( CloseEvent<Window> pEvent ) |
96 |
|
- |
{ |
|
88 |
+ |
public void onClose( CloseEvent<Window> pEvent ) { |
97 |
89 |
|
sWindowClosing = true; |
98 |
90 |
|
nativeCodeDispose(); |
99 |
91 |
|
CLIENT_LOGGER.trace.log( "WindowClosing..." ); |
100 |
92 |
|
} |
101 |
93 |
|
|
102 |
94 |
|
@Override |
103 |
|
- |
public void prefetchImages() |
104 |
|
- |
{ |
|
95 |
+ |
public void prefetchImages() { |
105 |
96 |
|
AlertManager.prefetchImages(); |
106 |
97 |
|
} |
107 |
98 |
|
|
108 |
99 |
|
@Override |
109 |
|
- |
public void nativeCodeInjection() |
110 |
|
- |
{ |
|
100 |
+ |
public void nativeCodeInjection() { |
111 |
101 |
|
} |
112 |
102 |
|
|
113 |
103 |
|
@Override |
114 |
|
- |
public void nativeCodeDispose() |
115 |
|
- |
{ |
|
104 |
+ |
public void nativeCodeDispose() { |
116 |
105 |
|
} |
117 |
106 |
|
|
118 |
|
- |
protected SingleWidgetContainer replaceAppPanel() |
119 |
|
- |
{ |
|
107 |
+ |
protected SingleWidgetContainer replaceAppPanel() { |
120 |
108 |
|
return replaceAppPanel( new WindowSizingPanel() ); |
121 |
109 |
|
} |
122 |
110 |
|
|
123 |
|
- |
protected SingleWidgetContainer replaceAppPanel( SingleWidgetContainer pSWC ) |
124 |
|
- |
{ |
|
111 |
+ |
protected SingleWidgetContainer replaceAppPanel( SingleWidgetContainer pSWC ) { |
125 |
112 |
|
Element zElement = RootPanel.get().getElement(); |
126 |
113 |
|
CommonElementHelper.setOverflowHidden( zElement ); |
127 |
114 |
|
CommonElementHelper.forceNoMarginOrPadding( zElement ); |
128 |
115 |
|
|
129 |
116 |
|
//noinspection GwtToHtmlReferences |
130 |
117 |
|
RootPanel panel = getAppPanel(); |
131 |
|
- |
if ( panel == null ) |
132 |
|
- |
{ |
133 |
|
- |
UtilsGwt.closeWindowNoConfirm( "HTML Corrupted - Failed to find an element with an id of 'AppPanel' in the HTML host page\nWill attempt to close Window!" ); |
|
118 |
+ |
if ( panel == null ) { |
|
119 |
+ |
UtilsGwt.closeWindowNoConfirm( |
|
120 |
+ |
"HTML Corrupted - Failed to find an element with an id of 'AppPanel' in the HTML host page\nWill attempt to close Window!" ); |
134 |
121 |
|
return null; |
135 |
122 |
|
} |
136 |
123 |
|
panel.clear(); // properly remove GWT widgets |
|
@@ -146,29 +133,23 @@ |
146 |
133 |
|
return pSWC; |
147 |
134 |
|
} |
148 |
135 |
|
|
149 |
|
- |
protected void handleUncaughtException( Throwable e ) |
150 |
|
- |
{ |
151 |
|
- |
if ( e != null ) |
152 |
|
- |
{ |
|
136 |
+ |
protected void handleUncaughtException( Throwable e ) { |
|
137 |
+ |
if ( e != null ) { |
153 |
138 |
|
ENTRY_POINT_LOGGER.error.log( e ); |
154 |
139 |
|
AlertManager.alert( "MainApp", "Unexpected Exception", e.getClass().getName(), e ); |
155 |
140 |
|
} |
156 |
141 |
|
} |
157 |
142 |
|
|
158 |
|
- |
private static class OurUncaughtExceptionHandler implements GWT.UncaughtExceptionHandler |
159 |
|
- |
{ |
|
143 |
+ |
private static class OurUncaughtExceptionHandler implements GWT.UncaughtExceptionHandler { |
160 |
144 |
|
private AbstractClientMainAppEntryPoint mEntryPoint; |
161 |
145 |
|
|
162 |
|
- |
public OurUncaughtExceptionHandler( AbstractClientMainAppEntryPoint pEntryPoint ) |
163 |
|
- |
{ |
|
146 |
+ |
public OurUncaughtExceptionHandler( AbstractClientMainAppEntryPoint pEntryPoint ) { |
164 |
147 |
|
mEntryPoint = pEntryPoint; |
165 |
148 |
|
} |
166 |
149 |
|
|
167 |
150 |
|
@Override |
168 |
|
- |
public void onUncaughtException( Throwable e ) |
169 |
|
- |
{ |
170 |
|
- |
if ( !sWindowClosing ) |
171 |
|
- |
{ |
|
151 |
+ |
public void onUncaughtException( Throwable e ) { |
|
152 |
+ |
if ( !sWindowClosing ) { |
172 |
153 |
|
mEntryPoint.handleUncaughtException( e ); |
173 |
154 |
|
} |
174 |
155 |
|
} |