- java.lang.Object
-
- javax.swing.undo.AbstractUndoableEdit
-
- javax.swing.text.DefaultStyledDocument.AttributeUndoableEdit
-
- All Implemented Interfaces:
Serializable,UndoableEdit
- Enclosing class:
- DefaultStyledDocument
public static class DefaultStyledDocument.AttributeUndoableEdit extends AbstractUndoableEdit
An UndoableEdit used to remember AttributeSet changes to an Element.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AttributeSetcopyCopy of the AttributeSet the Element contained.protected ElementelementAffected Element.protected booleanisReplacingtrue if all the attributes in the element were removed first.protected AttributeSetnewAttributesAttributeSet containing additional entries, must be non-mutable!-
Fields declared in class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
-
-
Constructor Summary
Constructors Constructor Description AttributeUndoableEdit(Element element, AttributeSet newAttributes, boolean isReplacing)Constructs anAttributeUndoableEdit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidredo()Redoes a change.voidundo()Undoes a change.-
Methods declared in class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
-
-
-
-
Field Detail
-
newAttributes
protected AttributeSet newAttributes
AttributeSet containing additional entries, must be non-mutable!
-
copy
protected AttributeSet copy
Copy of the AttributeSet the Element contained.
-
isReplacing
protected boolean isReplacing
true if all the attributes in the element were removed first.
-
element
protected Element element
Affected Element.
-
-
Constructor Detail
-
AttributeUndoableEdit
public AttributeUndoableEdit(Element element, AttributeSet newAttributes, boolean isReplacing)
Constructs anAttributeUndoableEdit.- Parameters:
element- the elementnewAttributes- the new attributesisReplacing- true if all the attributes in the element were removed first.
-
-
Method Detail
-
redo
public void redo() throws CannotRedoExceptionRedoes a change.- Specified by:
redoin interfaceUndoableEdit- Overrides:
redoin classAbstractUndoableEdit- Throws:
CannotRedoException- if the change cannot be redone- See Also:
AbstractUndoableEdit.canRedo()
-
undo
public void undo() throws CannotUndoExceptionUndoes a change.- Specified by:
undoin interfaceUndoableEdit- Overrides:
undoin classAbstractUndoableEdit- Throws:
CannotUndoException- if the change cannot be undone- See Also:
AbstractUndoableEdit.canUndo()
-
-