javax.swing.undo
Class CompoundEdit

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.undo.AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit 
      extended by javax.swing.undo.CompoundEdit
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Direct Known Subclasses:
AbstractDocument.DefaultDocumentEvent sample code for javax.swing.text.AbstractDocument.DefaultDocumentEvent definition code for javax.swing.text.AbstractDocument.DefaultDocumentEvent , UndoManager sample code for javax.swing.undo.UndoManager definition code for javax.swing.undo.UndoManager

public class CompoundEdit
extends AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit

A concrete subclass of AbstractUndoableEdit, used to assemble little UndoableEdits into great big ones.

See Also:
Serialized Form

Field Summary
protected  Vector sample code for java.util.Vector definition code for java.util.Vector <UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit > edits sample code for javax.swing.undo.CompoundEdit.edits definition code for javax.swing.undo.CompoundEdit.edits
          The collection of UndoableEdits undone/redone en masse by this CompoundEdit.
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
RedoName sample code for javax.swing.undo.AbstractUndoableEdit.RedoName definition code for javax.swing.undo.AbstractUndoableEdit.RedoName , UndoName sample code for javax.swing.undo.AbstractUndoableEdit.UndoName definition code for javax.swing.undo.AbstractUndoableEdit.UndoName
 
Constructor Summary
CompoundEdit sample code for javax.swing.undo.CompoundEdit.CompoundEdit() definition code for javax.swing.undo.CompoundEdit.CompoundEdit() ()
           
 
Method Summary
 boolean addEdit sample code for javax.swing.undo.CompoundEdit.addEdit(javax.swing.undo.UndoableEdit) definition code for javax.swing.undo.CompoundEdit.addEdit(javax.swing.undo.UndoableEdit) (UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit  anEdit)
          If this edit is inProgress, accepts anEdit and returns true.
 boolean canRedo sample code for javax.swing.undo.CompoundEdit.canRedo() definition code for javax.swing.undo.CompoundEdit.canRedo() ()
          Returns false if isInProgress or if super returns false.
 boolean canUndo sample code for javax.swing.undo.CompoundEdit.canUndo() definition code for javax.swing.undo.CompoundEdit.canUndo() ()
          Returns false if isInProgress or if super returns false.
 void die sample code for javax.swing.undo.CompoundEdit.die() definition code for javax.swing.undo.CompoundEdit.die() ()
          Sends die to each subedit, in the reverse of the order that they were added.
 void end sample code for javax.swing.undo.CompoundEdit.end() definition code for javax.swing.undo.CompoundEdit.end() ()
          Sets inProgress to false.
 String sample code for java.lang.String definition code for java.lang.String getPresentationName sample code for javax.swing.undo.CompoundEdit.getPresentationName() definition code for javax.swing.undo.CompoundEdit.getPresentationName() ()
          Returns getPresentationName from the last UndoableEdit added to edits.
 String sample code for java.lang.String definition code for java.lang.String getRedoPresentationName sample code for javax.swing.undo.CompoundEdit.getRedoPresentationName() definition code for javax.swing.undo.CompoundEdit.getRedoPresentationName() ()
          Returns getRedoPresentationName from the last UndoableEdit added to edits.
 String sample code for java.lang.String definition code for java.lang.String getUndoPresentationName sample code for javax.swing.undo.CompoundEdit.getUndoPresentationName() definition code for javax.swing.undo.CompoundEdit.getUndoPresentationName() ()
          Returns getUndoPresentationName from the last UndoableEdit added to edits.
 boolean isInProgress sample code for javax.swing.undo.CompoundEdit.isInProgress() definition code for javax.swing.undo.CompoundEdit.isInProgress() ()
          Returns true if this edit is in progress--that is, it has not received end.
 boolean isSignificant sample code for javax.swing.undo.CompoundEdit.isSignificant() definition code for javax.swing.undo.CompoundEdit.isSignificant() ()
          Returns true if any of the UndoableEdits in edits do.
