Package org.cesilko.rachota.gui
Class CompletionListModel
java.lang.Object
javax.swing.AbstractListModel
org.cesilko.rachota.gui.CompletionListModel
- All Implemented Interfaces:
Serializable
,ListModel
Model that takes care of current list of completion items.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Vector
List of items that are suggested in completion window.Fields inherited from class javax.swing.AbstractListModel
listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetElementAt
(int index) Returns completion item at given index.int
getSize()
Returns number of completion items.void
Sets completion items to given list.private Vector
Returns list of completion item sorted alphabetically.Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Field Details
-
completionItems
Vector completionItemsList of items that are suggested in completion window.
-
-
Constructor Details
-
CompletionListModel
public CompletionListModel()
-
-
Method Details
-
getSize
public int getSize()Returns number of completion items.- Returns:
- Number of completion items.
-
getElementAt
Returns completion item at given index.- Parameters:
index
- Index whose completion item should be returned.- Returns:
- Completion item at given index.
-
setItems
Sets completion items to given list.- Parameters:
items
- Vector of new completion items to be used from now.
-
sortItems
Returns list of completion item sorted alphabetically.- Parameters:
items
- Completion items that should be sorted alphabetically.- Returns:
- Sorted list of completion items.
-