public class UILifecycle extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
UILifecycle.StateChangeEvent
Event triggered when the lifecycle state of a UI is changed.
|
static interface |
UILifecycle.StateChangeHandler
A listener for listening to UI lifecycle events.
|
static class |
UILifecycle.UIState
Describes the state of a UI.
|
| Constructor and Description |
|---|
UILifecycle() |
| Modifier and Type | Method and Description |
|---|---|
<H extends UILifecycle.StateChangeHandler> |
addHandler(H handler)
Adds a state change event handler.
|
UILifecycle.UIState |
getState()
Gets the state of the UI.
|
boolean |
isRunning()
Check if the state is
UILifecycle.UIState.RUNNING. |
boolean |
isTerminated()
Check if the state is
UILifecycle.UIState.TERMINATED. |
void |
setState(UILifecycle.UIState state)
Sets the state of the UI to the given value.
|
public UILifecycle.UIState getState()
public void setState(UILifecycle.UIState state)
Only allows state changes in one direction: UILifecycle.UIState.INITIALIZING
-> UILifecycle.UIState.RUNNING -> UILifecycle.UIState.TERMINATED.
Changing the state fires a UILifecycle.StateChangeEvent.
state - the new UI statepublic boolean isRunning()
UILifecycle.UIState.RUNNING.true if the status is UILifecycle.UIState.RUNNING,
false otherwisepublic boolean isTerminated()
UILifecycle.UIState.TERMINATED.true if the status is UILifecycle.UIState.TERMINATED,
false otherwisepublic <H extends UILifecycle.StateChangeHandler> com.google.web.bindery.event.shared.HandlerRegistration addHandler(H handler)
H - the handler typehandler - the handler to addCopyright © 2000–2019 Vaadin Ltd. All rights reserved.