|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.CommandProcessor
The IdeCommandProcessor
singleton class is responsible for
managing the execution of the IDE commands and managing the undo stack.
The IdeCommandProcessor
provides methods for creating a new
command, setting and getting the undo stack size, invoking a command
action, and undoing a re-doing an executed command.
In general, all controller implementation should use the IDE command
processor to execute the commands that controller handles. For example,
the Naviagator
controller uses the
IdeCommandProcessor
) to handle its commands.
Command
,
Controller
,
Ide
Method Summary | |
boolean |
canRedo(Context context)
Check if the last undone command can be redone. |
boolean |
canUndo(Context context)
Check if the last command can be undone. |
Command |
createCommand(java.lang.String cmd,
Context context)
Creates and instance of the specified command. |
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)
|
java.lang.String |
getUndoLabel(Context context)
|
int |
getUndoStackSize()
Get the current value of the undo stack size. |
int |
invoke(Command cmd)
Executes the actions associated with a specific command. |
int |
redo()
Redo the last undone command. |
void |
setUndoStackSize(int size)
Set the current value of the undo stack size. |
int |
undo()
Undo the last command. |
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() throws java.lang.Exception
java.lang.Exception
public final int redo() throws java.lang.Exception
java.lang.Exception
public final int getUndoStackSize()
public final void setUndoStackSize(int size)
size
- the size of the undo stack.public final 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 boolean canUndo(Context context)
true
if the last command can be undone.public java.lang.String getUndoLabel(Context context)
public Command getCommand(Context context)
public boolean canRedo(Context context)
true
if the last command can be redone.public java.lang.String getRedoLabel(Context context)
public void flush(java.lang.Object object)
object
.
public void flush(java.lang.Object[] objects)
objects
.
|
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.