Package com.vaadin.client
Class UILifecycle
- java.lang.Object
-
- com.vaadin.client.UILifecycle
-
public class UILifecycle extends Object
Manages the lifecycle of a UI.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUILifecycle.StateChangeEventEvent triggered when the lifecycle state of a UI is changed.static interfaceUILifecycle.StateChangeHandlerA listener for listening to UI lifecycle events.static classUILifecycle.UIStateDescribes the state of a UI.
-
Constructor Summary
Constructors Constructor Description UILifecycle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <H extends UILifecycle.StateChangeHandler>
com.google.web.bindery.event.shared.HandlerRegistrationaddHandler(H handler)Adds a state change event handler.UILifecycle.UIStategetState()Gets the state of the UI.booleanisRunning()Check if the state isUILifecycle.UIState.RUNNING.booleanisTerminated()Check if the state isUILifecycle.UIState.TERMINATED.voidsetState(UILifecycle.UIState state)Sets the state of the UI to the given value.
-
-
-
Method Detail
-
getState
public UILifecycle.UIState getState()
Gets the state of the UI.- Returns:
- the current state of the UI
-
setState
public void setState(UILifecycle.UIState state)
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
-
-