All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.PlainDocument

java.lang.Object
   |
   +----com.sun.java.swing.text.AbstractDocument
           |
           +----com.sun.java.swing.text.PlainDocument

public class PlainDocument
extends AbstractDocument
A plain document that uses one font and color.

See Also:
Document, JDocument

Variable Index

 o lineLimitAttribute
Name of the attribute that specifies the maximum length of a line, if there is a maximum length.
 o tabSizeAttribute
Name of the attribute that specifies the tab size for tabs contained in the content.

Constructor Index

 o PlainDocument()
Constructs a plain text document.
 o PlainDocument(AbstractDocument. Content)
Constructs a plain text document.

Method Index

 o createDefaultRoot()
Creates the root element to be used to represent the default document structure.
 o getDefaultRootElement()
 o insertUpdate(DefaultDocumentEvent, AttributeSet)
Updates document structure as a result of text insertion.
 o removeUpdate(DefaultDocumentEvent)
Updates any document structure as a result of text removal.

Variables

 o tabSizeAttribute
 public static final String tabSizeAttribute
Name of the attribute that specifies the tab size for tabs contained in the content. The type for the value is Integer.

 o lineLimitAttribute
 public static final String lineLimitAttribute
Name of the attribute that specifies the maximum length of a line, if there is a maximum length. The type for the value is Integer.

Constructors

 o PlainDocument
 public PlainDocument()
Constructs a plain text document.

 o PlainDocument
 protected PlainDocument(AbstractDocument. Content c)
Constructs a plain text document.

Parameters:
c - the container for the content

Methods

 o getDefaultRootElement
 public Element getDefaultRootElement()
Overrides:
getDefaultRootElement in class AbstractDocument
See Also:
getDefaultRootElement
 o createDefaultRoot
 protected AbstractDocument. AbstractElement createDefaultRoot()
Creates the root element to be used to represent the default document structure.

Returns:
the element base
 o insertUpdate
 protected void insertUpdate(DefaultDocumentEvent chng,
                             AttributeSet attr)
Updates document structure as a result of text insertion. This will happen within a write lock. Since this document simply maps out lines, we refresh the line map.

Parameters:
chng - the change event
attr - the set of attributes
Overrides:
insertUpdate in class AbstractDocument
 o removeUpdate
 protected void removeUpdate(DefaultDocumentEvent chng)
Updates any document structure as a result of text removal. This will happen within a write lock. Since the structure represents a line map, this just checks to see if the removal spans lines. If it does, the two lines outside of the removal area are joined together.

Parameters:
chng - the change event
Overrides:
removeUpdate in class AbstractDocument

All Packages  Class Hierarchy  This Package  Previous  Next  Index