All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.undo.JUndoableEdit

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

public class JUndoableEdit
extends Object
implements UndoableEdit
An abstract implementation of UndoableEdit, implementing simple responses to all boolean methods in that interface. Adds notion of a change being "in progress".


Variable Index

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

Constructor Index

 o JUndoableEdit()

Method Index

 o addEdit(UndoableEdit)
This default implementation returns false.
 o canRedo()
Returns true if this edit is enabled and hasBeenDone is true.
 o canUndo()
Returns true if this edit is enabled and hasBeenDone is false.
 o disable()
Sets enabled to false.
 o end()
Sets inProgress to false and hasBeenDone to true.
 o getPresentationName()
This default implementation returns "".
 o getRedoPresentationName()
If getPresentationName() returns "", returns JUndoableEdit.RedoName.
 o getUndoPresentationName()
If getPresentationName() returns "", returns JUndoableEdit.UndoName.
 o init()
Designated initializer.
 o isInProgress()
Returns true if this edit is in progress--that is, if it is still being constructed, before it has been announced to listeners via an UndoableEditEvent
 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 JUndoableEdit
 public JUndoableEdit()

Methods

 o init
 protected void init()
Designated initializer. All constructors call this method to initialize ivars. Sets inProgress to true and hasBeenDone to false.

 o end
 public void end()
Sets inProgress to false and hasBeenDone to true.

See Also:
canUndo, canRedo
 o disable
 public void disable()
Sets enabled to false. Note that this is a one way operation: disabled edits cannot be reenabled. Typically this is sent when this edit is absorbed by another one via its addEdit() or replaceEdit() method.

See Also:
addEdit, replaceEdit
 o isInProgress
 public boolean isInProgress()
Returns true if this edit is in progress--that is, if it is still being constructed, before it has been announced to listeners via an UndoableEditEvent

See Also:
end
 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 enabled and hasBeenDone is false.

See Also:
disable, 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 enabled and hasBeenDone is true.

See Also:
disable, 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 JUndoableEdit.UndoName. Otherwise returns JUndoableEdit.UndoName followed by a space and getPresentationName()

See Also:
getPresentationName
 o getRedoPresentationName
 public String getRedoPresentationName()
If getPresentationName() returns "", returns JUndoableEdit.RedoName. Otherwise returns JUndoableEdit.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