Package org.cesilko.rachota.gui
Class CompletionListModel
- java.lang.Object
-
- javax.swing.AbstractListModel
-
- org.cesilko.rachota.gui.CompletionListModel
-
- All Implemented Interfaces:
java.io.Serializable,javax.swing.ListModel
public class CompletionListModel extends javax.swing.AbstractListModelModel that takes care of current list of completion items.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.VectorcompletionItemsList of items that are suggested in completion window.
-
Constructor Summary
Constructors Constructor Description CompletionListModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetElementAt(int index)Returns completion item at given index.intgetSize()Returns number of completion items.voidsetItems(java.util.Vector items)Sets completion items to given list.private java.util.VectorsortItems(java.util.Vector items)Returns list of completion item sorted alphabetically.
-
-
-
Method Detail
-
getSize
public int getSize()
Returns number of completion items.- Returns:
- Number of completion items.
-
getElementAt
public java.lang.Object getElementAt(int index)
Returns completion item at given index.- Parameters:
index- Index whose completion item should be returned.- Returns:
- Completion item at given index.
-
setItems
public void setItems(java.util.Vector items)
Sets completion items to given list.- Parameters:
items- Vector of new completion items to be used from now.
-
sortItems
private java.util.Vector sortItems(java.util.Vector items)
Returns list of completion item sorted alphabetically.- Parameters:
items- Completion items that should be sorted alphabetically.- Returns:
- Sorted list of completion items.
-
-