List of usage examples for com.google.gwt.user.client.ui RootLayoutPanel setWidgetLeftRight
public void setWidgetLeftRight(Widget child, double left, Unit leftUnit, double right, Unit rightUnit)
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 . ja v a 2 s . c o m*/ 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()); }//from www. j a va 2 s . com 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 w w.ja v a 2 s .co m*/ 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// w w w .j av a2s . co 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(); }