com.wirefusion.undo
Class UndoableStringEdit

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by com.wirefusion.undo.UndoableStringEdit
All Implemented Interfaces:
java.io.Serializable, javax.swing.undo.UndoableEdit

public abstract class UndoableStringEdit
extends javax.swing.undo.AbstractUndoableEdit

An undoable edit, used for String edits. To use this class, a subclass that implements the setValue method must be created.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
UndoableStringEdit(java.lang.String oldValue, java.lang.String newValue)
          Constructs a new UndoableStringEdit.
 
Method Summary
 java.lang.String getPresentationName()
          Returns a string representation for the undoable edit.
 void redo()
          Redoes the edit
abstract  void setValue(java.lang.String value)
          Implementations of this method must set the field that the undoable value originates from to "value".
 void undo()
          Undoes the edit
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndoableStringEdit

public UndoableStringEdit(java.lang.String oldValue,
                          java.lang.String newValue)
Constructs a new UndoableStringEdit.

Parameters:
oldValue - the value before the edit
newValue - the value after the edit
Method Detail

getPresentationName

public java.lang.String getPresentationName()
Returns a string representation for the undoable edit.

Specified by:
getPresentationName in interface javax.swing.undo.UndoableEdit
Overrides:
getPresentationName in class javax.swing.undo.AbstractUndoableEdit

setValue

public abstract void setValue(java.lang.String value)
Implementations of this method must set the field that the undoable value originates from to "value".

Parameters:
value - a value of the same type as the undoable value

undo

public void undo()
Undoes the edit

Specified by:
undo in interface javax.swing.undo.UndoableEdit
Overrides:
undo in class javax.swing.undo.AbstractUndoableEdit

redo

public void redo()
Redoes the edit

Specified by:
redo in interface javax.swing.undo.UndoableEdit
Overrides:
redo in class javax.swing.undo.AbstractUndoableEdit