|
swingx Version 2009-07-31 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.autocomplete.AutoCompleteDocument
public class AutoCompleteDocument
A document that can be plugged into any JTextComponent to enable automatic completion. It finds and selects matching items using any implementation of the AbstractAutoCompleteAdaptor.
Field Summary | |
---|---|
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) |
Fields inherited from interface javax.swing.text.Document |
---|
StreamDescriptionProperty, TitleProperty |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean strictMatching
protected final Document delegate
Constructor Detail |
---|
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.Method Detail |
---|
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 int getLength()
getLength
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 void render(Runnable r)
render
in interface Document
public boolean isStrictMatching()
|
swingx Version 2009-07-31 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |