|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ide.controller.CommandProcessor
public final class CommandProcessor
The CommandProcessor
singleton class is responsible for managing the execution of the IDE commands and managing the undo stack.
In general, all controller implementations should use the IDE command processor to execute the commands that controller handles. For example, the Navigator
controller uses the IdeCommandProcessor
) to handle its commands. Since Command implementations may involve Swing interaction, all operations upon CommandProcessor must be made using the event thread.
Command
, Controller
, Ide
Method Summary | |
---|---|
void |
abortTrans() Abort a multi Command batch operation, calling undo on any Command instances already invoked as part of the current batch operation. |
void |
beginTrans(java.lang.String label) Begin a multi Command batch operation. |
boolean |
canRedo(Context context) Check if the last Command associated with the Node of the given Context can be redone. |
boolean |
canUndo(Context context) Check if the last Command associated with the Node of the given Context can be undone. |
static Command |
createCommand(java.lang.String cmd, Context context) Creates and instance of the specified command. |
static Command |
createCommandFromMeta(MetaClass commandMeta, Context context) |
void |
endTrans() Commit a multi Command batch operation. |
void |
flush(java.lang.Object object) Flush the undo stack associated with the specified object . |
void |
flush(java.lang.Object[] objects) Flush the undo stack of all the specified objects . |
Command |
getCommand(Context context) |
static CommandProcessor |
getInstance() This is a singleton class. |
java.lang.String |
getRedoLabel(Context context) Get the name of the last redoable Command associated with the Node of the given Context. |
java.lang.String |
getUndoLabel(Context context) Get the name of the last undoable Command associated with the Node of the given Context. |
int |
invoke(Command cmd) Executes the actions associated with a specific command. |
boolean |
isTransactionActive() |
int |
redo(Context context) Redo the last Command associated with the Node of the given Context. |
int |
undo(Context context) Undo the last Command associated with the Node of the given Context. |
void |
update(java.lang.Object observed, UpdateMessage change) Respond to applicable UpdateMessages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static CommandProcessor getInstance()
getInstance
method creates the instance if it has not yet been created.CommandProcessor
public final int invoke(Command cmd) throws java.lang.Exception
Controller
uses this method to tell the CommandProcessor
that a command should be executed.cmd
- the command to execute.java.lang.Exception
public final int undo(Context context) throws java.lang.Exception
context
- a Context describing a Node, else null.java.lang.Exception
public final int redo(Context context) throws java.lang.Exception
context
- a Context describing a Node, else null.java.lang.Exception
public boolean canUndo(Context context)
context
- a Context describing a Node, else null.true
if the last applicable Command can be undone.public java.lang.String getUndoLabel(Context context)
context
- a Context describing a Node, else null.public Command getCommand(Context context)
public boolean canRedo(Context context)
context
- a Context describing a Node, else null.true
if the last applicable Command can be redone.public java.lang.String getRedoLabel(Context context)
context
- a Context describing a Node, else null.public void flush(java.lang.Object object)
object
.public void flush(java.lang.Object[] objects)
objects
.public void beginTrans(java.lang.String label)
label
- summary label for use in undo/redo menu item.public void endTrans()
public void abortTrans()
public boolean isTransactionActive()
public void update(java.lang.Object observed, UpdateMessage change)
update
in interface Observer
observed
- the subject whose state has changed.change
- what has changed.public static Command createCommand(java.lang.String cmd, Context context)
data
specified is maintained by the newly created command. Returns null if command instance cannot be created.cmd
- the class name of the command, i.e., oracle.jdeveloper.cmd.CutCommandcontext
- the context to be associated with the command. This object is stored within the command an can be accessed later.public static Command createCommandFromMeta(MetaClass commandMeta, Context context)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |