public static class

AbstractDocument.ElementEdit

extends AbstractUndoableEdit
implements DocumentEvent.ElementChange
java.lang.Object
   ↳ javax.swing.undo.AbstractUndoableEdit
     ↳ javax.swing.text.AbstractDocument.ElementEdit

Class Overview

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

Summary

[Expand]
Inherited Constants
From class javax.swing.undo.AbstractUndoableEdit
Public Constructors
AbstractDocument.ElementEdit(Element e, int index, Element[] removed, Element[] added)
Constructs an edit record.
Public Methods
Element[] getChildrenAdded()
Gets a list of children that were added.
Element[] getChildrenRemoved()
Gets a list of children that were removed.
Element getElement()
Returns the underlying element.
int getIndex()
Returns the index into the list of elements.
void redo()
Redoes a change.
void undo()
Undoes a change.
[Expand]
Inherited Methods
From class javax.swing.undo.AbstractUndoableEdit
From class java.lang.Object
From interface javax.swing.event.DocumentEvent.ElementChange
From interface javax.swing.undo.UndoableEdit

Public Constructors

public AbstractDocument.ElementEdit (Element e, int index, Element[] removed, 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

Public Methods

public Element[] getChildrenAdded ()

Gets a list of children that were added.

Returns
  • the list

public Element[] getChildrenRemoved ()

Gets a list of children that were removed.

Returns
  • the list

public Element getElement ()

Returns the underlying element.

Returns
  • the element

public int getIndex ()

Returns the index into the list of elements.

Returns
  • the index >= 0

public void redo ()

Redoes a change.

Throws
CannotRedoException if the change cannot be redone

public void undo ()

Undoes a change.

Throws
CannotUndoException if the change cannot be undone