|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.eclipse.gef.commands.AbstractCommand
| Fields inherited from interface org.eclipse.gef.commands.Command |
copyright |
| Constructor Summary | |
AbstractCommand()
|
|
AbstractCommand(String label)
|
|
| Method Summary | |
boolean |
canExecute()
This indicates whether the comamad is valid to execute. |
boolean |
canUndo()
This returns whether the command can be undone. |
Command |
chain(Command command)
This logically chains the given command to this command, by returning a command that represents the composition. |
void |
dispose()
This is called to indicate that the command will never be used again. |
void |
execute()
This will perform the command activity required for the effect. |
Collection |
getAffectedObjects()
This returns the collection of things which this command wishes to present as the objects affected by the command. |
String |
getDebugLabel()
|
String |
getDescription()
This returns a string suitable to help describe the effect of this command. |
String |
getLabel()
This returns a string suitable to represent the label that identifies this command. |
Collection |
getResult()
This returns collection of things which this command wishes to present as it's result. |
void |
redo()
This will again perform the command activity required to redo the effect after undoing the effect. |
void |
setDebugLabel(String label)
|
void |
setDescription(String label)
|
void |
setLabel(String label)
|
void |
undo()
This will perform the command activity required to undo the effects of a preceding execute (or redo). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractCommand()
public AbstractCommand(String label)
| Method Detail |
public Collection getAffectedObjects()
CommandgetAffectedObjects in interface Commandpublic String getDebugLabel()
public String getDescription()
CommandgetDescription in interface Commandpublic String getLabel()
CommandgetLabel in interface Commandpublic final Collection getResult()
CommandgetResult in interface Commandpublic boolean canExecute()
CommandUnexecutableCommand.INSTANCE.canExecute() always returns false.
This canExecute in interface Commandpublic boolean canUndo()
CommandcanUndo in interface Commandpublic Command chain(Command command)
CommandInstead of the following pattern of usage
Command result = x; if (condition) result = result.chain(y);you should consider using a
CompoundCommand
and using CompoundCommand.unwrap() to optimize the result:
CompoundCommand subcommands = new CompoundCommand(); subcommands.append(x); if (condition) subcommands.append(y); Command result = subcommands.unwrap();This gives you more control over how the compound command composes it's result and affected objects.
chain in interface Commandpublic void dispose()
Commanddispose in interface Commandpublic void execute()
Commandexecute in interface Commandpublic void redo()
Commandredo in interface Commandpublic void setDebugLabel(String label)
public void setDescription(String label)
public void setLabel(String label)
public void undo()
Commandundo in interface Command
|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||