/** * Gets the singleton instance of RootLayoutPanel. This instance will always * be attached to the document body via {@link RootPanel#get()}. * * <p> * Note that, unlike {@link RootPanel#get(String)}, this class provides no way * to get an instance for any element on the page other than the document * body. This is because we know of no way to get resize events for anything * but the window. * </p> */ public static RootLayoutPanel get() { if (singleton == null) { singleton = new RootLayoutPanel(); RootPanel.get().add(singleton); } return singleton; }
@Override public void onSuccess(Void result) { EnterKeyDownHandler loginHandler = new EnterKeyDownHandler(); view.getLoginButton().addClickHandler(loginHandler); view.getUsernameBox().addKeyDownHandler(loginHandler); view.getPasswordBox().addKeyDownHandler(loginHandler); ForgotPasswordHandler forgotPasswordHandler = new ForgotPasswordHandler(); view.getForgotPasswordLabel().addClickHandler(forgotPasswordHandler); view.clearMessages(); RootLayoutPanel.get().clear(); RootLayoutPanel.get().add(view); }
RootLayoutPanel.get().add( glass ); RootLayoutPanel.get().add( this ); int screenWidth = RootLayoutPanel.get().getOffsetWidth(); int screenHeight = RootLayoutPanel.get().getOffsetHeight(); posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( this, posSize.left, Unit.PX, posSize.width, Unit.PX ); RootLayoutPanel.get().setWidgetTopHeight( this, posSize.top, Unit.PX, posSize.height, Unit.PX ); RootLayoutPanel.get().animate( 300 );
private void showRootPresenter() { SimpleLayoutPanel mainPanel = new SimpleLayoutPanel(); RootLayoutPanel.get().add(mainPanel); RootLayoutPanel.get().getElement().getStyle().setZIndex(0); workspacePresenterProvider.get().go(mainPanel); } }
protected void init() { _source = RootLayoutPanel.get(); registerEvents(); }
posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX ); posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); posSize.limit(); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX ); posSize.limit(); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX );
public void onModuleLoad() { DockLayoutPanel outer = binder.createAndBindUi(this); // Get rid of scrollbars, and clear out the window's built-in margin, // because we want to take advantage of the entire client area. Window.enableScrolling(false); Window.setMargin("0px"); RootLayoutPanel root = RootLayoutPanel.get(); root.add(outer); }
@Override public void execute() { // try to fit to the content size int maxWidth = Window.getClientWidth() - 20; // 20 pixels of // margin int w = Math.max( ResizablePanelBad.this.getOffsetWidth(), Math.max( contentWidget.getElement().getScrollWidth(), contentWidget.getElement().getOffsetWidth() ) ) + resizeHandlerSize * 2; if( w > maxWidth ) w = maxWidth; int maxHeight = Window.getClientHeight() - 20; int h = Math.max( ResizablePanelBad.this.getOffsetHeight(), Math.max( contentWidget.getElement().getScrollHeight(), contentWidget.getElement().getOffsetHeight() ) ) + resizeHandlerSize * 2 + titleSize; if( h > maxHeight ) h = maxHeight; PositionAndSize posSize = new PositionAndSize( (Window.getClientWidth() - w) / 2, (Window.getClientHeight() - h) / 2, w, h ); posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX ); RootLayoutPanel.get().animate( 300 ); } } );
public void onResize(ResizeEvent event) { RootLayoutPanel.this.onResize(); } });
RootLayoutPanel.get().add( glass ); RootLayoutPanel.get().add( this ); int screenWidth = RootLayoutPanel.get().getOffsetWidth(); int screenHeight = RootLayoutPanel.get().getOffsetHeight(); posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( this, posSize.left, Unit.PX, posSize.width, Unit.PX ); RootLayoutPanel.get().setWidgetTopHeight( this, posSize.top, Unit.PX, posSize.height, Unit.PX ); RootLayoutPanel.get().animate( 300 );
private void go(@Nonnull final Presenter newPresenter) { if (currentPresenter != null) { currentPresenter.unbind(); } currentPresenter = newPresenter; currentPresenter.go(RootLayoutPanel.get()); }
posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX ); posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); posSize.limit(); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX ); posSize.limit(); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX );
public void onModuleLoad() { RootLayoutPanel rp = RootLayoutPanel.get(); DockLayoutPanel dp = new DockLayoutPanel(Unit.PX); rp.add(dp); ... }
@Override public void execute() { // try to fit to the content size int maxWidth = Window.getClientWidth() - 20; // 20 pixels of // margin int w = Math.max( ResizablePanelBad.this.getOffsetWidth(), Math.max( contentWidget.getElement().getScrollWidth(), contentWidget.getElement().getOffsetWidth() ) ) + resizeHandlerSize * 2; if( w > maxWidth ) w = maxWidth; int maxHeight = Window.getClientHeight() - 20; int h = Math.max( ResizablePanelBad.this.getOffsetHeight(), Math.max( contentWidget.getElement().getScrollHeight(), contentWidget.getElement().getOffsetHeight() ) ) + resizeHandlerSize * 2 + titleSize; if( h > maxHeight ) h = maxHeight; PositionAndSize posSize = new PositionAndSize( (Window.getClientWidth() - w) / 2, (Window.getClientHeight() - h) / 2, w, h ); posSize.limit(); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX ); RootLayoutPanel.get().animate( 300 ); } } );