Skip to content
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

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

Merged
merged 2 commits into from
Aug 8, 2013

Conversation

clavelm
Copy link
Contributor

@clavelm clavelm commented Jul 10, 2013

Add and use the protected method RootPresenter.RootView#getAppRootPanel()

That method can be overriden to change what RootPanel to use and easily embed an app in an existing webpage.

Example of attaching the app to a panel with id="appPanel" :

public class MyAppRootPresenter extends RootPresenter {

    public static final class MyRootView extends RootView {
        @Override
        protected RootPanel getAppRootPanel() {
            return RootPanel.get("appPanel");
        }
    }

    @Inject
    public MyAppRootPresenter(final EventBus eventBus, final MyRootView myRootView) {
        super(eventBus, myRootView);
    }
}

…anel

Child class of RootView can override that method to easily embed the app on a root presenter that is not the <body>
@christiangoudreau
Copy link
Member

What about the rootlayoutpanel?

@clavelm
Copy link
Contributor Author

clavelm commented Jul 10, 2013

The RootLayoutPanel is added to the RootPanel.
RootPresenter.java, line 87

getAppRootPanel().add(RootLayoutPanel.get());

I just learned today about RootPanel and RootLayoutPanel, my pull request might not be working for every situation.
It would be working for my app that is only using the RootPanel.

@branflake2267
Copy link
Contributor

Thanks for digging into this. :)

@christiangoudreau
Copy link
Member

True, it been so long since I looked at this code! Thanks for the contribution :D

@@ -76,15 +76,15 @@ 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

@clavelm
Copy link
Contributor Author

clavelm commented Jul 11, 2013

Ok, I just added a commit removing the 'final' modifiers.

@branflake2267
Copy link
Contributor

LGTM, nice job!

christiangoudreau added a commit that referenced this pull request Aug 8, 2013
RootPresenter.RootView : add and use the protected method getAppRootPane...
@christiangoudreau christiangoudreau merged commit a29f130 into ArcBees:master Aug 8, 2013
christiangoudreau added a commit that referenced this pull request Apr 4, 2014
RootPresenter.RootView : add and use the protected method getAppRootPane...
hpehl pushed a commit to hpehl/GWTP that referenced this pull request Dec 9, 2014
RootPresenter.RootView : add and use the protected method getAppRootPane...


Former-commit-id: 6cae409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants