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

E13403-04

oracle.jdeveloper.audit.transform
Class UndoableEditCommand

java.lang.Object
  extended by oracle.ide.controller.Command
      extended by oracle.jdeveloper.audit.transform.UndoableEditCommand

public class UndoableEditCommand
extends Command

An Ide command which wraps an undoable edit. The initial call to doit() is ignored (except for bookkeeping), since the edits were already done when the UndoableEdit was created.


Field Summary
 
Fields inherited from class oracle.ide.controller.Command
CANCEL, context, EXECUTING, MULTI_NODE, NO_CHANGE, NO_UNDO, NORMAL, OK, type
 
Constructor Summary
UndoableEditCommand(java.lang.String name, Context context)
          Creates an undoable edit wrapper command that manages initial selection.
UndoableEditCommand(java.lang.String name, Context context, boolean initialSelection)
          Creates an undoable edit wrapper command.
UndoableEditCommand(java.lang.String name, TextNode node, Project project, Workspace workspace)
          Creates an undoable edit wrapper command without an IDE context that manages the initial selection.
UndoableEditCommand(java.lang.String name, TextNode node, Project project, Workspace workspace, boolean initialSelection)
          Creates an undoable edit wrapper command without an IDE context.
 
Method Summary
 void addEdit(javax.swing.undo.UndoableEdit edit)
           
 void addEdits(java.util.Collection<javax.swing.undo.UndoableEdit> edits)
           
 int doit()
          Executes the actions associated with a specific command.
 boolean hasEdits()
           
 void setSelection(int offset, int length)
           
 void setSelection(java.net.URL url, int offset, int length)
           
 int undo()
          Called by the CommandProcessor to undo a command.
 
Methods inherited from class oracle.ide.controller.Command
getAffectedNodes, getContext, getData, getId, getName, getType, isGlobal, setContext, setData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndoableEditCommand

public UndoableEditCommand(java.lang.String name,
                           Context context)
Creates an undoable edit wrapper command that manages initial selection.

Parameters:
name - The presentation name of this command.
context - The ide context for this command.

UndoableEditCommand

public UndoableEditCommand(java.lang.String name,
                           TextNode node,
                           Project project,
                           Workspace workspace)
Creates an undoable edit wrapper command without an IDE context that manages the initial selection.

Parameters:
name - The presentation name of this command.
node - The node to which this command applies.
project - The project context for this command.
workspace - The workspace context for this command.

UndoableEditCommand

public UndoableEditCommand(java.lang.String name,
                           Context context,
                           boolean initialSelection)
Creates an undoable edit wrapper command.

initialSelection will typically only be false for commands after the first in a sequence of commands.

Parameters:
name - The presentation name of this command.
context - The ide context for this command.
initialSelection - Whether command should manage initial selection.

UndoableEditCommand

public UndoableEditCommand(java.lang.String name,
                           TextNode node,
                           Project project,
                           Workspace workspace,
                           boolean initialSelection)
Creates an undoable edit wrapper command without an IDE context.

Parameters:
name - The presentation name of this command.
node - The node to which this command applies.
project - The project context for this command.
workspace - The workspace context for this command.
initialSelection - Whether command should manage initial selection.
Method Detail

addEdit

public void addEdit(javax.swing.undo.UndoableEdit edit)

addEdits

public void addEdits(java.util.Collection<javax.swing.undo.UndoableEdit> edits)

hasEdits

public boolean hasEdits()

setSelection

public void setSelection(java.net.URL url,
                         int offset,
                         int length)

setSelection

public void setSelection(int offset,
                         int length)

doit

public int doit()
         throws java.lang.Exception
Description copied from class: Command
Executes the actions associated with a specific command. When a command executes successfully, implementations should return OK, otherwise, return CANCEL or any other non-zero value.

Specified by:
doit in class Command
Throws:
java.lang.Exception

undo

public int undo()
         throws java.lang.Exception
Description copied from class: Command
Called by the CommandProcessor to undo a command. Does nothing in this implemenation. Commands that can be undone should provide the behavior here to undo whatever actions were carried out when the doit method was called When a command executes successfully, implementations should return OK, otherwise, return CANCEL or any other non-zero value.

Overrides:
undo in class Command
Throws:
java.lang.Exception

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

E13403-04

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