|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractListModel javax.swing.DefaultComboBoxModel org.xnap.gui.component.DefaultCompletionModel
public class DefaultCompletionModel
The DefaultComboBoxModel uses a ternary search tree for completion.
Field Summary |
---|
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
DefaultCompletionModel()
Constructs a new model with no items. |
|
DefaultCompletionModel(java.lang.Object[] items)
Constructs a new model using the given items for completion. |
|
DefaultCompletionModel(java.lang.Object[] items,
boolean sorted)
Constructs a new model using the given items for completion. |
Method Summary | |
---|---|
boolean |
complete(java.lang.String prefix)
Finds possible completions for a prefix. |
java.lang.String |
completeUniquePrefix(java.lang.String prefix)
Returns largest common prefix of all possible completions for the given prefix. |
void |
insert(java.lang.Object object)
Adds an object to the completion tree. |
void |
remove(java.lang.Object object)
Removes an object from the completion model. |
Methods inherited from class javax.swing.DefaultComboBoxModel |
---|
addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAt, setSelectedItem |
Methods inherited from class javax.swing.AbstractListModel |
---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.MutableComboBoxModel |
---|
addElement, insertElementAt, removeElement, removeElementAt |
Methods inherited from interface javax.swing.ComboBoxModel |
---|
getSelectedItem, setSelectedItem |
Methods inherited from interface javax.swing.ListModel |
---|
addListDataListener, getElementAt, getSize, removeListDataListener |
Constructor Detail |
---|
public DefaultCompletionModel()
public DefaultCompletionModel(java.lang.Object[] items)
items
- the objects used for completionpublic DefaultCompletionModel(java.lang.Object[] items, boolean sorted)
items
- the array of objects used for completionsorted
- whether the array of items is sorted or notMethod Detail |
---|
public boolean complete(java.lang.String prefix)
CompletionModel
MutableComboBoxModel
.
complete
in interface CompletionModel
prefix
- the prefix being matched
public java.lang.String completeUniquePrefix(java.lang.String prefix)
CompletionModel
completeUniquePrefix
in interface CompletionModel
prefix
- the prefix being matched
public void insert(java.lang.Object object)
insert
in interface CompletionModel
object
- the object which is completed using its Object.toString()
methodpublic void remove(java.lang.Object object)
CompletionModel
remove
in interface CompletionModel
object
- the object to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |