Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Class DefaultStyledDocument.AttributeUndoableEdit  view DefaultStyledDocument.AttributeUndoableEdit download

  extended byjavax.swing.undo.AbstractUndoableEdit
      extended byjavax.swing.text.DefaultStyledDocument.AttributeUndoableEdit
All Implemented Interfaces:, javax.swing.undo.UndoableEdit
Enclosing class:

public static class DefaultStyledDocument.AttributeUndoableEdit
extends javax.swing.undo.AbstractUndoableEdit

An javax.swing.undo.UndoableEdit that can undo attribute changes to an element.

Field Summary
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.
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
Constructor Summary
DefaultStyledDocument.AttributeUndoableEdit(Element el, AttributeSet newAtts, boolean replacing)
          Creates a new AttributeUndoableEdit.
Method Summary
 void redo()
          Redos an attribute change.
 void undo()
          Undos the attribute change.
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


protected AttributeSet copy
A copy of the old attributes.


protected AttributeSet newAttributes
The new attributes.


protected boolean isReplacing
If the new attributes replaced the old attributes or if they only were added to them.


protected Element element
The element that has changed.

Constructor Detail


public DefaultStyledDocument.AttributeUndoableEdit(Element el,
                                                   AttributeSet newAtts,
                                                   boolean replacing)
Creates a new AttributeUndoableEdit.

Method Detail


public void undo()
Undos the attribute change. The copy field is set as attributes on element.


public void redo()
Redos an attribute change. This adds newAttributes to the element's attribute set, possibly clearing all attributes if isReplacing is true.