|
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 document
public 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 strings
public 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 DocumentBadLocationException
public 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 Document
public Position createPosition(int offs)
throws BadLocationException
createPosition in interface DocumentBadLocationExceptionpublic Element getDefaultRootElement()
getDefaultRootElement in interface Documentpublic Position getEndPosition()
getEndPosition in interface Documentpublic int getLength()
getLength in interface Documentpublic Object getProperty(Object key)
getProperty in interface Documentpublic Element[] getRootElements()
getRootElements in interface Documentpublic Position getStartPosition()
getStartPosition in interface Document
public String getText(int offset,
int length)
throws BadLocationException
getText in interface DocumentBadLocationException
public void getText(int offset,
int length,
Segment txt)
throws BadLocationException
getText in interface DocumentBadLocationException
public 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 void render(Runnable r)
render in interface Documentpublic boolean isStrictMatching()
|
swingx Version 2009-07-31 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||