|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Command
interface defines the interface of all command
objects. This interface consists of a procedure, doit
, to
execute a command. Concrete Command subclasses implement the necessary
behavior to carry out a specific command.
This interface also provides additional methods necessary to implement
the undo service provided by the CommandProcessor
. For the
undo mechanism it is necessary to distinguish three types of commands:
NO_CHANGE
A command that require no undo.
NORMAL
A command that can be undone.
NO_UNDO
A command that cannot be undone, and which
prevents the undo of previously performed
normal commands.
CommandProcessor
,
oracle.ide.IdeCommand
,
oracle.ide.IdeCommandProcessor
Field Summary | |
static int |
CANCEL
Command execution CANCEL status |
static int |
EXECUTING
Command execution EXECUTING status. |
static int |
NO_CHANGE
Indicates a command that requires no undo. |
static int |
NO_UNDO
Indicates a command that cannot be undone, and which prevents the undo of previously performed normal commands. |
static int |
NORMAL
Indicates a command that can be undone. |
static int |
OK
Command execution OK status |
Method Summary | |
int |
doit()
Executes the actions associated with a specific command. |
Document[] |
getAffectedDocuments()
For commands of the NORMAL and NO_UNDO this method should return an array of documents affected by the execution of this command. |
Context |
getContext()
Gets the ide current context |
java.lang.Object |
getData()
Gets the stored command specific data |
int |
getId()
Gets the command identifier |
java.lang.String |
getName()
Gets the name of the command to display as the action to undo |
int |
getType()
Gets the command type |
void |
setContext(Context context)
Sets context associated with command |
void |
setData(java.lang.Object data)
Sets command specific data |
int |
undo()
Called by the CommandProcessor to undo a command When a command executes successfully, implementations should return OK, otherwise, return CANCEL or any other non-zero value. |
Field Detail |
public static final int NORMAL
public static final int NO_CHANGE
public static final int NO_UNDO
public static final int OK
public static final int CANCEL
public static final int EXECUTING
Method Detail |
public int doit() throws java.lang.Exception
java.lang.Exception
public int undo() throws java.lang.Exception
java.lang.Exception
public java.lang.String getName()
public int getId()
public int getType()
public void setData(java.lang.Object data)
public java.lang.Object getData()
public void setContext(Context context)
public Context getContext()
public Document[] getAffectedDocuments()
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.