Example usage for Java javax.swing.text StyledDocument fields, constructors, methods, implement or subclass
The text is from its open source code.
Style | addStyle(String nm, Style parent) Adds a new style into the logical style hierarchy. |
Element | getCharacterElement(int pos) Gets the element that represents the character that is at the given offset within the document. |
Color | getForeground(AttributeSet attr) Takes a set of attributes and turn it into a foreground color specification. |
int | getLength() Returns number of characters of content currently in the document. |
Element | getParagraphElement(int pos) Gets the element that represents the paragraph that encloses the given offset within the document. |
Element[] | getRootElements() Returns all of the root elements that are defined. |
Style | getStyle(String nm) Fetches a named style previously added. |
String | getText(int offset, int length) Fetches the text contained within the given portion of the document. |
void | insertString(int offset, String str, AttributeSet a) Inserts a string of content. |
void | putProperty(Object key, Object value) Associates a property with the document. |
void | remove(int offs, int len) Removes a portion of the content of the document. |
void | setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace) Changes the content element attributes used for the given range of existing content in the document. |
void | setLogicalStyle(int pos, Style s) Sets the logical style to use for the paragraph at the given position. |
void | setParagraphAttributes(int offset, int length, AttributeSet s, boolean replace) Sets paragraph attributes. |