Package io.guise.framework.controller
Class SequenceTaskController
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- io.guise.framework.controller.SequenceTaskController
-
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
public class SequenceTaskController extends com.globalmentor.beans.BoundPropertyObject
Abstract base class for managing progression of a sequence.- Author:
- Garret Wilson
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
CONFIRM_DELAY
The length of time, in milliseconds, to wait for confirmation when applicable.static java.lang.String
CONFIRM_NAVIGATION_PROPERTY
The bound property of whether navigation should be confirmed, of typeBoolean
.
-
Constructor Summary
Constructors Constructor Description SequenceTaskController(com.globalmentor.model.SequenceTask task)
Sequence task constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProxyActionPrototype
getAdvanceActionPrototype()
ActionPrototype
getConfirmActionPrototype()
ActionPrototype
getConfirmingActionPrototype()
ActionPrototype
getFinishActionPrototype()
ActionPrototype
getNextActionPrototype()
ActionPrototype
getPreviousActionPrototype()
ActionPrototype
getStartActionPrototype()
com.globalmentor.model.SequenceTask
getTask()
boolean
isConfirmNavigation()
void
setConfirmingActionPrototype(ActionPrototype newConfirmingActionPrototype)
Starts the confirmation timer and, if confirmation is received within the required amount of time, the given action is taken.void
setConfirmNavigation(boolean newConfirmNavigation)
Sets whether each navigation must be confirmed.protected void
update()
Updates the condition of the controller based upon the state.-
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Field Detail
-
CONFIRM_NAVIGATION_PROPERTY
public static final java.lang.String CONFIRM_NAVIGATION_PROPERTY
The bound property of whether navigation should be confirmed, of typeBoolean
.
-
CONFIRM_DELAY
protected static final int CONFIRM_DELAY
The length of time, in milliseconds, to wait for confirmation when applicable.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SequenceTaskController
public SequenceTaskController(com.globalmentor.model.SequenceTask task)
Sequence task constructor. This controller listens to bound properties of the task.- Parameters:
task
- The sequence task being controlled.- Throws:
java.lang.NullPointerException
- if the given task isnull
.
-
-
Method Detail
-
getStartActionPrototype
public ActionPrototype getStartActionPrototype()
- Returns:
- The action prototype for starting the sequence.
-
getPreviousActionPrototype
public ActionPrototype getPreviousActionPrototype()
- Returns:
- The action prototype for going to the previous step.
-
getNextActionPrototype
public ActionPrototype getNextActionPrototype()
- Returns:
- The action prototype for going to the next step.
-
getFinishActionPrototype
public ActionPrototype getFinishActionPrototype()
- Returns:
- The action prototype for finishing the sequence.
-
getConfirmActionPrototype
public ActionPrototype getConfirmActionPrototype()
- Returns:
- The action prototype for confirming an action.
-
getAdvanceActionPrototype
public ProxyActionPrototype getAdvanceActionPrototype()
- Returns:
- The action prototype for advancing; serves as a proxy for the start, next, and finish actions, depending on the state of the sequence.
- See Also:
getStartActionPrototype()
,getNextActionPrototype()
,getFinishActionPrototype()
-
getConfirmingActionPrototype
public ActionPrototype getConfirmingActionPrototype()
- Returns:
- The action prototype currently being confirmed and which, if confirmed, will be performed.
-
setConfirmingActionPrototype
public void setConfirmingActionPrototype(ActionPrototype newConfirmingActionPrototype)
Starts the confirmation timer and, if confirmation is received within the required amount of time, the given action is taken. Alternatively, if no action is given, the confirmation process is stopped. If the action is already waiting for confirmation, no action is taken.- Parameters:
newConfirmingActionPrototype
- The action to perform if confirmation is received, ornull
if no action should be pending confirmation.
-
isConfirmNavigation
public boolean isConfirmNavigation()
- Returns:
true
if each navigation should be confirmed.
-
setConfirmNavigation
public void setConfirmNavigation(boolean newConfirmNavigation)
Sets whether each navigation must be confirmed. This is a bound property of typeBoolean
.- Parameters:
newConfirmNavigation
-true
if each navigation must be confirmed.- See Also:
CONFIRM_NAVIGATION_PROPERTY
-
getTask
public com.globalmentor.model.SequenceTask getTask()
- Returns:
- The sequence task being controlled.
-
update
protected void update()
Updates the condition of the controller based upon the state. This method is a convenience method for complex components that would like to perform wholesale updates any prototypes, enabled/disabled status, proxied actions, etc. This implementation updates the states of action prototypes.
-
-