StyledDocument (Java SE 19 & JDK 19) (original) (raw)

All Superinterfaces:

[Document](Document.html "interface in javax.swing.text")

All Known Implementing Classes:

[DefaultStyledDocument](DefaultStyledDocument.html "class in javax.swing.text"), [HTMLDocument](html/HTMLDocument.html "class in javax.swing.text.html")


public interface StyledDocumentextends Document

Interface for a generic styled document.

Adds a new style into the logical style hierarchy.
Takes a set of attributes and turn it into a background color specification.
[getCharacterElement](#getCharacterElement%28int%29)(int pos)
Gets the element that represents the character that is at the given offset within the document.
Takes a set of attributes and turn it into a font specification.
Takes a set of attributes and turn it into a foreground color specification.
[getLogicalStyle](#getLogicalStyle%28int%29)(int p)
Gets a logical style for a given position in a paragraph.
[getParagraphElement](#getParagraphElement%28int%29)(int pos)
Gets the element that represents the paragraph that encloses the given offset within the document.
Fetches a named style previously added.
void
Removes a named style previously added to the document.
void
[setCharacterAttributes](#setCharacterAttributes%28int,int,javax.swing.text.AttributeSet,boolean%29)(int offset, int length,[AttributeSet](AttributeSet.html "interface in javax.swing.text") s, boolean replace)
Changes the content element attributes used for the given range of existing content in the document.
void
Sets the logical style to use for the paragraph at the given position.
void
[setParagraphAttributes](#setParagraphAttributes%28int,int,javax.swing.text.AttributeSet,boolean%29)(int offset, int length,[AttributeSet](AttributeSet.html "interface in javax.swing.text") s, boolean replace)
Sets paragraph attributes.

Methods declared in interface javax.swing.text.Document

[addDocumentListener](Document.html#addDocumentListener%28javax.swing.event.DocumentListener%29), [addUndoableEditListener](Document.html#addUndoableEditListener%28javax.swing.event.UndoableEditListener%29), [createPosition](Document.html#createPosition%28int%29), [getDefaultRootElement](Document.html#getDefaultRootElement%28%29), [getEndPosition](Document.html#getEndPosition%28%29), [getLength](Document.html#getLength%28%29), [getProperty](Document.html#getProperty%28java.lang.Object%29), [getRootElements](Document.html#getRootElements%28%29), [getStartPosition](Document.html#getStartPosition%28%29), [getText](Document.html#getText%28int,int%29), [getText](Document.html#getText%28int,int,javax.swing.text.Segment%29), [insertString](Document.html#insertString%28int,java.lang.String,javax.swing.text.AttributeSet%29), [putProperty](Document.html#putProperty%28java.lang.Object,java.lang.Object%29), [remove](Document.html#remove%28int,int%29), [removeDocumentListener](Document.html#removeDocumentListener%28javax.swing.event.DocumentListener%29), [removeUndoableEditListener](Document.html#removeUndoableEditListener%28javax.swing.event.UndoableEditListener%29), [render](Document.html#render%28java.lang.Runnable%29)