Overview | File | Class | Tree | Index | Help
| The Gravey 2.0 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class MVCCommand

    Object
       |
       +--GrvObject
             |
             +--MVCCommand

Direct Known Subclasses:
  MVCAJAXReplyCmd, EDOHolderCloseWindowIfSavedCmd, EDOHolderSelectCmd, EDOHolderCancelAllChangesCmd, EDOCmd, MVCScalarEditCmd, EDOHolderSaveAllChangesCmd, EDOHolderSelectInitialCmd

class MVCCommand
extends GrvObject

This class acts as the abstract base class for each Command (ala Command design pattern).

     Subclasses of MVCCommand 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.

Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
See:

- konstructor()

Defined in grvMVC.js

Field Summary
`<static> Object` | `NextID`

Constructor Summary
`MVCCommand ()`

Method Summary
`String` | `details()` return details of this command for user viewing
`void` | `doit()` "Do command" logic
`void` | `DOIT()` "DO" this command if in the proper state.
`boolean` | `isInvalid()` return true iff this command should not even be started
`void` | `konstructor( optName, <String> optErrMsg )`
`void` | `redo()` "command REDO" logic.
`void` | `REDO()` "REDO" this command if in the proper state.
`void` | `syncDo( methodName )` synchronized call with global view blocking
`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.

Methods inherited from class GrvObject
`souper, souper_, isInstanceOf`

Field Detail

### NextID

    <static> Object NextID

Constructor Detail

### MVCCommand

    MVCCommand()

Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
See:

- konstructor()

Method Detail

### details

    String details()

return details of this command for user viewing

### doit

    void doit()

"Do command" logic

### DOIT

    void DOIT()

"DO" this command if in the proper state.

### isInvalid

    boolean isInvalid()

return true iff this command should not even be started

### konstructor

    void konstructor( optName, <String> optErrMsg )

Parameters:

`optErrMsg` - if not null then cancel this cmd

`cmdDesc` - general description of this command

### redo

    void redo()

"command REDO" logic. Default is to just call doit()

### REDO

    void REDO()

"REDO" this command if in the proper state.

### syncDo

    void syncDo( methodName )

synchronized call with global view blocking

### syncDoIt

    void syncDoIt()

synchronized this.DOIT()

### syncReDo

    void syncReDo()

synchronized this.REDO()

### syncUnDo

    void syncUnDo()

synchronized this.UNDO()

### toString

    String toString()

return THIS formatted as string

### undo

    void undo()

"command UNDO" logic

### UNDO

    void UNDO()

"UNDO" this command if in the proper state.

Overview | File | Class | Tree | Index | Help
| The Gravey 2.0 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Sun Feb 11 13:28:59 2007