public static class DefaultStyledDocument.AttributeUndoableEdit extends AbstractUndoableEdit
UndoableEdit that can undo attribute changes to an element.| Modifier and Type | Field and Description |
|---|---|
protected AttributeSet |
copy
A copy of the old attributes.
|
protected Element |
element
The element that has changed.
|
protected boolean |
isReplacing
If the new attributes replaced the old attributes or if they only were
added to them.
|
protected AttributeSet |
newAttributes
The new attributes.
|
RedoName, UndoName| Constructor and Description |
|---|
DefaultStyledDocument.AttributeUndoableEdit(Element el,
AttributeSet newAtts,
boolean replacing)
Creates a new
AttributeUndoableEdit. |
| Modifier and Type | Method and Description |
|---|---|
void |
redo()
Redos an attribute change.
|
void |
undo()
Undos the attribute change.
|
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toStringprotected AttributeSet copy
protected AttributeSet newAttributes
protected boolean isReplacing
public DefaultStyledDocument.AttributeUndoableEdit(Element el, AttributeSet newAtts, boolean replacing)
AttributeUndoableEdit.el - the element that changes attributesnewAtts - the new attributesreplacing - if the new attributes replace the old or only append to thempublic void undo()
copy field is set as
attributes on element.undo in interface UndoableEditundo in class AbstractUndoableEditAbstractUndoableEdit.canUndo(),
AbstractUndoableEdit.redo()public void redo()
newAttributes to the
element's attribute set, possibly clearing all attributes
if isReplacing is true.redo in interface UndoableEditredo in class AbstractUndoableEditAbstractUndoableEdit.canRedo(),
AbstractUndoableEdit.undo()