All Packages Class Hierarchy This Package Previous Next Index
Interface uhr.core.role.StateCommand
- public interface StateCommand
A StateCommand is a command supported by a StateCommandable..
The properties apply at the current point in time. It is
specifically designed to make a part command context menu as
easy as Duck Soup. :-)
The implementation should set the name and isPropogated in the
constructor, since they are immutable.
-
getName()
- The command name.
-
isAllowable()
- Determines whether the command is allowed now or not.
-
isDefault()
- Determines whether the command is the default command for the
current state.
-
isPropogated()
- Determines whether the command will be "propogated" to child
parts or not.
-
setAllowable(boolean)
- Sets whether the command is allowed now or not, according
to the state transition table.
-
setDefault(boolean)
- Sets whether the command is the default command for the
current state.
getName
public abstract String getName()
- The command name. This never changes.
- Returns:
- the command name.
isPropogated
public abstract boolean isPropogated()
- Determines whether the command will be "propogated" to child
parts or not. This applies only to containers. For example a
Close command would be propogated to all child parts having the
Close command, so that and entire branch can be closed correctly
and in a resuable manner.
- Returns:
- true if propogated, false if not.
setAllowable
public abstract void setAllowable(boolean isAllowable)
- Sets whether the command is allowed now or not, according
to the state transition table. If allowed it may be called now.
This can be used for enabling or disabling this command on a
context menu. The default is false.
- Parameters:
- isAllowable - true if allowable now, false if not.
isAllowable
public abstract boolean isAllowable()
- Determines whether the command is allowed now or not.
- Returns:
- true if allowable now, false if not.
setDefault
public abstract void setDefault(boolean isDefault)
- Sets whether the command is the default command for the
current state. Only one command is the default command at any
one time. This can be used for bolding the default command in
the context menu. The default is false.
- Parameters:
- isDefault - true if is the default command, false if not.
isDefault
public abstract boolean isDefault()
- Determines whether the command is the default command for the
current state.
- Returns:
- true if is the default command, false if not.
All Packages Class Hierarchy This Package Previous Next Index