Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

javax.ide.command
Class CommandProcessor

java.lang.Object
  extended by javax.ide.Service
      extended by javax.ide.command.CommandProcessor

public abstract class CommandProcessor
extends Service

The CommandProcessor is responsible for managing the execution of the IDE commands and maintining the undo stack.

In general, all Controller implementations should use the IDE command processor to execute the commands that controller handles.

IDE service providers must extend this class and provide an implementation of the invoke(Command) method. It is up to the IDE service provider implementation to decide whether it supports undo/redo on a per document, or global basis. If the undo support provided is document based, implementors of this class must make sure that after a command is executed, the command processor checks the Command.getAffectedDocuments() return value to detemine if other documents were affected by the current command execution.

If the Command.getAffectedDocuments() returns one or more items, then the undo stacks of the affected documents must be flushed in order to maintain document consistency.

See Also:
Command

Constructor Summary
CommandProcessor()
           
 
Method Summary
static CommandProcessor getCommandProcessor()
          Get the command processor implementation for this IDE.
abstract  int invoke(Command cmd)
          Executes the actions associated with a specific command.
 
Methods inherited from class javax.ide.Service
getService, initialize, resetAllServices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandProcessor

public CommandProcessor()
Method Detail

invoke

public abstract int invoke(Command cmd)
                    throws java.lang.Exception
Executes the actions associated with a specific command. A Controller uses this method to tell the CommandProcessor that a command should be executed.

Parameters:
cmd - the command to execute.
Returns:
Whether the specified executed Command.OK or Command.CANCEL.
Throws:
java.lang.Exception - if an error occurs processing the command.

getCommandProcessor

public static CommandProcessor getCommandProcessor()
Get the command processor implementation for this IDE.

Returns:
the command processor implementation.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.