use of io.jmix.core.common.event.EventHub in project jmix by jmix-framework.
the class Window method removeCloseListener.
/**
* Removes a previously registered CloseListener.
*
* @param listener the listener to remove
* @deprecated Use {@link Screen#addAfterCloseListener(Consumer)} instead.
*/
@Deprecated
default void removeCloseListener(CloseListener listener) {
EventHub eventHub = UiControllerUtils.getEventHub(getFrameOwner());
eventHub.unsubscribe(Screen.AfterCloseEvent.class, new AfterCloseListenerAdapter(listener));
}
use of io.jmix.core.common.event.EventHub in project jmix by jmix-framework.
the class Window method removeListener.
/**
* Removes a previously registered CloseListener.
*
* @param listener the listener to remove
* @deprecated Use {@link Screen#addAfterCloseListener(Consumer)} instead.
*/
@Deprecated
default void removeListener(CloseListener listener) {
EventHub eventHub = UiControllerUtils.getEventHub(getFrameOwner());
eventHub.unsubscribe(Screen.AfterCloseEvent.class, new AfterCloseListenerAdapter(listener));
}
use of io.jmix.core.common.event.EventHub in project jmix by jmix-framework.
the class DynAttrFacetImpl method subscribe.
private void subscribe() {
Frame frame = getOwner();
if (frame == null) {
throw new IllegalStateException("DynAttrFacet is not attached to Frame");
}
Screen screen = UiControllerUtils.getScreen(frame.getFrameOwner());
if (screen instanceof StandardEditor) {
EventHub screenEvents = UiControllerUtils.getEventHub(screen);
screenEvents.subscribe(StandardEditor.InitEntityEvent.class, this::initEntityInStandardEditor);
} else if (screen instanceof MasterDetailScreen) {
EventHub screenEvents = UiControllerUtils.getEventHub(screen);
screenEvents.subscribe(MasterDetailScreen.InitEntityEvent.class, this::initEntityInMasterDetailScreen);
}
}
use of io.jmix.core.common.event.EventHub in project jmix by jmix-framework.
the class PresentationsFacetImpl method subscribe.
protected void subscribe() {
checkAttachedFrame();
// noinspection ConstantConditions
EventHub screenEvents = UiControllerUtils.getEventHub(getScreenOwner());
afterShowSubscription = screenEvents.subscribe(Screen.AfterShowEvent.class, settingsFacetResolver::resolveAfterShowEvent);
afterDetachedSubscription = screenEvents.subscribe(Screen.AfterDetachEvent.class, this::onAfterDetachEvent);
}
use of io.jmix.core.common.event.EventHub in project jmix by jmix-framework.
the class Window method removeBeforeWindowCloseListener.
/**
* Removes a previously added listener.
*
* @param listener the listener to remove
* @deprecated Use {@link Subscription} instead
*/
@Deprecated
default void removeBeforeWindowCloseListener(Consumer<BeforeCloseEvent> listener) {
EventHub eventHub = UiControllerUtils.getEventHub(getFrameOwner());
eventHub.unsubscribe(BeforeCloseEvent.class, listener);
}
Aggregations