@Override public void show() { asPopupPanel().show(); }
@Override public void hide() { asPopupPanel().hide(); // events will not fire call closeHandler manually. if (popupViewCloseHandler != null) { popupViewCloseHandler.onClose(); } }
@Override public void setCloseHandler(final PopupViewCloseHandler popupViewCloseHandler) { this.popupViewCloseHandler = popupViewCloseHandler; if (closeHandlerRegistration == null) { closeHandlerRegistration = asPopupPanel().addCloseHandler(event -> { if (PopupViewImpl.this.popupViewCloseHandler != null) { PopupViewImpl.this.popupViewCloseHandler.onClose(); } }); } }
@Override public void showAndReposition() { onReposition(); asPopupPanel().setPopupPositionAndShow((offsetWidth, offsetHeight) -> { PopupPosition popupPosition = positioner.getPopupPosition(offsetWidth, offsetHeight); asPopupPanel().setPopupPosition(popupPosition.getLeft(), popupPosition.getTop()); }); }
/** * @param eventBus The {@link EventBus}. * @param positioner The {@link PopupPositioner} used to position the popup onReveal(); * * @see com.gwtplatform.mvp.client.view.CenterPopupPositioner * @see com.gwtplatform.mvp.client.view.RelativeToWidgetPopupPositioner * @see com.gwtplatform.mvp.client.view.TopLeftPopupPositioner */ protected PopupViewImpl( EventBus eventBus, PopupPositioner positioner) { this.eventBus = eventBus; setPopupPositioner(positioner); if (repositionOnWindowResize()) { Window.addResizeHandler(event -> { if (asPopupPanel().isShowing()) { showAndReposition(); } }); } }