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 |
---|---|
com.haulmont.bali.events.Subscription |
addAfterCloseListener(java.util.function.Consumer<Screen.AfterCloseEvent> listener)
Adds
Screen.AfterCloseEvent listener. |
protected com.haulmont.bali.events.Subscription |
addAfterDetachListener(java.util.function.Consumer<Screen.AfterDetachEvent> listener)
Adds
Screen.AfterDetachEvent listener. |
protected com.haulmont.bali.events.Subscription |
addAfterInitListener(java.util.function.Consumer<Screen.AfterInitEvent> listener)
Adds
Screen.AfterInitEvent listener. |
com.haulmont.bali.events.Subscription |
addAfterShowListener(java.util.function.Consumer<Screen.AfterShowEvent> listener)
Adds
Screen.AfterShowEvent listener. |
protected com.haulmont.bali.events.Subscription |
addBeforeCloseListener(java.util.function.Consumer<Screen.BeforeCloseEvent> listener)
Adds
Screen.BeforeCloseEvent listener. |
protected com.haulmont.bali.events.Subscription |
addBeforeShowListener(java.util.function.Consumer<Screen.BeforeShowEvent> listener)
Adds
Screen.BeforeShowEvent listener. |
protected com.haulmont.bali.events.Subscription |
addInitListener(java.util.function.Consumer<Screen.InitEvent> listener)
Adds
Screen.InitEvent listener. |
protected com.haulmont.bali.events.Subscription |
addUrlParamsChangeListener(java.util.function.Consumer<UrlParamsChangedEvent> listener)
Adds
UrlParamsChangedEvent listener. |
protected void |
applySettings(Settings settings)
Applies screen settings to UI components.
|
OperationResult |
close(CloseAction action)
Requests closing of the screen caused by the given action.
|
OperationResult |
closeWithDefaultAction()
Closes the screen with
FrameOwner.WINDOW_CLOSE_ACTION action. |
protected void |
deleteSettings()
Deletes screen settings associated with this screen.
|
protected <E> void |
fireEvent(java.lang.Class<E> eventType,
E event) |
protected BeanLocator |
getBeanLocator() |
protected com.haulmont.bali.events.EventHub |
getEventHub() |
protected java.util.Map<java.lang.Class<?>,java.lang.Object> |
getExtensions() |
java.lang.String |
getId() |
protected ScreenData |
getScreenData() |
protected Settings |
getSettings() |
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 boolean |
isSaveScreenHistoryOnClose(CloseAction action) |
protected boolean |
isSaveSettingsOnClose(CloseAction action) |
protected void |
saveSettings()
Saves screen settings.
|
protected void |
setBeanLocator(BeanLocator beanLocator) |
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 BeanLocator getBeanLocator()
@Inject protected void setBeanLocator(BeanLocator beanLocator)
protected com.haulmont.bali.events.EventHub getEventHub()
protected java.util.Map<java.lang.Class<?>,java.lang.Object> getExtensions()
protected void setExtensions(java.util.Map<java.lang.Class<?>,java.lang.Object> extensions)
public java.lang.String getId()
protected void setId(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)
protected java.util.List<org.springframework.context.ApplicationListener> getUiEventListeners()
protected void setUiEventListeners(java.util.List<org.springframework.context.ApplicationListener> listeners)
protected com.haulmont.bali.events.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 com.haulmont.bali.events.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 com.haulmont.bali.events.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 com.haulmont.bali.events.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 com.haulmont.bali.events.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 com.haulmont.bali.events.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 com.haulmont.bali.events.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 com.haulmont.bali.events.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.protected boolean isSaveScreenHistoryOnClose(CloseAction action)
action
- close actionprotected boolean isSaveSettingsOnClose(CloseAction action)
action
- close actionprotected boolean isMultipleOpen()
protected boolean isSameScreen(Screen openedScreen)
openedScreen
- already opened screenprotected Settings getSettings()
protected void saveSettings()
protected void applySettings(Settings settings)
settings
- screen settingsprotected void deleteSettings()