|
The Gravy Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object
|
+--OObject
|
+--Command
This class acts as the abstract base class for each
Command (ala
Command design pattern).
Subclasses of Command should define/override:
(1) the constructor to load the do/undo/redo context data
which should set the "valid" attribute to a negative
number if the command cant properly be initiated.
(2) the doit() method which executes the command
(3) the undo() method which "rolls back" the command
(4) the redo() method which "un-rolls-back" the command
(5) canUndo property if this cmd is only meant for mutex
FYI, REDO would be different than DO, for example, in the case
that DO had to do a database search to get a value, but REDO
could simply use that saved value without re-searching for it.
| Constructor Summary | |
Command
()
|
|
| Method Summary | |
String
|
details()
return details of this command for user viewing |
void
|
DOIT()
"DO" this command if in the proper state. |
void
|
doit()
"Do command" logic |
boolean
|
isInvalid()
return true iff this command should not even be started |
void
|
konstructor( <String> optName )
|
void
|
redo()
"command REDO" logic. |
void
|
REDO()
"REDO" this command if in the proper state. |
void
|
syncDoIt()
synchronized this.DOIT() |
void
|
syncReDo()
synchronized this.REDO() |
void
|
syncUnDo()
synchronized this.UNDO() |
String
|
toString()
return THIS formatted as string |
void
|
undo()
"command UNDO" logic |
void
|
UNDO()
"UNDO" this command if in the proper state. |
| Constructor Detail |
Command()
| Method Detail |
String details()
void DOIT()
void doit()
boolean isInvalid()
void konstructor( <String> optName )
optName - optional name of this instance
void redo()
void REDO()
void syncDoIt()
void syncReDo()
void syncUnDo()
String toString()
void undo()
void UNDO()
|
The Gravy Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||