This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.undo
class CompoundEdit

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

public class CompoundEdit
extends AbstractUndoableEdit

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


Field Summary
protected Vector edits
          The collection of UndoableEdits undone/redone en masse by this CompoundEdit.
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary

          
 
Method Summary
 boolean

          If this edit is inProgress, accepts anEdit and returns true.
 boolean

          Returns false if isInProgress or if super returns false.
 boolean

          Returns false if isInProgress or if super returns false.
 void
die()

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

          Sets inProgress to false.
 String

          Returns getPresentationName from the last UndoableEdit added to edits.
 String

          Returns getRedoPresentationName from the last UndoableEdit added to edits.
 String

          Returns getUndoPresentationName from the last UndoableEdit added to edits.
 boolean

          Returns true if this edit is in progress--that is, it has not received end.
 boolean

          Returns true if any of the UndoableEdits in edits do.
protected UndoableEdit

          Returns the last UndoableEdit in edits, or null if edits is empty.
 void

          Sends redo to all contained UndoableEdits in the order in which they were added.
 String

          Returns a string that displays and identifies this object's properties.
 void

          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
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, redo, replaceEdit, toString, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

edits

protected Vector edits
The collection of UndoableEdits undone/redone en masse by this CompoundEdit.
Constructor Detail

CompoundEdit

public CompoundEdit()
Method Detail

addEdit

public boolean addEdit(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.

Overrides:
addEdit in class AbstractUndoableEdit
Parameters:
anEdit - the edit to be added
Returns:
true if the edit is inProgress; otherwise returns false

canRedo

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

Overrides:
canRedo in class AbstractUndoableEdit

canUndo

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

Overrides:
canUndo in class AbstractUndoableEdit

die

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

Overrides:
die in class AbstractUndoableEdit

end

public void end()
Sets inProgress to false.


getPresentationName

public String getPresentationName()
Returns getPresentationName from the last UndoableEdit added to edits. If edits is empty, calls super.

Overrides:
getPresentationName in class AbstractUndoableEdit

getRedoPresentationName

public String getRedoPresentationName()
Returns getRedoPresentationName from the last UndoableEdit added to edits. If edits is empty, calls super.

Overrides:
getRedoPresentationName in class AbstractUndoableEdit

getUndoPresentationName

public String getUndoPresentationName()
Returns getUndoPresentationName from the last UndoableEdit added to edits. If edits is empty, calls super.

Overrides:
getUndoPresentationName in class AbstractUndoableEdit

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.


isSignificant

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

Overrides:
isSignificant in class AbstractUndoableEdit

lastEdit

protected UndoableEdit lastEdit()
Returns the last UndoableEdit in edits, or null if edits is empty.


redo

public void redo()
          throws CannotRedoException
Sends redo to all contained UndoableEdits in the order in which they were added.

Overrides:
redo in class AbstractUndoableEdit
Throws:
CannotRedoException

toString

public String toString()
Returns a string that displays and identifies this object's properties.

Overrides:
toString in class AbstractUndoableEdit
Returns:
a String representation of this object

undo

public void undo()
          throws CannotUndoException
Sends undo to all contained UndoableEdits in the reverse of the order in which they were added.

Overrides:
undo in class AbstractUndoableEdit
Throws:
CannotUndoException


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.