protected  UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit lastEdit sample code for javax.swing.undo.CompoundEdit.lastEdit() definition code for javax.swing.undo.CompoundEdit.lastEdit() ()
          Returns the last UndoableEdit in edits, or null if edits is empty.
 void redo sample code for javax.swing.undo.CompoundEdit.redo() definition code for javax.swing.undo.CompoundEdit.redo() ()
          Sends redo to all contained UndoableEdits in the order in which they were added.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.swing.undo.CompoundEdit.toString() definition code for javax.swing.undo.CompoundEdit.toString() ()
          Returns a string that displays and identifies this object's properties.
 void undo sample code for javax.swing.undo.CompoundEdit.undo() definition code for javax.swing.undo.CompoundEdit.undo() ()
          Sends undo to all contained UndoableEdits in the reverse of the order in which they were added.
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
replaceEdit sample code for javax.swing.undo.AbstractUndoableEdit.replaceEdit(javax.swing.undo.UndoableEdit) definition code for javax.swing.undo.AbstractUndoableEdit.replaceEdit(javax.swing.undo.UndoableEdit)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

edits sample code for javax.swing.undo.CompoundEdit.edits

protected Vector sample code for java.util.Vector definition code for java.util.Vector <UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit > edits
The collection of UndoableEdits undone/redone en masse by this CompoundEdit.

Constructor Detail

CompoundEdit sample code for javax.swing.undo.CompoundEdit() definition code for javax.swing.undo.CompoundEdit()

public CompoundEdit()
Method Detail

undo sample code for javax.swing.undo.CompoundEdit.undo() definition code for javax.swing.undo.CompoundEdit.undo()

public void undo()
          throws CannotUndoException sample code for javax.swing.undo.CannotUndoException definition code for javax.swing.undo.CannotUndoException 
Sends undo to all contained UndoableEdits in the reverse of the order in which they were added.

Specified by:
undo sample code for javax.swing.undo.UndoableEdit.undo() definition code for javax.swing.undo.UndoableEdit.undo() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
undo sample code for javax.swing.undo.AbstractUndoableEdit.undo() definition code for javax.swing.undo.AbstractUndoableEdit.undo() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Throws:
CannotUndoException sample code for javax.swing.undo.CannotUndoException definition code for javax.swing.undo.CannotUndoException - if canUndo returns false
See Also:
AbstractUndoableEdit.canUndo() sample code for javax.swing.undo.AbstractUndoableEdit.canUndo() definition code for javax.swing.undo.AbstractUndoableEdit.canUndo()

redo sample code for javax.swing.undo.CompoundEdit.redo() definition code for javax.swing.undo.CompoundEdit.redo()

public void redo()
          throws CannotRedoException sample code for javax.swing.undo.CannotRedoException definition code for javax.swing.undo.CannotRedoException 
Sends redo to all contained UndoableEdits in the order in which they were added.

Specified by:
redo sample code for javax.swing.undo.UndoableEdit.redo() definition code for javax.swing.undo.UndoableEdit.redo() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
redo sample code for javax.swing.undo.AbstractUndoableEdit.redo() definition code for javax.swing.undo.AbstractUndoableEdit.redo() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Throws:
CannotRedoException sample code for javax.swing.undo.CannotRedoException definition code for javax.swing.undo.CannotRedoException - if canRedo returns false
See Also:
AbstractUndoableEdit.canRedo() sample code for javax.swing.undo.AbstractUndoableEdit.canRedo() definition code for javax.swing.undo.AbstractUndoableEdit.canRedo()

lastEdit sample code for javax.swing.undo.CompoundEdit.lastEdit() definition code for javax.swing.undo.CompoundEdit.lastEdit()

protected UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit  lastEdit()
Returns the last UndoableEdit in edits, or null if edits is empty.


die sample code for javax.swing.undo.CompoundEdit.die() definition code for javax.swing.undo.CompoundEdit.die()

public void die()
Sends die to each subedit, in the reverse of the order that they were added.

Specified by:
die sample code for javax.swing.undo.UndoableEdit.die() definition code for javax.swing.undo.UndoableEdit.die() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
die sample code for javax.swing.undo.AbstractUndoableEdit.die() definition code for javax.swing.undo.AbstractUndoableEdit.die() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
See Also:
die() sample code for javax.swing.undo.CompoundEdit.die() definition code for javax.swing.undo.CompoundEdit.die()

