public class AutoCompleteDocument extends Object implements Document
| Modifier and Type | Field and Description |
|---|---|
protected Document |
delegate |
protected boolean |
strictMatching
true, if only items from the adaptors's list can be entered
false, otherwise (selected item might not be in the adaptors's list)
|
StreamDescriptionProperty, TitleProperty| 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,
Document delegate)
Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDocumentListener(DocumentListener listener) |
void |
addUndoableEditListener(UndoableEditListener listener) |
protected Document |
createDefaultDocument()
Creates the default backing document when no delegate is passed to this
document.
|
Position |
createPosition(int offs) |
Element |
getDefaultRootElement() |
Position |
getEndPosition() |
int |
getLength() |
Object |
getProperty(Object key) |
Element[] |
getRootElements() |
Position |
getStartPosition() |
String |
getText(int offset,
int length) |
void |
getText(int offset,
int length,
Segment txt) |
void |
insertString(int offs,
String str,
AttributeSet a) |
boolean |
isStrictMatching()
Returns if only items from the adaptor's list should be allowed to be entered.
|
void |
putProperty(Object key,
Object value) |
void |
remove(int offs,
int len) |
void |
removeDocumentListener(DocumentListener listener) |
void |
removeUndoableEditListener(UndoableEditListener listener) |
void |
render(Runnable r) |
protected boolean strictMatching
protected final Document delegate
public AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter, 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.protected Document createDefaultDocument()
public void remove(int offs,
int len)
throws BadLocationException
remove in interface DocumentBadLocationExceptionpublic void insertString(int offs,
String str,
AttributeSet a)
throws BadLocationException
insertString in interface DocumentBadLocationExceptionpublic void addDocumentListener(DocumentListener listener)
addDocumentListener in interface Documentpublic void addUndoableEditListener(UndoableEditListener listener)
addUndoableEditListener in interface Documentpublic Position createPosition(int offs) throws BadLocationException
createPosition in interface DocumentBadLocationExceptionpublic Element getDefaultRootElement()
getDefaultRootElement in interface Documentpublic Position getEndPosition()
getEndPosition in interface Documentpublic Object getProperty(Object key)
getProperty in interface Documentpublic Element[] getRootElements()
getRootElements in interface Documentpublic Position getStartPosition()
getStartPosition in interface Documentpublic String getText(int offset, int length) throws BadLocationException
getText in interface DocumentBadLocationExceptionpublic void getText(int offset,
int length,
Segment txt)
throws BadLocationException
getText in interface DocumentBadLocationExceptionpublic void putProperty(Object key, Object value)
putProperty in interface Documentpublic void removeDocumentListener(DocumentListener listener)
removeDocumentListener in interface Documentpublic void removeUndoableEditListener(UndoableEditListener listener)
removeUndoableEditListener in interface Documentpublic boolean isStrictMatching()
Copyright © 2017. All Rights Reserved.