org.xnap.gui.component
Interface CompletionModel

All Superinterfaces:
javax.swing.ComboBoxModel, javax.swing.ListModel, javax.swing.MutableComboBoxModel
All Known Implementing Classes:
DefaultCompletionModel, FileCompletionModel

public interface CompletionModel
extends javax.swing.MutableComboBoxModel


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)
          Inserts an object for later completion, matching is done using its Object.toString() method.
 void remove(java.lang.Object object)
          Removes an object from the completion model.
 
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
 

Method Detail

insert

void insert(java.lang.Object object)
Inserts an object for later completion, matching is done using its Object.toString() method.

Parameters:
object - the object to be added

remove

void remove(java.lang.Object object)
Removes an object from the completion model.

Parameters:
object - the object to be removed

complete

boolean complete(java.lang.String prefix)
Finds possible completions for a prefix. As a side effect the completions are added to the MutableComboBoxModel.

Parameters:
prefix - the prefix being matched
Returns:
true, if completion was successful, i.e. the prefix matches at least one item in the model

completeUniquePrefix

java.lang.String completeUniquePrefix(java.lang.String prefix)
Returns largest common prefix of all possible completions for the given prefix.

Parameters:
prefix - the prefix being matched
Returns:
the largest common prefix of all possible matches


Copyright © 2001-2005 XNap Team. All Rights Reserved.