addEdit sample code for javax.swing.undo.CompoundEdit.addEdit(javax.swing.undo.UndoableEdit) definition code for javax.swing.undo.CompoundEdit.addEdit(javax.swing.undo.UndoableEdit)

public boolean addEdit(UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit  anEdit)
If this edit is inProgress, accepts anEdit and returns true.

The last edit added to this CompoundEdit is given a chance to addEdit(anEdit). If it refuses (returns false), anEdit is given a chance to replaceEdit the last edit. If anEdit returns false here, it is added to edits.

Specified by:
addEdit sample code for javax.swing.undo.UndoableEdit.addEdit(javax.swing.undo.UndoableEdit) definition code for javax.swing.undo.UndoableEdit.addEdit(javax.swing.undo.UndoableEdit) in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
addEdit sample code for javax.swing.undo.AbstractUndoableEdit.addEdit(javax.swing.undo.UndoableEdit) definition code for javax.swing.undo.AbstractUndoableEdit.addEdit(javax.swing.undo.UndoableEdit) in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Parameters:
anEdit - the edit to be added
Returns:
true if the edit is inProgress; otherwise returns false
See Also:
UndoableEdit.addEdit(javax.swing.undo.UndoableEdit) sample code for javax.swing.undo.UndoableEdit.addEdit(javax.swing.undo.UndoableEdit) definition code for javax.swing.undo.UndoableEdit.addEdit(javax.swing.undo.UndoableEdit)

end sample code for javax.swing.undo.CompoundEdit.end() definition code for javax.swing.undo.CompoundEdit.end()

public void end()
Sets inProgress to false.

See Also:
canUndo() sample code for javax.swing.undo.CompoundEdit.canUndo() definition code for javax.swing.undo.CompoundEdit.canUndo() , canRedo() sample code for javax.swing.undo.CompoundEdit.canRedo() definition code for javax.swing.undo.CompoundEdit.canRedo()

canUndo sample code for javax.swing.undo.CompoundEdit.canUndo() definition code for javax.swing.undo.CompoundEdit.canUndo()

public boolean canUndo()
Returns false if isInProgress or if super returns false.

Specified by:
canUndo sample code for javax.swing.undo.UndoableEdit.canUndo() definition code for javax.swing.undo.UndoableEdit.canUndo() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
canUndo sample code for javax.swing.undo.AbstractUndoableEdit.canUndo() definition code for javax.swing.undo.AbstractUndoableEdit.canUndo() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Returns:
true if this edit is alive and hasBeenDone is true
See Also:
isInProgress() sample code for javax.swing.undo.CompoundEdit.isInProgress() definition code for javax.swing.undo.CompoundEdit.isInProgress()

canRedo sample code for javax.swing.undo.CompoundEdit.canRedo() definition code for javax.swing.undo.CompoundEdit.canRedo()

public boolean canRedo()
Returns false if isInProgress or if super returns false.

Specified by:
canRedo sample code for javax.swing.undo.UndoableEdit.canRedo() definition code for javax.swing.undo.UndoableEdit.canRedo() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
canRedo sample code for javax.swing.undo.AbstractUndoableEdit.canRedo() definition code for javax.swing.undo.AbstractUndoableEdit.canRedo() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Returns:
true if this edit is alive and hasBeenDone is false
See Also:
isInProgress() sample code for javax.swing.undo.CompoundEdit.isInProgress() definition code for javax.swing.undo.CompoundEdit.isInProgress()

isInProgress sample code for javax.swing.undo.CompoundEdit.isInProgress() definition code for javax.swing.undo.CompoundEdit.isInProgress()

public boolean isInProgress()
Returns true if this edit is in progress--that is, it has not received end. This generally means that edits are still being added to it.

See Also:
end() sample code for javax.swing.undo.CompoundEdit.end() definition code for javax.swing.undo.CompoundEdit.end()

isSignificant sample code for javax.swing.undo.CompoundEdit.isSignificant() definition code for javax.swing.undo.CompoundEdit.isSignificant()

