@Override protected void revealInParent() { RevealContentEvent.fire(this, RuntimePresenter.TYPE_SET_TAB_CONTENT, this); }
@Override public void success(final T presenter) { // Deferring is needed because the event bus enqueues and delays handler // registration when events are currently being processed. // (see {@link com.google.gwt.event.shared.HandlerManager@addHandler()}) // So if a presenter registers a handler in its onBind() method and a // child fires the event in its onReveal() method, then the event might // get lost because the handler is not officially registered yet. Scheduler.get().scheduleDeferred(() -> { presenter.forceReveal(); presenter.setInSlot(event.getAssociatedType(), event.getContent()); }); } });
/** * Fires a {@link RevealContentEvent} with a specific {@link NestedSlot} into a source that has access to an {@link * com.google.web.bindery.event.shared.EventBus EventBus}. * * @param source The source that fires this event ({@link HasHandlers}). * @param type The specific event {@link NestedSlot}, usually defined in the parent presenter. * @param content The {@link Presenter} that wants to set itself as content in his parent. */ public static void fire(HasHandlers source, NestedSlot type, Presenter<?, ?> content) { source.fireEvent(new RevealContentEvent(type, content)); }
@Override protected void revealInParent() { RevealContentEvent.fire(this, ConfigPresenter.TYPE_COMPONENT_CONTENT, this); }
@Override protected void revealInParent() { RevealContentEvent.fire(this, RuntimePresenter.TYPE_SET_TAB_CONTENT, this); }
@Override protected void revealInParent() { RevealContentEvent.fire(this, RuntimePresenter.TYPE_SET_TAB_CONTENT, this); }
@Override protected void revealInParent() { RevealContentEvent.fire(this, RuntimePresenter.TYPE_SET_TAB_CONTENT, this); }
/** * Requests that the presenter reveal itself in its parent presenter. You can override this method to either fire a * {@link RevealContentEvent}, a {@link RevealRootContentEvent} or a {@link RevealRootLayoutContentEvent}. */ @SuppressWarnings("unchecked") protected void revealInParent() { if (revealType != null) { switch (revealType) { case Root: RevealRootContentEvent.fire(this, this); break; case RootLayout: RevealRootLayoutContentEvent.fire(this, this); break; case RootPopup: RevealRootPopupContentEvent.fire(this, (PresenterWidget<PopupView>) this); break; } } else { RevealContentEvent.fire(this, slot, this); } } }