All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.undo.AbstractUndoableEdit

java.lang.Object
   |
   +----com.sun.java.swing.undo.AbstractUndoableEdit

public class AbstractUndoableEdit
extends Object
implements UndoableEdit
An abstract implementation of UndoableEdit, implementing simple responses to all boolean methods in that interface.


Variable Index

 o RedoName
String returned by getRedoPresentationName()
 o UndoName
String returned by getUndoPresentationName()

Constructor Index

 o AbstractUndoableEdit()

Method Index

 o addEdit(UndoableEdit)
This default implementation returns false.
 o canRedo()
Returns true if this edit is alive and hasBeenDone is false.
 o canUndo()
Returns true if this edit is alive and hasBeenDone is true.
 o die()
Sets alive to false.
 o getPresentationName()
This default implementation returns "".
 o getRedoPresentationName()
If getPresentationName() returns "", returns AbstractUndoableEdit.RedoName.
 o getUndoPresentationName()
If getPresentationName() returns "", returns AbstractUndoableEdit.UndoName.
 o isSignificant()
This default implementation returns true.
 o redo()
Throws CannotRedoException if canRedo() returns false.
 o replaceEdit(UndoableEdit)
This default implementation returns false.
 o toString()
 o undo()
Throws CannotUndoException if canUndo() returns false.

Variables

 o UndoName
 protected final String UndoName
String returned by getUndoPresentationName()

 o RedoName
 protected final String RedoName
String returned by getRedoPresentationName()

Constructors

 o AbstractUndoableEdit
 public AbstractUndoableEdit()

Methods

 o die
 public void die()
Sets alive to false. Note that this is a one way operation: dead edits cannot be resurrected. Sending undo() or redo() to a dead edit results in an exception being thrown. Typically an edit is killed when it is consolidated by another edit's addEdit() or replaceEdit() method, or when it is dequeued from an UndoManager

 o undo
 public void undo() throws CannotUndoException
Throws CannotUndoException if canUndo() returns false. Sets hasBeenDone to false. Subclasses should override to undo the operation represented by this edit. Override should begin with a call to super.

See Also:
canUndo
 o canUndo
 public boolean canUndo()
Returns true if this edit is alive and hasBeenDone is true.

See Also:
die, undo, redo
 o redo
 public void redo() throws CannotRedoException
Throws CannotRedoException if canRedo() returns false. Sets hasBeenDone to true. Subclasses should override to redo the operation represented by this edit. Override should begin with a call to super.

See Also:
canRedo
 o canRedo
 public boolean canRedo()
Returns true if this edit is alive and hasBeenDone is false.

See Also:
die, undo, redo
 o addEdit
 public boolean addEdit(UndoableEdit anEdit)
This default implementation returns false.

See Also:
addEdit
 o replaceEdit
 public boolean replaceEdit(UndoableEdit anEdit)
This default implementation returns false.

See Also:
replaceEdit
 o isSignificant
 public boolean isSignificant()
This default implementation returns true.

See Also:
isSignificant
 o getPresentationName
 public String getPresentationName()
This default implementation returns "". Used by getUndoPresentationName() and getRedoPresentationName() to construct the strings they return. Subclasses shoul override to return an appropriate description of the operation this edit represents.

See Also:
getUndoPresentationName, getRedoPresentationName
 o getUndoPresentationName
 public String getUndoPresentationName()
If getPresentationName() returns "", returns AbstractUndoableEdit.UndoName. Otherwise returns AbstractUndoableEdit.UndoName followed by a space and getPresentationName()

See Also:
getPresentationName
 o getRedoPresentationName
 public String getRedoPresentationName()
If getPresentationName() returns "", returns AbstractUndoableEdit.RedoName. Otherwise returns AbstractUndoableEdit.RedoName followed by a space and getPresentationName()

See Also:
getPresentationName
 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index