javax.swing.text
Class AbstractDocument.ElementEdit

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.undo.AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit 
      extended by javax.swing.text.AbstractDocument.ElementEdit
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , DocumentEvent.ElementChange sample code for javax.swing.event.DocumentEvent.ElementChange definition code for javax.swing.event.DocumentEvent.ElementChange , UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Enclosing class:
AbstractDocument sample code for javax.swing.text.AbstractDocument definition code for javax.swing.text.AbstractDocument

public static class AbstractDocument.ElementEdit
extends AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
implements DocumentEvent.ElementChange sample code for javax.swing.event.DocumentEvent.ElementChange definition code for javax.swing.event.DocumentEvent.ElementChange

An implementation of ElementChange that can be added to the document event.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
RedoName sample code for javax.swing.undo.AbstractUndoableEdit.RedoName definition code for javax.swing.undo.AbstractUndoableEdit.RedoName , UndoName sample code for javax.swing.undo.AbstractUndoableEdit.UndoName definition code for javax.swing.undo.AbstractUndoableEdit.UndoName
 
Constructor Summary
AbstractDocument.ElementEdit sample code for javax.swing.text.AbstractDocument.ElementEdit.AbstractDocument.ElementEdit(javax.swing.text.Element, int, javax.swing.text.Element[], javax.swing.text.Element[]) definition code for javax.swing.text.AbstractDocument.ElementEdit.AbstractDocument.ElementEdit(javax.swing.text.Element, int, javax.swing.text.Element[], javax.swing.text.Element[]) (Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  e, int index, Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element [] removed, Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element [] added)
          Constructs an edit record.
 
Method Summary
 Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element [] getChildrenAdded sample code for javax.swing.text.AbstractDocument.ElementEdit.getChildrenAdded() definition code for javax.swing.text.AbstractDocument.ElementEdit.getChildrenAdded() ()
          Gets a list of children that were added.
 Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element [] getChildrenRemoved sample code for javax.swing.text.AbstractDocument.ElementEdit.getChildrenRemoved() definition code for javax.swing.text.AbstractDocument.ElementEdit.getChildrenRemoved() ()
          Gets a list of children that were removed.
 Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element getElement sample code for javax.swing.text.AbstractDocument.ElementEdit.getElement() definition code for javax.swing.text.AbstractDocument.ElementEdit.getElement() ()
          Returns the underlying element.
 int getIndex sample code for javax.swing.text.AbstractDocument.ElementEdit.getIndex() definition code for javax.swing.text.AbstractDocument.ElementEdit.getIndex() ()
          Returns the index into the list of elements.
 void redo sample code for javax.swing.text.AbstractDocument.ElementEdit.redo() definition code for javax.swing.text.AbstractDocument.ElementEdit.redo() ()
          Redoes a change.
 void undo sample code for javax.swing.text.AbstractDocument.ElementEdit.undo() definition code for javax.swing.text.AbstractDocument.ElementEdit.undo() ()
          Undoes a change.
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
addEdit sample code for javax.swing.undo.AbstractUndoableEdit.addEdit(javax.swing.undo.UndoableEdit) definition code for javax.swing.undo.AbstractUndoableEdit.addEdit(javax.swing.undo.UndoableEdit) , canRedo sample code for javax.swing.undo.AbstractUndoableEdit.canRedo() definition code for javax.swing.undo.AbstractUndoableEdit.canRedo() , canUndo sample code for javax.swing.undo.AbstractUndoableEdit.canUndo() definition code for javax.swing.undo.AbstractUndoableEdit.canUndo() , die sample code for javax.swing.undo.AbstractUndoableEdit.die() definition code for javax.swing.undo.AbstractUndoableEdit.die() , getPresentationName sample code for javax.swing.undo.AbstractUndoableEdit.getPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getPresentationName() , getRedoPresentationName sample code for javax.swing.undo.AbstractUndoableEdit.getRedoPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getRedoPresentationName() , getUndoPresentationName sample code for javax.swing.undo.AbstractUndoableEdit.getUndoPresentationName() definition code for javax.swing.undo.AbstractUndoableEdit.getUndoPresentationName() , isSignificant sample code for javax.swing.undo.AbstractUndoableEdit.isSignificant() definition code for javax.swing.undo.AbstractUndoableEdit.isSignificant() , replaceEdit sample code for javax.swing.undo.AbstractUndoableEdit.replaceEdit(javax.swing.undo.UndoableEdit) definition code for javax.swing.undo.AbstractUndoableEdit.replaceEdit(javax.swing.undo.UndoableEdit) , toString sample code for javax.swing.undo.AbstractUndoableEdit.toString() definition code for javax.swing.undo.AbstractUndoableEdit.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

AbstractDocument.ElementEdit sample code for javax.swing.text.AbstractDocument.ElementEdit(javax.swing.text.Element, int, javax.swing.text.Element[], javax.swing.text.Element[]) definition code for javax.swing.text.AbstractDocument.ElementEdit(javax.swing.text.Element, int, javax.swing.text.Element[], javax.swing.text.Element[])

public AbstractDocument.ElementEdit(Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  e,
                                    int index,
                                    Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element [] removed,
                                    Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element [] added)
