Skip to content

Commit

Permalink
Merge pull request ArcBees#287 from clavelm/issue286
Browse files Browse the repository at this point in the history
RootPresenter.RootView : add and use the protected method getAppRootPane...


Former-commit-id: 6cae409
  • Loading branch information
christiangoudreau committed Aug 8, 2013
2 parents 10d28a1 + 1c343e3 commit acd8c17
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,35 @@ public void setInSlot(Object slot, IsWidget content) {
if (usingRootLayoutPanel) {
// TODO Next 3 lines are a dirty workaround for
// http://code.google.com/p/google-web-toolkit/issues/detail?id=4737
RootPanel.get().clear();
getAppRootPanel().clear();
RootLayoutPanel.get().clear();
RootPanel.get().add(RootLayoutPanel.get());
getAppRootPanel().add(RootLayoutPanel.get());
if (content != null) {
RootLayoutPanel.get().add(content);
}
} else {
// TODO Next 2 lines are a dirty workaround for
// http://code.google.com/p/google-web-toolkit/issues/detail?id=4737
RootLayoutPanel.get().clear();
RootPanel.get().clear();
getAppRootPanel().clear();
if (content != null) {
RootPanel.get().add(content);
getAppRootPanel().add(content);
}
}
}

private void setUsingRootLayoutPanel(boolean usingRootLayoutPanel) {
/**
* Return the RootPanel on which to add the content.
* <p />
* It returns the default RootPanel.
* It can be overriden to return another RootPanel to allow embeding the application.
* @return the RootPanel on which to add the content
*/
protected RootPanel getAppRootPanel() {
return RootPanel.get();
}

private void setUsingRootLayoutPanel(final boolean usingRootLayoutPanel) {
this.usingRootLayoutPanel = usingRootLayoutPanel;
}

Expand Down Expand Up @@ -175,6 +186,7 @@ public void onRevealRootContent(
setInSlot(rootSlot, revealContentEvent.getContent());
}

@Override
public void onRevealRootLayoutContent(
final RevealRootLayoutContentEvent revealContentEvent) {
getView().setUsingRootLayoutPanel(true);
Expand Down

0 comments on commit acd8c17

Please sign in to comment.