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 JavaBeans
has been added to the java.beans package.
Please see java..
Document, AbstractDocument
| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract static class | DefaultStyledDocument.
Base class for style change handlers with support for stale objects detection. |
| public static class | DefaultStyledDocument.
An UndoableEdit used to remember AttributeSet changes to an Element. |
| pack-priv class | DefaultStyledDocument.
When run this creates a change event for the complete document and fires it. |
| public class | DefaultStyledDocument.
Class to manage changes to the element hierarchy. |
| public static class | DefaultStyledDocument.
Specification for building elements. |
| protected class | DefaultStyledDocument.
Default root element for a document... |
| pack-priv static class | DefaultStyledDocument.
Added to all the Styles. |
| pack-priv static class | DefaultStyledDocument.
UndoableEdit for changing the resolve parent of an Element. |
| pack-priv static class | DefaultStyledDocument.
Added to the StyleContext. |
| Modifier and Type | Field and Description |
|---|---|
| protected DefaultStyledDocument. | buffer
The element buffer. |
| public static final int | BUFFER_SIZE_DEFAULT
The default size of the initial content buffer. |
| private transient Vector | listeningStyles
Styles listening to. |
| private transient ChangeListener | styleChangeListener
Listens to Styles. |
| private transient ChangeListener | styleContextChangeListener
Listens to Styles. |
| private transient DefaultStyledDocument. | updateRunnable
Run to create a change event for the document |
| Access | Constructor and Description |
|---|---|
| public | DefaultStyledDocument(AbstractDocument.
the container for the content c,resources and style definitions which may
be shared across documents styles)Constructs a styled document. |
| public | DefaultStyledDocument(StyleContext
the styles styles)Constructs a styled document with the default content storage implementation and a shared set of styles. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addDocumentListener(DocumentListener
the listener listener)Overrides javax. Implements javax. Adds a document listener for notification of any changes. |
| public Style | Returns: the stylethe name of the style (must be unique within the
collection of named styles). The name may be null if the style
is unnamed, but the caller is responsible
for managing the reference returned as an unnamed style can't
be fetched by name. An unnamed style may be useful for things
like character attribute overrides such as found in a style
run. nm, Style the parent style. This may be null if unspecified
attributes need not be resolved in some other style. parent)Implements javax. Adds a new style into the logical style hierarchy. |
| protected void | create(DefaultStyledDocument.
the element data dataInitialize the document to reflect the given element
structure (i.e. the structure reported by the
|
| protected AbstractDocument. | Returns: the element baseCreates the root element to be used to represent the default document structure. |
| pack-priv short | createSpecsForInsertAfterNewline(Element paragraph, Element pParagraph, AttributeSet pattr, Vector<DefaultStyledDocument.
This is called by insertUpdate when inserting after a new line. |
| pack-priv ChangeListener | |
| pack-priv ChangeListener | |
| public Color | Returns: the colorthe attribute set attr)Implements javax. Gets the background color from an attribute set. |
| public Element | Returns: the elementthe position in the document >= 0 pos)Implements javax. Gets a character element based on a position. |
| public Element | Returns: the rootImplements abstract javax. Implements javax. Gets the default root element. |
| public Font | Returns: the fontthe attribute set attr)Implements javax. Gets the font from an attribute set. |
| public Color | Returns: the colorthe attribute set attr)Implements javax. Gets the foreground color from an attribute set. |
| public Style | Returns: the style, null if nonethe location to translate to a paragraph
and determine the logical style assigned >= 0. This
is an offset from the start of the document. p)Implements javax. Fetches the logical style assigned to the paragraph represented by the given position. |
| public Element | Returns: the elementthe starting offset >= 0 pos)Implements abstract javax. Implements javax. Gets the paragraph element at the offset |
| public Style | Returns: the stylethe name of the style nm)Implements javax. Fetches a named style previously added. |
| public Enumeration | |
| protected void | insert(int
the starting offset >= 0 offset, DefaultStyledDocument.the element data dataInserts new elements in bulk. |
| protected void | insertUpdate(AbstractDocument.
a description of the document change chng,the attributes attr)Overrides javax. Updates document structure as a result of text insertion. |
| private void | |
| public void | removeDocumentListener(DocumentListener
the listener listener)Overrides javax. Implements javax. Removes a document listener. |
| public void | |
| private void | |
| public void | removeStyle(String
the name of the style to remove nm)Implements javax. Removes a named style previously added to the document. |
| protected void | removeUpdate(AbstractDocument.
a description of the document change chngOverrides javax. Updates document structure as a result of text removal. |
| public void | setCharacterAttributes(int
the offset in the document >= 0 offset, int the length > 0 length, AttributeSet the attributes s, boolean true if the previous attributes should be replaced
before setting the new attributes replace)Implements javax. Sets attributes for some part of the document. |
| public void | setLogicalStyle(int
the offset from the start of the document >= 0 pos, Style the logical style to assign to the paragraph, null if none s)Implements javax. Sets the logical style to use for the paragraph at the given position. |
| public void | setParagraphAttributes(int
the offset into the paragraph >= 0 offset, int the number of characters affected >= 0 length, AttributeSet the attributes s, boolean whether to replace existing attributes, or merge them replace)Implements javax. Sets attributes for a paragraph. |
| protected void | styleChanged(Style
The Style that has changed. style)Called when any of this document's styles have changed. |
| pack-priv void | updateStylesListeningTo()
Adds a ChangeListener to new styles, and removes ChangeListener from old styles. |