public class AutoCompleteDocument
extends java.lang.Object
implements javax.swing.text.StyledDocument
| Constructor and Description |
|---|
AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor,
boolean strictMatching)
Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.
|
AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor,
boolean strictMatching,
ObjectToStringConverter stringConverter)
Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.
|
AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor,
boolean strictMatching,
ObjectToStringConverter stringConverter,
javax.swing.text.Document delegate)
Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDocumentListener(javax.swing.event.DocumentListener listener) |
javax.swing.text.Style |
addStyle(java.lang.String nm,
javax.swing.text.Style parent) |
void |
addUndoableEditListener(javax.swing.event.UndoableEditListener listener) |
javax.swing.text.Position |
createPosition(int offs) |
java.awt.Color |
getBackground(javax.swing.text.AttributeSet attr) |
javax.swing.text.Element |
getCharacterElement(int pos) |
javax.swing.text.Element |
getDefaultRootElement() |
javax.swing.text.Position |
getEndPosition() |
java.awt.Font |
getFont(javax.swing.text.AttributeSet attr) |
java.awt.Color |
getForeground(javax.swing.text.AttributeSet attr) |
int |
getLength() |
javax.swing.text.Style |
getLogicalStyle(int p) |
javax.swing.text.Element |
getParagraphElement(int pos) |
java.lang.Object |
getProperty(java.lang.Object key) |
javax.swing.text.Element[] |
getRootElements() |
javax.swing.text.Position |
getStartPosition() |
javax.swing.text.Style |
getStyle(java.lang.String nm) |
java.lang.String |
getText(int offset,
int length) |
void |
getText(int offset,
int length,
javax.swing.text.Segment txt) |
void |
insertString(int offs,
java.lang.String str,
javax.swing.text.AttributeSet a) |
boolean |
isStrictMatching()
Returns if only items from the adaptor's list should be allowed to be entered.
|
void |
putProperty(java.lang.Object key,
java.lang.Object value) |
void |
remove(int offs,
int len) |
void |
removeDocumentListener(javax.swing.event.DocumentListener listener) |
void |
removeStyle(java.lang.String nm) |
void |
removeUndoableEditListener(javax.swing.event.UndoableEditListener listener) |
void |
render(java.lang.Runnable r) |
void |
setCharacterAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace) |
void |
setLogicalStyle(int pos,
javax.swing.text.Style s) |
void |
setParagraphAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace) |
public AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter, javax.swing.text.Document delegate)
adaptor - The adaptor that will be used to find and select matching
items.strictMatching - true, if only items from the adaptor's list should
be allowed to be enteredstringConverter - the converter used to transform items to stringsdelegate - the Document delegate backing this documentpublic AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter)
adaptor - The adaptor that will be used to find and select matching
items.strictMatching - true, if only items from the adaptor's list should
be allowed to be enteredstringConverter - the converter used to transform items to stringspublic AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching)
strictMatching - true, if only items from the adaptor's list should
be allowed to be enteredadaptor - The adaptor that will be used to find and select matching
items.public boolean isStrictMatching()
public void remove(int offs,
int len)
throws javax.swing.text.BadLocationException
remove in interface javax.swing.text.Documentjavax.swing.text.BadLocationExceptionpublic void insertString(int offs,
java.lang.String str,
javax.swing.text.AttributeSet a)
throws javax.swing.text.BadLocationException
insertString in interface javax.swing.text.Documentjavax.swing.text.BadLocationExceptionpublic javax.swing.text.Style addStyle(java.lang.String nm,
javax.swing.text.Style parent)
addStyle in interface javax.swing.text.StyledDocumentpublic java.awt.Color getBackground(javax.swing.text.AttributeSet attr)
getBackground in interface javax.swing.text.StyledDocumentpublic javax.swing.text.Element getCharacterElement(int pos)
getCharacterElement in interface javax.swing.text.StyledDocumentpublic java.awt.Font getFont(javax.swing.text.AttributeSet attr)
getFont in interface javax.swing.text.StyledDocumentpublic java.awt.Color getForeground(javax.swing.text.AttributeSet attr)
getForeground in interface javax.swing.text.StyledDocumentpublic javax.swing.text.Style getLogicalStyle(int p)
getLogicalStyle in interface javax.swing.text.StyledDocumentpublic javax.swing.text.Element getParagraphElement(int pos)
getParagraphElement in interface javax.swing.text.StyledDocumentpublic javax.swing.text.Style getStyle(java.lang.String nm)
getStyle in interface javax.swing.text.StyledDocumentpublic void removeStyle(java.lang.String nm)
removeStyle in interface javax.swing.text.StyledDocumentpublic void setCharacterAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace)
setCharacterAttributes in interface javax.swing.text.StyledDocumentpublic void setLogicalStyle(int pos,
javax.swing.text.Style s)
setLogicalStyle in interface javax.swing.text.StyledDocumentpublic void setParagraphAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace)
setParagraphAttributes in interface javax.swing.text.StyledDocumentpublic void addDocumentListener(javax.swing.event.DocumentListener listener)
addDocumentListener in interface javax.swing.text.Documentpublic void addUndoableEditListener(javax.swing.event.UndoableEditListener listener)
addUndoableEditListener in interface javax.swing.text.Documentpublic javax.swing.text.Position createPosition(int offs)
throws javax.swing.text.BadLocationException
createPosition in interface javax.swing.text.Documentjavax.swing.text.BadLocationExceptionpublic javax.swing.text.Element getDefaultRootElement()
getDefaultRootElement in interface javax.swing.text.Documentpublic javax.swing.text.Position getEndPosition()
getEndPosition in interface javax.swing.text.Documentpublic int getLength()
getLength in interface javax.swing.text.Documentpublic java.lang.Object getProperty(java.lang.Object key)
getProperty in interface javax.swing.text.Documentpublic javax.swing.text.Element[] getRootElements()
getRootElements in interface javax.swing.text.Documentpublic javax.swing.text.Position getStartPosition()
getStartPosition in interface javax.swing.text.Documentpublic java.lang.String getText(int offset,
int length)
throws javax.swing.text.BadLocationException
getText in interface javax.swing.text.Documentjavax.swing.text.BadLocationExceptionpublic void getText(int offset,
int length,
javax.swing.text.Segment txt)
throws javax.swing.text.BadLocationException
getText in interface javax.swing.text.Documentjavax.swing.text.BadLocationExceptionpublic void putProperty(java.lang.Object key,
java.lang.Object value)
putProperty in interface javax.swing.text.Documentpublic void removeDocumentListener(javax.swing.event.DocumentListener listener)
removeDocumentListener in interface javax.swing.text.Documentpublic void removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)
removeUndoableEditListener in interface javax.swing.text.Documentpublic void render(java.lang.Runnable r)
render in interface javax.swing.text.Document