Constructs an edit record. This does not modify the element so it can safely be used to catch up a view to the current model state for views that just attached to a model.

Parameters:
e - the element
index - the index into the model >= 0
removed - a set of elements that were removed
added - a set of elements that were added
Method Detail

getElement sample code for javax.swing.text.AbstractDocument.ElementEdit.getElement() definition code for javax.swing.text.AbstractDocument.ElementEdit.getElement()

public Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  getElement()
Returns the underlying element.

Specified by:
getElement sample code for javax.swing.event.DocumentEvent.ElementChange.getElement() definition code for javax.swing.event.DocumentEvent.ElementChange.getElement() in interface DocumentEvent.ElementChange sample code for javax.swing.event.DocumentEvent.ElementChange definition code for javax.swing.event.DocumentEvent.ElementChange
Returns:
the element

getIndex sample code for javax.swing.text.AbstractDocument.ElementEdit.getIndex() definition code for javax.swing.text.AbstractDocument.ElementEdit.getIndex()

public int getIndex()
Returns the index into the list of elements.

Specified by:
getIndex sample code for javax.swing.event.DocumentEvent.ElementChange.getIndex() definition code for javax.swing.event.DocumentEvent.ElementChange.getIndex() in interface DocumentEvent.ElementChange sample code for javax.swing.event.DocumentEvent.ElementChange definition code for javax.swing.event.DocumentEvent.ElementChange
Returns:
the index >= 0

getChildrenRemoved sample code for javax.swing.text.AbstractDocument.ElementEdit.getChildrenRemoved() definition code for javax.swing.text.AbstractDocument.ElementEdit.getChildrenRemoved()

public Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element [] getChildrenRemoved()
Gets a list of children that were removed.

Specified by:
getChildrenRemoved sample code for javax.swing.event.DocumentEvent.ElementChange.getChildrenRemoved() definition code for javax.swing.event.DocumentEvent.ElementChange.getChildrenRemoved() in interface DocumentEvent.ElementChange sample code for javax.swing.event.DocumentEvent.ElementChange definition code for javax.swing.event.DocumentEvent.ElementChange
Returns:
the list

getChildrenAdded sample code for javax.swing.text.AbstractDocument.ElementEdit.getChildrenAdded() definition code for javax.swing.text.AbstractDocument.ElementEdit.getChildrenAdded()

public Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element [] getChildrenAdded()
Gets a list of children that were added.

Specified by:
getChildrenAdded sample code for javax.swing.event.DocumentEvent.ElementChange.getChildrenAdded() definition code for javax.swing.event.DocumentEvent.ElementChange.getChildrenAdded() in interface DocumentEvent.ElementChange sample code for javax.swing.event.DocumentEvent.ElementChange definition code for javax.swing.event.DocumentEvent.ElementChange
Returns:
the list

redo sample code for javax.swing.text.AbstractDocument.ElementEdit.redo() definition code for javax.swing.text.AbstractDocument.ElementEdit.redo()

public void redo()
          throws CannotRedoException sample code for javax.swing.undo.CannotRedoException definition code for javax.swing.undo.CannotRedoException 
Redoes a change.

Specified by:
redo sample code for javax.swing.undo.UndoableEdit.redo() definition code for javax.swing.undo.UndoableEdit.redo() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
redo sample code for javax.swing.undo.AbstractUndoableEdit.redo() definition code for javax.swing.undo.AbstractUndoableEdit.redo() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Throws:
CannotRedoException sample code for javax.swing.undo.CannotRedoException definition code for javax.swing.undo.CannotRedoException - if the change cannot be redone
See Also:
AbstractUndoableEdit.canRedo() sample code for javax.swing.undo.AbstractUndoableEdit.canRedo() definition code for javax.swing.undo.AbstractUndoableEdit.canRedo()

undo sample code for javax.swing.text.AbstractDocument.ElementEdit.undo() definition code for javax.swing.text.AbstractDocument.ElementEdit.undo()

public void undo()
          throws CannotUndoException sample code for javax.swing.undo.CannotUndoException definition code for javax.swing.undo.CannotUndoException 
Undoes a change.

Specified by:
undo sample code for javax.swing.undo.UndoableEdit.undo() definition code for javax.swing.undo.UndoableEdit.undo() in interface UndoableEdit sample code for javax.swing.undo.UndoableEdit definition code for javax.swing.undo.UndoableEdit
Overrides:
undo sample code for javax.swing.undo.AbstractUndoableEdit.undo() definition code for javax.swing.undo.AbstractUndoableEdit.undo() in class AbstractUndoableEdit sample code for javax.swing.undo.AbstractUndoableEdit definition code for javax.swing.undo.AbstractUndoableEdit
Throws:
CannotUndoException sample code for javax.swing.undo.CannotUndoException definition code for javax.swing.undo.CannotUndoException - if the change cannot be undone
See Also:
AbstractUndoableEdit.canUndo() sample code for javax.swing.undo.AbstractUndoableEdit.canUndo() definition code for javax.swing.undo.AbstractUndoableEdit.canUndo()