|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.autocomplete.AutoCompleteDocument
org.jdesktop.swingx.autocomplete.AutoCompleteStyledDocument
public class AutoCompleteStyledDocument
Field Summary |
---|
Fields inherited from class org.jdesktop.swingx.autocomplete.AutoCompleteDocument |
---|
delegate, strictMatching |
Fields inherited from interface javax.swing.text.Document |
---|
StreamDescriptionProperty, TitleProperty |
Constructor Summary | |
---|---|
AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor,
boolean strictMatching)
|
|
AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor,
boolean strictMatching,
ObjectToStringConverter stringConverter)
|
|
AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor,
boolean strictMatching,
ObjectToStringConverter stringConverter,
StyledDocument delegate)
|
Method Summary | |
---|---|
Style |
addStyle(String nm,
Style parent)
Adds a new style into the logical style hierarchy. |
protected Document |
createDefaultDocument()
Creates the default backing document when no delegate is passed to this document. |
Color |
getBackground(AttributeSet attr)
Takes a set of attributes and turn it into a background color specification. |
Element |
getCharacterElement(int pos)
Gets the element that represents the character that is at the given offset within the document. |
Font |
getFont(AttributeSet attr)
Takes a set of attributes and turn it into a font specification. |
Color |
getForeground(AttributeSet attr)
Takes a set of attributes and turn it into a foreground color specification. |
Style |
getLogicalStyle(int p)
Gets a logical style for a given position in a paragraph. |
Element |
getParagraphElement(int pos)
Gets the element that represents the paragraph that encloses the given offset within the document. |
Style |
getStyle(String nm)
Fetches a named style previously added. |
void |
removeStyle(String nm)
Removes a named style previously added to 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. |
Methods inherited from class org.jdesktop.swingx.autocomplete.AutoCompleteDocument |
---|
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, isStrictMatching, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.text.Document |
---|
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
Constructor Detail |
---|
public AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter, StyledDocument delegate)
adaptor
- strictMatching
- stringConverter
- delegate
- public AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter)
adaptor
- strictMatching
- stringConverter
- public AutoCompleteStyledDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching)
adaptor
- strictMatching
- Method Detail |
---|
protected Document createDefaultDocument()
createDefaultDocument
in class AutoCompleteDocument
public Style addStyle(String nm, Style parent)
addStyle
in interface StyledDocument
nm
- the 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.parent
- the parent style. This may be null if unspecified
attributes need not be resolved in some other style.
public Color getBackground(AttributeSet attr)
getBackground
in interface StyledDocument
attr
- the set of attributes
public Element getCharacterElement(int pos)
getCharacterElement
in interface StyledDocument
pos
- the offset >= 0
public Font getFont(AttributeSet attr)
getFont
in interface StyledDocument
attr
- the set of attributes
public Color getForeground(AttributeSet attr)
getForeground
in interface StyledDocument
attr
- the set of attributes
public Style getLogicalStyle(int p)
getLogicalStyle
in interface StyledDocument
p
- the position >= 0
public Element getParagraphElement(int pos)
getParagraphElement
in interface StyledDocument
pos
- the offset >= 0
public Style getStyle(String nm)
getStyle
in interface StyledDocument
nm
- the name of the style
public void removeStyle(String nm)
removeStyle
in interface StyledDocument
nm
- the name of the style to removepublic void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)
setCharacterAttributes
in interface StyledDocument
offset
- the start of the change >= 0length
- the length of the change >= 0s
- the non-null attributes to change to. Any attributes
defined will be applied to the text for the given range.replace
- indicates whether or not the previous
attributes should be cleared before the new attributes
as set. If true, the operation will replace the
previous attributes entirely. If false, the new
attributes will be merged with the previous attributes.public void setLogicalStyle(int pos, Style s)
setLogicalStyle
in interface StyledDocument
pos
- the starting position >= 0s
- the style to setpublic void setParagraphAttributes(int offset, int length, AttributeSet s, boolean replace)
setParagraphAttributes
in interface StyledDocument
offset
- the start of the change >= 0length
- the length of the change >= 0s
- the non-null attributes to change to. Any attributes
defined will be applied to the text for the given range.replace
- indicates whether or not the previous
attributes should be cleared before the new attributes
are set. If true, the operation will replace the
previous attributes entirely. If false, the new
attributes will be merged with the previous attributes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |