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 Document
BadLocationException
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException
insertString
in interface Document
BadLocationException
public void addDocumentListener(DocumentListener listener)
addDocumentListener
in interface Document
public void addUndoableEditListener(UndoableEditListener listener)
addUndoableEditListener
in interface Document
public Position createPosition(int offs) throws BadLocationException
createPosition
in interface Document
BadLocationException
public Element getDefaultRootElement()
getDefaultRootElement
in interface Document
public Position getEndPosition()
getEndPosition
in interface Document
public Object getProperty(Object key)
getProperty
in interface Document
public Element[] getRootElements()
getRootElements
in interface Document
public Position getStartPosition()
getStartPosition
in interface Document
public String getText(int offset, int length) throws BadLocationException
getText
in interface Document
BadLocationException
public void getText(int offset, int length, Segment txt) throws BadLocationException
getText
in interface Document
BadLocationException
public void putProperty(Object key, Object value)
putProperty
in interface Document
public void removeDocumentListener(DocumentListener listener)
removeDocumentListener
in interface Document
public void removeUndoableEditListener(UndoableEditListener listener)
removeUndoableEditListener
in interface Document
public boolean isStrictMatching()
Copyright © 2013. All rights reserved.