public abstract class Screen extends java.lang.Object implements FrameOwner
Window
Modifier and Type | Class and Description |
---|---|
static class |
Screen.AfterCloseEvent
Event sent after the screen is closed by its
close(CloseAction) method and after Screen.AfterDetachEvent . |
static class |
Screen.AfterDetachEvent
Event sent after the screen is removed from the application UI when it is closed by the user or when the user logs out.
|
static class |
Screen.AfterInitEvent
Event sent when the screen controller and all its declaratively defined components are created, dependency
injection is completed, and all components have completed their internal initialization procedures.
|
static class |
Screen.AfterShowEvent
Event sent right after the screen is shown, i.e.
|
static class |
Screen.BeforeCloseEvent
Event sent right before the screen is closed by its
close(CloseAction) method. |
static class |
Screen.BeforeShowEvent
Event sent right before the screen is shown, i.e.
|
static class |
Screen.InitEvent
Event sent when the screen controller and all its declaratively defined components are created, and dependency
injection is completed.
|
NO_OPTIONS, WINDOW_CLOSE_ACTION, WINDOW_COMMIT_AND_CLOSE_ACTION, WINDOW_DISCARD_AND_CLOSE_ACTION
Constructor and Description |
---|
Screen() |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addAfterCloseListener(java.util.function.Consumer<Screen.AfterCloseEvent> listener)
Adds
Screen.AfterCloseEvent listener. |
protected io.jmix.core.common.event.Subscription |
addAfterDetachListener(java.util.function.Consumer<Screen.AfterDetachEvent> listener)
Adds
Screen.AfterDetachEvent listener. |
protected io.jmix.core.common.event.Subscription |
addAfterInitListener(java.util.function.Consumer<Screen.AfterInitEvent> listener)
Adds
Screen.AfterInitEvent listener. |
io.jmix.core.common.event.Subscription |
addAfterShowListener(java.util.function.Consumer<Screen.AfterShowEvent> listener)
Adds
Screen.AfterShowEvent listener. |
protected io.jmix.core.common.event.Subscription |
addBeforeCloseListener(java.util.function.Consumer<Screen.BeforeCloseEvent> listener)
Adds
Screen.BeforeCloseEvent listener. |
protected io.jmix.core.common.event.Subscription |
addBeforeShowListener(java.util.function.Consumer<Screen.BeforeShowEvent> listener)
Adds
Screen.BeforeShowEvent listener. |
protected io.jmix.core.common.event.Subscription |
addInitListener(java.util.function.Consumer<Screen.InitEvent> listener)
Adds
Screen.InitEvent listener. |
protected io.jmix.core.common.event.Subscription |
addUrlParamsChangeListener(java.util.function.Consumer<UrlParamsChangedEvent> listener)
Adds
UrlParamsChangedEvent listener. |
OperationResult |
close(CloseAction action)
Requests closing of the screen caused by the given action.
|
OperationResult |
close(StandardOutcome outcome)
Requests closing of the screen with the given
outcome . |
OperationResult |
closeWithDefaultAction()
Closes the screen with
FrameOwner.WINDOW_CLOSE_ACTION action. |
protected <E> void |
fireEvent(java.lang.Class<E> eventType,
E event) |
protected org.springframework.context.ApplicationContext |
getApplicationContext() |
protected io.jmix.core.common.event.EventHub |
getEventHub() |
protected java.util.Map<java.lang.Class<?>,java.lang.Object> |
getExtensions() |
java.lang.String |
getId() |
protected ScreenData |
getScreenData() |
protected java.util.List<org.springframework.context.ApplicationListener> |
getUiEventListeners() |
Window |
getWindow() |
protected boolean |
isMultipleOpen() |
protected boolean |
isSameScreen(Screen openedScreen)
Compares this screen with an already opened screen.
|
protected void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
protected void |
setExtensions(java.util.Map<java.lang.Class<?>,java.lang.Object> extensions) |
protected void |
setId(java.lang.String id)
Sets id of the screen.
|
protected void |
setScreenData(ScreenData data) |
protected void |
setUiEventListeners(java.util.List<org.springframework.context.ApplicationListener> listeners) |
protected void |
setWindow(Window window) |
Screen |
show()
Shows this screen.
|
protected org.springframework.context.ApplicationContext getApplicationContext()
@Autowired protected void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
protected io.jmix.core.common.event.EventHub getEventHub()
@Nullable protected java.util.Map<java.lang.Class<?>,java.lang.Object> getExtensions()
protected void setExtensions(@Nullable java.util.Map<java.lang.Class<?>,java.lang.Object> extensions)
@Nullable public java.lang.String getId()
protected void setId(@Nullable java.lang.String id)
id
- screen idprotected ScreenData getScreenData()
protected void setScreenData(ScreenData data)
protected <E> void fireEvent(java.lang.Class<E> eventType, E event)
public Window getWindow()
protected void setWindow(Window window)
@Nullable protected java.util.List<org.springframework.context.ApplicationListener> getUiEventListeners()
protected void setUiEventListeners(@Nullable java.util.List<org.springframework.context.ApplicationListener> listeners)
protected io.jmix.core.common.event.Subscription addInitListener(java.util.function.Consumer<Screen.InitEvent> listener)
Screen.InitEvent
listener.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe protected void onInit(InitEvent event) { // handle event here }
listener
- listenerprotected io.jmix.core.common.event.Subscription addAfterInitListener(java.util.function.Consumer<Screen.AfterInitEvent> listener)
Screen.AfterInitEvent
listener.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe protected void onAfterInit(AfterInitEvent event) { // handle event here }
listener
- listenerprotected io.jmix.core.common.event.Subscription addBeforeCloseListener(java.util.function.Consumer<Screen.BeforeCloseEvent> listener)
Screen.BeforeCloseEvent
listener.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe protected void onBeforeClose(BeforeCloseEvent event) { // handle event here }
listener
- listenerprotected io.jmix.core.common.event.Subscription addBeforeShowListener(java.util.function.Consumer<Screen.BeforeShowEvent> listener)
Screen.BeforeShowEvent
listener.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe protected void onBeforeShow(BeforeShowEvent event) { // handle event here }
listener
- listenerpublic io.jmix.core.common.event.Subscription addAfterShowListener(java.util.function.Consumer<Screen.AfterShowEvent> listener)
Screen.AfterShowEvent
listener.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe protected void onAfterShow(AfterShowEvent event) { // handle event here }
listener
- listenerpublic io.jmix.core.common.event.Subscription addAfterCloseListener(java.util.function.Consumer<Screen.AfterCloseEvent> listener)
Screen.AfterCloseEvent
listener.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe protected void onAfterClose(AfterCloseEvent event) { // handle event here }
listener
- listenerprotected io.jmix.core.common.event.Subscription addAfterDetachListener(java.util.function.Consumer<Screen.AfterDetachEvent> listener)
Screen.AfterDetachEvent
listener.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe protected void onAfterDetach(AfterDetachEvent event) { // handle event here }
listener
- listenerprotected io.jmix.core.common.event.Subscription addUrlParamsChangeListener(java.util.function.Consumer<UrlParamsChangedEvent> listener)
UrlParamsChangedEvent
listener.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe protected void onUrlParamsChanged(UrlParamsChangedEvent event) { // handle event here }
listener
- listenerpublic Screen show()
Screens.show(Screen)
public OperationResult close(CloseAction action)
action
- close action which is propagated to Screen.BeforeCloseEvent
and Screen.AfterCloseEvent
public OperationResult closeWithDefaultAction()
FrameOwner.WINDOW_CLOSE_ACTION
action.public OperationResult close(StandardOutcome outcome)
outcome
.outcome
- StandardOutcome
protected boolean isMultipleOpen()
protected boolean isSameScreen(Screen openedScreen)
openedScreen
- already opened screen