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

Quick Search    Search Deep

javax.swing.text
Class DefaultStyledDocument.AttributeUndoableEdit  view DefaultStyledDocument.AttributeUndoableEdit download DefaultStyledDocument.AttributeUndoableEdit.java

java.lang.Object
  extended byjavax.swing.undo.AbstractUndoableEdit
      extended byjavax.swing.text.DefaultStyledDocument.AttributeUndoableEdit
All Implemented Interfaces:
java.io.Serializable, javax.swing.undo.UndoableEdit
Enclosing class:
DefaultStyledDocument

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

copy

protected AttributeSet copy
A copy of the old attributes.


newAttributes

protected AttributeSet newAttributes
The new attributes.


isReplacing

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


element

protected Element element
The element that has changed.

Constructor Detail

DefaultStyledDocument.AttributeUndoableEdit

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

Method Detail

undo

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


redo

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