|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
javax.swing.text.AbstractDocument
![]()
![]()
![]()
javax.swing.text.DefaultStyledDocument
, Document
, StyledDocument


public class DefaultStyledDocument


A document that can be marked up with character and paragraph styles in a manner similar to the Rich Text Format. The element structure for this document represents style crossings for style runs. These style runs are mapped into a paragraph element structure (which may reside in some other structure). The style runs break at paragraph boundaries since logical styles are assigned to paragraph boundaries.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder
.
Document
,
AbstractDocument
,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
DefaultStyledDocument.AttributeUndoableEdit
An UndoableEdit used to remember AttributeSet changes to an Element. |
class |
DefaultStyledDocument.ElementBuffer
Class to manage changes to the element hierarchy. |
static class |
DefaultStyledDocument.ElementSpec
Specification for building elements. |
protected class |
DefaultStyledDocument.SectionElement
Default root element for a document... |
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument ![]() |
|---|
AbstractDocument.AbstractElement |
| Field Summary | |
|---|---|
protected DefaultStyledDocument.ElementBuffer |
buffer
|
static int |
BUFFER_SIZE_DEFAULT
The default size of the initial content buffer. |
Fields inherited from class javax.swing.text.AbstractDocument ![]() |
|---|
BAD_LOCATION |
Fields inherited from interface javax.swing.text.Document ![]() |
|---|
StreamDescriptionProperty |
| Constructor Summary | |
|---|---|
DefaultStyledDocument
Constructs a default styled document. |
|
DefaultStyledDocument
Constructs a styled document. |
|
DefaultStyledDocument
Constructs a styled document with the default content storage implementation and a shared set of styles. |
|
| Method Summary | |
|---|---|
void |
addDocumentListener
Adds a document listener for notification of any changes. |
Style |
addStyle
Adds a new style into the logical style hierarchy. |
protected void |
create
Initialize the document to reflect the given element structure (i.e. |
protected AbstractDocument.AbstractElement |
createDefaultRoot
Creates the root element to be used to represent the default document structure. |
Color |
getBackground
Gets the background color from an attribute set. |
Element |
getCharacterElement
Gets a character element based on a position. |
Element |
getDefaultRootElement
Gets the default root element. |
Font |
getFont
Gets the font from an attribute set. |
Color |
getForeground
Gets the foreground color from an attribute set. |
Style |
getLogicalStyle
Fetches the logical style assigned to the paragraph represented by the given position. |
Element |
getParagraphElement
Gets the paragraph element at the offset pos. |
Style |
getStyle
Fetches a named style previously added. |
Enumeration |
getStyleNames
Fetches the list of of style names. |
protected void |
insert
Inserts new elements in bulk. |
protected void |
insertUpdate
Updates document structure as a result of text insertion. |
void |
removeDocumentListener
Removes a document listener. |
void |
removeStyle
Removes a named style previously added to the document. |
protected void |
removeUpdate
Updates document structure as a result of text removal. |
void |
setCharacterAttributes
Sets attributes for some part of the document. |
void |
setLogicalStyle
Sets the logical style to use for the paragraph at the given position. |
void |
setParagraphAttributes
Sets attributes for a paragraph. |
protected void |
styleChanged
Called when any of this document's styles have changed. |
Methods inherited from class javax.swing.text.AbstractDocument ![]() |
|---|
addUndoableEditListener |
Methods inherited from class java.lang.Object ![]() |
|---|
clone |