@Override public final void unbind() { super.unbind(); if (getProxy() instanceof HasHandlerContainer) { ((HasHandlerContainer) getProxy()).getHandlerContainer().unbind(); } }
@Override public final void bind() { super.bind(); if (getProxy() instanceof HasHandlerContainer) { ((HasHandlerContainer) getProxy()).getHandlerContainer().bind(); } }
/** * Monitors the specified popup presenter so that we know when it * is closing. This allows us to make sure it doesn't receive * future messages. * * @param popupPresenter The {@link PresenterWidget} to monitor. */ private void monitorCloseEvent(final PresenterWidget<? extends PopupView> popupPresenter) { PopupView popupView = popupPresenter.getView(); popupView.setCloseHandler(popupPresenter::removeFromParentSlot); }
@Override public void onLockInteraction(LockInteractionEvent lockInteractionEvent) { if (lockInteractionEvent.shouldLock()) { getView().lockScreen(); } else { getView().unlockScreen(); } }
private void rawRemoveFromSlot(IsSlot<?> slot, PresenterWidget<?> child) { if (child == null || child.slot != slot) { return; } if (!child.isPopup()) { getView().removeFromSlot(slot.getRawSlot(), child); } child.orphan(); }
@Override public void changeTab(Tab tab, TabData tabData, String historyToken) { tab.setText(tabData.getLabel()); tab.setTargetHistoryToken(historyToken); }
/** * Retrieves this view as a {@link PopupPanel}. See {@link #asWidget()}. * * @return This view as a {@link PopupPanel} object. */ protected PopupPanel asPopupPanel() { return (PopupPanel) asWidget(); }
@Override public void hide() { asPopupPanel().hide(); // events will not fire call closeHandler manually. if (popupViewCloseHandler != null) { popupViewCloseHandler.onClose(); } }
@Override protected void onReveal() { super.onReveal(); activePopups++; }
@Override protected void onBind() { super.onBind(); // getEventBus().addHandler(ServerSelectionEvent.TYPE, this); }
/** * Never call this directly. This method is used only by Guice/GIN dependency * injection mechanism so that {@link AutobindDisable} can be used to * globally turn off automatic binding. */ @Inject final void automaticBind(AutobindDisable autobindDisable) { if (!autoBind || autobindDisable.disable()) { return; } bind(); }
/** * Removes this presenter from its parent. If this presenter has no parent, this method does nothing. */ public void removeFromParentSlot() { if (parent == null) { return; } parent.rawRemoveFromSlot(slot, this); }
@Override public void bind() { if (!bound.value) { onBind(); bound.value = true; } }
/** * Link a {@link Slot} to a container. * * @param slot the slot * @param container the container must implement HasWidgets. */ protected void bindSlot(Slot<?> slot, HasWidgets container) { internalBindSlot(slot, container); }
@Override public void onResetPresenters(ResetPresentersEvent resetPresentersEvent) { if (!isResetting) { isResetting = true; internalReset(); isResetting = false; } }
private void registerVisibleHandlers() { for (HandlerInformation<? extends EventHandler> handlerInformation : visibleHandlers) { registerVisibleHandler(handlerInformation); } }
@Override public void fireEvent(GwtEvent<?> event) { fireEvent((Event<?>) event); }
@SuppressWarnings("unchecked") @Override public T asWidget() { return (T) super.asWidget(); }
@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(); } }); } }