Package com.vaadin.client
Class UILifecycle
java.lang.Object
com.vaadin.client.UILifecycle
Manages the lifecycle of a UI.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEvent triggered when the lifecycle state of a UI is changed.static interfaceA listener for listening to UI lifecycle events.static enumDescribes the state of a UI. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<H extends UILifecycle.StateChangeHandler>
com.google.web.bindery.event.shared.HandlerRegistrationaddHandler(H handler) Adds a state change event handler.getState()Gets the state of the UI.booleanCheck if the state isUILifecycle.UIState.RUNNING.booleanCheck if the state isUILifecycle.UIState.TERMINATED.voidsetState(UILifecycle.UIState state) Sets the state of the UI to the given value.
-
Constructor Details
-
UILifecycle
public UILifecycle()
-
-
Method Details
-
getState
Gets the state of the UI.- Returns:
- the current state of the UI
-
setState
Sets the state of the UI to the given value.Only allows state changes in one direction:
UILifecycle.UIState.INITIALIZING->UILifecycle.UIState.RUNNING->UILifecycle.UIState.TERMINATED.Changing the state fires a
UILifecycle.StateChangeEvent.- Parameters:
state- the new UI state
-
isRunning
public boolean isRunning()Check if the state isUILifecycle.UIState.RUNNING.- Returns:
trueif the status isUILifecycle.UIState.RUNNING,falseotherwise
-
isTerminated
public boolean isTerminated()Check if the state isUILifecycle.UIState.TERMINATED.- Returns:
trueif the status isUILifecycle.UIState.TERMINATED,falseotherwise
-
addHandler
public <H extends UILifecycle.StateChangeHandler> com.google.web.bindery.event.shared.HandlerRegistration addHandler(H handler) Adds a state change event handler.- Type Parameters:
H- the handler type- Parameters:
handler- the handler to add- Returns:
- a handler registration object which can be used to remove the handler
-