@@ -82,24 +82,35 @@ public void setInSlot(Object slot, IsWidget content) {
82
82
if (usingRootLayoutPanel ) {
83
83
// TODO Next 3 lines are a dirty workaround for
84
84
// http://code.google.com/p/google-web-toolkit/issues/detail?id=4737
85
- RootPanel . get ().clear ();
85
+ getAppRootPanel ().clear ();
86
86
RootLayoutPanel .get ().clear ();
87
- RootPanel . get ().add (RootLayoutPanel .get ());
87
+ getAppRootPanel ().add (RootLayoutPanel .get ());
88
88
if (content != null ) {
89
89
RootLayoutPanel .get ().add (content );
90
90
}
91
91
} else {
92
92
// TODO Next 2 lines are a dirty workaround for
93
93
// http://code.google.com/p/google-web-toolkit/issues/detail?id=4737
94
94
RootLayoutPanel .get ().clear ();
95
- RootPanel . get ().clear ();
95
+ getAppRootPanel ().clear ();
96
96
if (content != null ) {
97
- RootPanel . get ().add (content );
97
+ getAppRootPanel ().add (content );
98
98
}
99
99
}
100
100
}
101
101
102
- private void setUsingRootLayoutPanel (boolean usingRootLayoutPanel ) {
102
+ /**
103
+ * Return the RootPanel on which to add the content.
104
+ * <p />
105
+ * It returns the default RootPanel.
106
+ * It can be overriden to return another RootPanel to allow embeding the application.
107
+ * @return the RootPanel on which to add the content
108
+ */
109
+ protected RootPanel getAppRootPanel () {
110
+ return RootPanel .get ();
111
+ }
112
+
113
+ private void setUsingRootLayoutPanel (final boolean usingRootLayoutPanel ) {
103
114
this .usingRootLayoutPanel = usingRootLayoutPanel ;
104
115
}
105
116
@@ -175,6 +186,7 @@ public void onRevealRootContent(
175
186
setInSlot (rootSlot , revealContentEvent .getContent ());
176
187
}
177
188
189
+ @ Override
178
190
public void onRevealRootLayoutContent (
179
191
final RevealRootLayoutContentEvent revealContentEvent ) {
180
192
getView ().setUsingRootLayoutPanel (true );
0 commit comments