javax.swing.text
Class GapContent.InsertUndo

java.lang.Object
  extended byjavax.swing.undo.AbstractUndoableEdit
      extended byjavax.swing.text.GapContent.InsertUndo
All Implemented Interfaces:
Serializable, UndoableEdit
Enclosing class:
GapContent

class GapContent.InsertUndo
extends AbstractUndoableEdit

UnoableEdit created for inserts.


Field Summary
protected  int length
          Length of string inserted.
protected  int offset
          Where string was inserted.
protected  Vector posRefs
          An array of instances of UndoPosRef for the Positions in the range that was removed, valid after undo.
protected  String string
          The string that was inserted.
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
protected GapContent.InsertUndo(int offset, int length)
           
 
Method Summary
 void redo()
          Throws CannotRedoException if canRedo returns false.
 void undo()
          Throws CannotUndoException if canUndo returns false.
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

offset

protected int offset
Where string was inserted.


length

protected int length
Length of string inserted.


string

protected String string
The string that was inserted. This will only be valid after an undo.


posRefs

protected Vector posRefs
An array of instances of UndoPosRef for the Positions in the range that was removed, valid after undo.

Constructor Detail

GapContent.InsertUndo

protected GapContent.InsertUndo(int offset,
                                int length)
Method Detail

undo

public void undo()
          throws CannotUndoException
Description copied from class: AbstractUndoableEdit
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.

Specified by:
undo in interface UndoableEdit
Overrides:
undo in class AbstractUndoableEdit
Throws:
CannotUndoException - if canUndo returns false
See Also:
AbstractUndoableEdit.canUndo()

redo

public void redo()
          throws CannotRedoException
Description copied from class: AbstractUndoableEdit
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.

Specified by:
redo in interface UndoableEdit
Overrides:
redo in class AbstractUndoableEdit
Throws:
CannotRedoException - if canRedo returns false
See Also:
AbstractUndoableEdit.canRedo()