|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.ide.addin.AbstractCommand
The AbstractCommand abstract class implements the
Command interface. IDE commands should extend this class when
implementing new commands.
This class implements all Command methods with the exception
of the doit. Concrete subclasses implement the
doit method with necessary behavior to carry out a command.
oracle.ide.ide.CommandProcessor,
oracle.ide.Command,
oracle.ide.ide.IdeCommandProcessor| Field Summary | |
protected int |
cmdId
|
protected Context |
context
|
protected java.lang.String |
name
Stores the name of the command. |
protected int |
type
Keeps the command type. |
| Fields inherited from interface oracle.ide.addin.Command |
CANCEL, EXECUTING, NO_CHANGE, NO_UNDO, NORMAL, OK |
| Constructor Summary | |
protected |
AbstractCommand(int cmdId)
|
protected |
AbstractCommand(int cmdId,
int type)
Constructor. |
protected |
AbstractCommand(int cmdId,
int type,
java.lang.String name)
Constructor. |
| Method Summary | |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface oracle.ide.addin.Command |
doit |
| Field Detail |
protected int cmdId
protected int type
protected Context context
protected java.lang.String name
| Constructor Detail |
protected AbstractCommand(int cmdId,
int type)
protected AbstractCommand(int cmdId)
protected AbstractCommand(int cmdId,
int type,
java.lang.String name)
name - the command name. This name will be displayed along side
the Undo and Redo menu itemstype - the command type.| Method Detail |
public int undo()
throws java.lang.Exception
doit method was called
When a command executes successfully, implementations should
return OK, otherwise, return CANCEL or any other non-zero value.
undo in interface Commandjava.lang.Exceptionpublic java.lang.String getName()
getName in interface Commandpublic int getId()
getId in interface Commandpublic int getType()
getType in interface Commandpublic void setData(java.lang.Object data)
setData in interface Commandpublic java.lang.Object getData()
getData in interface Commandpublic void setContext(Context context)
setContext in interface Commandpublic Context getContext()
getContext in interface Commandpublic Document[] getAffectedDocuments()
Command
getAffectedDocuments in interface Command
|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©1997, 2003, Oracle. All rights reserved.