Serializable
, DocumentEvent.ElementChange
, UndoableEdit
AbstractDocument
public static class AbstractDocument.ElementEdit extends AbstractUndoableEdit implements DocumentEvent.ElementChange
RedoName, UndoName
Constructor | Description |
---|---|
ElementEdit |
Constructs an edit record. |
Modifier and Type | Method | Description |
---|---|---|
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. |
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
public ElementEdit(Element e, int index, Element[] removed, Element[] added)
e
- the elementindex
- the index into the model >= 0removed
- a set of elements that were removedadded
- a set of elements that were addedpublic Element getElement()
getElement
in interface DocumentEvent.ElementChange
public int getIndex()
getIndex
in interface DocumentEvent.ElementChange
public Element[] getChildrenRemoved()
getChildrenRemoved
in interface DocumentEvent.ElementChange
public Element[] getChildrenAdded()
getChildrenAdded
in interface DocumentEvent.ElementChange
public void redo() throws CannotRedoException
redo
in interface UndoableEdit
redo
in class AbstractUndoableEdit
CannotRedoException
- if the change cannot be redonepublic void undo() throws CannotUndoException
undo
in interface UndoableEdit
undo
in class AbstractUndoableEdit
CannotUndoException
- if the change cannot be undone
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/text/AbstractDocument.ElementEdit.html