|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.bs.mdi.Command
Base class for all commands which can be triggered by users
| Constructor Summary | |
protected |
Command()
Creates a new command. |
| Method Summary | |
void |
addTrigger(CommandTrigger trigger)
Associates the given command trigger with this command. |
int |
countTriggers()
Counts the number of associated command triggers. |
protected abstract void |
doExecute()
Executes this command. |
void |
execute(CommandTrigger source)
Executes this command and notifies all CommandTriggerGroups. |
abstract String |
getDescription()
Gets the description of this command, e.g. |
String |
getLocalizedDescription()
Gets the localized description of this command. |
String |
getLocalizedName()
Gets the localized name of this command. |
abstract String |
getName()
Gets the name of this command, e.g. |
protected List |
getTriggers()
Gets a list of all triggers associated with this command. |
boolean |
isAvailable()
Indicates whether this command is available or not. |
abstract void |
processMessage(Object source,
int type,
Object argument)
Processes messages. |
void |
removeAllTriggers()
Removes all associations between command triggers and this command. |
void |
removeTrigger(CommandTrigger trigger)
Removes the association between the given command trigger and this command. |
void |
setAvailable(boolean available)
Sets the available status of this command. |
void |
updateTriggers()
Calls CommandTrigger.commandUpdated() on every associated trigger. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected Command()
| Method Detail |
public void execute(CommandTrigger source)
protected abstract void doExecute()
public void setAvailable(boolean available)
available - true if this command should be available, false otherwisepublic boolean isAvailable()
public abstract void processMessage(Object source,
int type,
Object argument)
setAvailable(boolean).
See: MessageProcessor.processMessage(Object, int, Object)
processMessage in interface MessageProcessorsource - the source where this message originated fromtype - the message typeargument - an optional argumentpublic abstract String getName()
public String getLocalizedName()
public abstract String getDescription()
public String getLocalizedDescription()
public void addTrigger(CommandTrigger trigger)
trigger - the command triggerpublic void removeTrigger(CommandTrigger trigger)
trigger - the command triggerpublic void removeAllTriggers()
public int countTriggers()
protected List getTriggers()
public void updateTriggers()
CommandTrigger.commandUpdated() on every associated trigger.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||