public boolean isSignificant()
Returns true if any of the UndoableEdits in edits do. Returns false if they all return false.

Specified by:
isSignificant sample code for javax.swing.undo.UndoableEdit.isSignificant() definition code for javax.swing.undo.UndoableEdit.isSignificant() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
isSignificant sample code for javax.swing.undo.AbstractUndoableEdit.isSignificant() definition code for javax.swing.undo.AbstractUndoableEdit.isSignificant() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Returns:
true
See Also:
UndoableEdit.isSignificant() sample code for javax.swing.undo.UndoableEdit.isSignificant() definition code for javax.swing.undo.UndoableEdit.isSignificant()

getPresentationName sample code for javax.swing.undo.CompoundEdit.getPresentationName() definition code for javax.swing.undo.CompoundEdit.getPresentationName()

public String sample code for java.lang.String definition code for java.lang.String  getPresentationName()
Returns getPresentationName from the last UndoableEdit added to edits. If edits is empty, calls super.

Specified by:
getPresentationName sample code for javax.swing.undo.UndoableEdit.getPresentationName() definition code for javax.swing.undo.UndoableEdit.getPresentationName() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
getPresentationName sample code for javax.swing.undo.AbstractUndoableEdit.getPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getPresentationName() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Returns:
the empty string ""
See Also:
AbstractUndoableEdit.getUndoPresentationName() sample code for javax.swing.undo.AbstractUndoableEdit.getUndoPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getUndoPresentationName() , AbstractUndoableEdit.getRedoPresentationName() sample code for javax.swing.undo.AbstractUndoableEdit.getRedoPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getRedoPresentationName()

getUndoPresentationName sample code for javax.swing.undo.CompoundEdit.getUndoPresentationName() definition code for javax.swing.undo.CompoundEdit.getUndoPresentationName()

public String sample code for java.lang.String definition code for java.lang.String  getUndoPresentationName()
Returns getUndoPresentationName from the last UndoableEdit added to edits. If edits is empty, calls super.

Specified by:
getUndoPresentationName sample code for javax.swing.undo.UndoableEdit.getUndoPresentationName() definition code for javax.swing.undo.UndoableEdit.getUndoPresentationName() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
getUndoPresentationName sample code for javax.swing.undo.AbstractUndoableEdit.getUndoPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getUndoPresentationName() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Returns:
the value from the defaults table with key AbstractUndoableEdit.undoText, followed by a space, followed by getPresentationName unless getPresentationName is "" in which case, the defaults value is returned alone.
See Also:
AbstractUndoableEdit.getPresentationName() sample code for javax.swing.undo.AbstractUndoableEdit.getPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getPresentationName()

getRedoPresentationName sample code for javax.swing.undo.CompoundEdit.getRedoPresentationName() definition code for javax.swing.undo.CompoundEdit.getRedoPresentationName()

public String sample code for java.lang.String definition code for java.lang.String  getRedoPresentationName()
Returns getRedoPresentationName from the last UndoableEdit added to edits. If edits is empty, calls super.

Specified by:
getRedoPresentationName sample code for javax.swing.undo.UndoableEdit.getRedoPresentationName() definition code for javax.swing.undo.UndoableEdit.getRedoPresentationName() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
getRedoPresentationName sample code for javax.swing.undo.AbstractUndoableEdit.getRedoPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getRedoPresentationName() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Returns:
the value from the defaults table with key AbstractUndoableEdit.redoText, followed by a space, followed by getPresentationName unless getPresentationName is "" in which case, the defaults value is returned alone.
See Also:
AbstractUndoableEdit.getPresentationName() sample code for javax.swing.undo.AbstractUndoableEdit.getPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getPresentationName()

toString sample code for javax.swing.undo.CompoundEdit.toString() definition code for javax.swing.undo.CompoundEdit.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a string that displays and identifies this object's properties.

Overrides:
toString sample code for javax.swing.undo.AbstractUndoableEdit.toString() definition code for javax.swing.undo.AbstractUndoableEdit.toString() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Returns:
a String representation of this object