public class ViewStateMachineImpl extends java.lang.Object implements ViewStateMachine
ViewStateMachine.State, ViewStateMachine.TransitionState
Modifier and Type | Field and Description |
---|---|
private com.google.gwt.user.client.ui.HasEnabled[] |
widgets
The widgets which enabled states are controlled by this state machine
|
Constructor and Description |
---|
ViewStateMachineImpl(com.google.gwt.user.client.ui.HasEnabled[] widgets)
Creates the instance of the view state machine.
|
ViewStateMachineImpl(com.google.inject.Provider<com.google.gwt.user.client.ui.HasEnabled[]> view)
Creates the instance of the view state machine.
|
Modifier and Type | Method and Description |
---|---|
ViewStateMachine.State |
apply(ViewStateMachine.TransitionState transition)
It changes the current state according to the provided transition state and returns
the previous state.
|
void |
init(ViewStateMachine.State current)
It initializes the current state.
|
void |
stateMachine(boolean[] newState)
Sets the state of the components according to the encoded array.
|
void |
stateMachine(boolean[] which,
boolean[] newState)
Selectively sets the state of the components according to the encoded
array.
|
boolean[] |
stateMachineModal(boolean[] which,
boolean[] newState)
Selectively sets the state of the components according to the encoded
array and returns the array of the saved current state.
|
private final com.google.gwt.user.client.ui.HasEnabled[] widgets
public ViewStateMachineImpl(com.google.inject.Provider<com.google.gwt.user.client.ui.HasEnabled[]> view)
view
- The widgets providerpublic ViewStateMachineImpl(com.google.gwt.user.client.ui.HasEnabled[] widgets)
widgets
- The widgets under controlpublic void stateMachine(boolean[] newState)
stateMachine
in interface ViewStateMachine
newState
- array of boolean states, one per component, in a predefined
order. true
means enabled.public void stateMachine(boolean[] which, boolean[] newState)
stateMachine
in interface ViewStateMachine
which
- array of booleans acting as a mask,one boolean per component.
true
means component changes state as specified
in newState array.newState
- array of boolean states, one per component, in a predefined
order. true
means enabled.public boolean[] stateMachineModal(boolean[] which, boolean[] newState)
stateMachineModal
in interface ViewStateMachine
which
- array of booleans acting as a mask,one boolean per component.
true
means component changes state as specified
in newState array.newState
- array of boolean states, one per component, in a predefined
order. true
means enabled.public void init(ViewStateMachine.State current)
init
in interface ViewStateMachine
current
- The current initial statepublic ViewStateMachine.State apply(ViewStateMachine.TransitionState transition)
apply
in interface ViewStateMachine
transition
- The provided transition state