Skip to content

RootPresenter.RootView : add and use the protected method getAppRootPane... #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 8, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,41 @@ public Widget asWidget() {
}

@Override
public void setInSlot(Object slot, IsWidget content) {
public void setInSlot(final Object slot, final IsWidget content) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you changed that to final?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My eclipse is configured to add final on file save.
I didn't cancel it before saving the file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove them please, this is the only nits that I have, afterward LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm preparing a new commit to that pull request by removing the final added in that commit.
I'm just wondering why there are final on the parameters of the class constructor but not on the parameters of the other methods ?
By the way, should I remove only the final on this method parameters, or all that where added by eclipse when saving the file ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old code, we're not adding them to Ctor as well anymore

assert slot == rootSlot : "Unknown slot used in the root proxy.";

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 All @@ -117,7 +128,7 @@ public void ensureGlass() {
if (glass == null) {
glass = Document.get().createDivElement();

Style style = glass.getStyle();
final Style style = glass.getStyle();
style.setPosition(Position.ABSOLUTE);
style.setLeft(0, Unit.PX);
style.setTop(0, Unit.PX);
Expand Down Expand Up @@ -160,7 +171,7 @@ protected void onBind() {
}

@Override
public void onResetPresenters(ResetPresentersEvent resetPresentersEvent) {
public void onResetPresenters(final ResetPresentersEvent resetPresentersEvent) {
if (!isResetting) {
isResetting = true;
internalReset();
Expand All @@ -175,6 +186,7 @@ public void onRevealRootContent(
setInSlot(rootSlot, revealContentEvent.getContent());
}

@Override
public void onRevealRootLayoutContent(
final RevealRootLayoutContentEvent revealContentEvent) {
getView().setUsingRootLayoutPanel(true);
Expand All @@ -192,7 +204,7 @@ public void onRevealRootPopupContent(
}

@Override
public void onLockInteraction(LockInteractionEvent lockInteractionEvent) {
public void onLockInteraction(final LockInteractionEvent lockInteractionEvent) {
if (lockInteractionEvent.shouldLock()) {
getView().lockScreen();
} else {
Expand Down