Example usage for com.google.gwt.user.client.ui RootLayoutPanel setWidgetTopBottom

List of usage examples for com.google.gwt.user.client.ui RootLayoutPanel setWidgetTopBottom

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui RootLayoutPanel setWidgetTopBottom.

Prototype

public void setWidgetTopBottom(Widget child, double top, Unit topUnit, double bottom, Unit bottomUnit) 

Source Link

Document

Sets the child widget's top and bottom values.

Usage

From source file:org.onebusaway.webapp.gwt.common.resources.StandardApplicationContainer.java

License:Apache License

public static void add(Widget widget) {

    RootLayoutPanel panel = RootLayoutPanel.get();
    panel.add(widget);// w  ww . ja  va2s.c om
    panel.setWidgetTopBottom(widget, 43, Unit.PX, 0, Unit.PX);

    StyleInjector.inject(CommonResources.INSTANCE.getApplicationCss().getText());
}

From source file:org.rstudio.studio.client.application.Application.java

License:Open Source License

public void go(final RootLayoutPanel rootPanel, final Command dismissLoadingProgress) {
    Widget w = view_.getWidget();/*from   w  w w.  jav a2 s  .c  om*/
    rootPanel.add(w);
    rootPanel.setWidgetTopBottom(w, 0, Style.Unit.PX, 0, Style.Unit.PX);
    rootPanel.setWidgetLeftRight(w, 0, Style.Unit.PX, 0, Style.Unit.PX);

    // attempt init
    pClientInit_.get().execute(new ServerRequestCallback<SessionInfo>() {

        public void onResponseReceived(final SessionInfo sessionInfo) {
            // initialize workbench after verifying agreement
            verifyAgreement(sessionInfo, new Operation() {
                public void execute() {
                    dismissLoadingProgress.execute();

                    session_.setSessionInfo(sessionInfo);

                    // hide the workbench if we have a project parameter 
                    // (since we are going to redirect anyway)
                    if (haveProjectParameter())
                        hideWorkbench(rootPanel);

                    // initialize workbench
                    initializeWorkbench();

                    // reload application if we have a project parameter
                    if (haveProjectParameter())
                        reloadApplication(sessionInfo.getSwitchToProject());
                }
            });
        }

        public void onError(ServerError error) {
            Debug.logError(error);
            dismissLoadingProgress.execute();

            globalDisplay_.showErrorMessage("RStudio Initialization Error", error.getUserMessage());
        }
    });
}

From source file:org.rstudio.studio.client.application.Application.java

License:Open Source License

@Handler
public void onShowRequestLog() {
    GWT.runAsync(new RunAsyncCallback() {
        public void onFailure(Throwable reason) {
            Window.alert(reason.toString());
        }// w w  w  .  j  a v  a 2s  .co m

        public void onSuccess() {
            final RequestLogVisualization viz = new RequestLogVisualization();
            final RootLayoutPanel root = RootLayoutPanel.get();
            root.add(viz);
            root.setWidgetTopBottom(viz, 10, Unit.PX, 10, Unit.PX);
            root.setWidgetLeftRight(viz, 10, Unit.PX, 10, Unit.PX);
            viz.addCloseHandler(new CloseHandler<RequestLogVisualization>() {
                public void onClose(CloseEvent<RequestLogVisualization> event) {
                    root.remove(viz);
                }
            });
        }
    });
}

From source file:org.rstudio.studio.client.application.Application.java

License:Open Source License

private void hideWorkbench(final RootLayoutPanel rootPanel) {
    final Label w = new Label();
    w.getElement().getStyle().setBackgroundColor("#e1e2e5");
    rootPanel.add(w);//  w  ww.  j a  va  2 s . com
    rootPanel.setWidgetTopBottom(w, 0, Style.Unit.PX, 0, Style.Unit.PX);
    rootPanel.setWidgetLeftRight(w, 0, Style.Unit.PX, 0, Style.Unit.PX);
}

From source file:org.rstudio.studio.client.common.satellite.SatelliteApplication.java

License:Open Source License

public void go(RootLayoutPanel rootPanel, final Command dismissLoadingProgress) {
    // indicate that we are a satellite window
    satellite_.initialize(name_, new CommandWithArg<JavaScriptObject>() {
        @Override/*from   w w  w  .java  2 s. c  o  m*/
        public void execute(JavaScriptObject params) {
            view_.reactivate(params);
        }
    });

    if (!manuallyFlushPendingEvents()) {
        flushPendingEvents();
    }

    // inject ace themes
    pAceThemes_.get();

    // register for uncaught exceptions (do this after calling 
    // initSatelliteWindow b/c it depends on Server)
    uncaughtExHandler_.register();

    // create the widget
    Widget w = view_.getWidget();
    rootPanel.add(w);
    rootPanel.setWidgetTopBottom(w, 0, Style.Unit.PX, 0, Style.Unit.PX);
    rootPanel.setWidgetLeftRight(w, 0, Style.Unit.PX, 0, Style.Unit.PX);

    // show the view
    view_.show(satellite_.getParams());

    // dismiss loading progress
    dismissLoadingProgress.execute();
}