|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList
public class AutoCompletionList
AutoCompletionList manages a list of AutoCompletionListItem
s.
The list is sorted, items with higher priority first, then according to lexicographic order
on the value of the AutoCompletionListItem
.
AutoCompletionList maintains two views on the list of AutoCompletionListItem
s.
AbstractTableModel
which serves the list of filtered
items to a JTable
.
Field Summary | |
---|---|
private java.lang.String |
filter
the filter expression |
private java.util.ArrayList<AutoCompletionListItem> |
filtered
the filtered list of AutoCompletionItems |
private java.util.ArrayList<AutoCompletionListItem> |
list
the bare list of AutoCompletionItems |
private java.util.Map<java.lang.String,AutoCompletionListItem> |
valutToItemMap
map from value to priority |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
AutoCompletionList()
constructor |
Method Summary | |
---|---|
void |
add(AutoCompletionList other)
adds another AutoCompletionList to this list. |
void |
add(AutoCompletionListItem item)
adds an AutoCompletionListItem to the list. |
void |
add(java.util.Collection<java.lang.String> values,
AutoCompletionItemPritority priority)
adds a list of strings to this list. |
void |
add(java.util.List<AutoCompletionListItem> other)
adds a list of AutoCompletionListItem to this list. |
protected void |
appendOrUpdatePriority(AutoCompletionListItem toAdd)
|
void |
applyFilter(java.lang.String filter)
applies a filter expression to the list of AutoCompletionListItem s. |
void |
clear()
removes all elements from the auto completion list |
void |
clearFilter()
clears the current filter |
boolean |
contains(AutoCompletionListItem item)
checks whether a specific item is already in the list. |
boolean |
contains(java.lang.String value)
checks whether an item with the given value is already in the list. |
void |
dump()
|
protected void |
filter()
|
int |
getColumnCount()
|
java.lang.String |
getFilter()
|
AutoCompletionListItem |
getFilteredItem(int idx)
replies the idx-th item from the list of filtered items |
int |
getFilteredSize()
replies the number of filtered items |
(package private) java.util.ArrayList<AutoCompletionListItem> |
getList()
|
int |
getRowCount()
|
(package private) java.util.List<AutoCompletionListItem> |
getUnmodifiableList()
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
|
void |
remove(java.lang.String key)
removes the auto completion item with key key |
protected void |
sort()
sorts the list |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.ArrayList<AutoCompletionListItem> list
private java.util.ArrayList<AutoCompletionListItem> filtered
private java.lang.String filter
private java.util.Map<java.lang.String,AutoCompletionListItem> valutToItemMap
Constructor Detail |
---|
public AutoCompletionList()
Method Detail |
---|
public void applyFilter(java.lang.String filter)
AutoCompletionListItem
s.
The matching criterion is a case insensitive substring match.
filter
- the filter expression; must not be null
java.lang.IllegalArgumentException
- thrown, if filter is nullpublic void clearFilter()
public java.lang.String getFilter()
public void add(AutoCompletionListItem item)
item
- the itempublic void add(AutoCompletionList other)
other
- another auto completion list; must not be null
java.lang.IllegalArgumentException
- thrown, if other is nullpublic void add(java.util.List<AutoCompletionListItem> other)
other
- a list of AutoCompletionListItem; must not be null
java.lang.IllegalArgumentException
- thrown, if other is nullpublic void add(java.util.Collection<java.lang.String> values, AutoCompletionItemPritority priority)
value
- a list of strings to addpriority
- the priority to useprotected void appendOrUpdatePriority(AutoCompletionListItem toAdd)
public boolean contains(AutoCompletionListItem item)
item
- the item to check
public boolean contains(java.lang.String value)
value
- the value of an auto completion item
public void remove(java.lang.String key)
key
key
- the key;protected void sort()
protected void filter()
public int getFilteredSize()
public AutoCompletionListItem getFilteredItem(int idx)
idx
- the index; must be in the range 0<= idx < getFilteredSize()
java.lang.IndexOutOfBoundsException
- thrown, if idx is out of boundsjava.util.ArrayList<AutoCompletionListItem> getList()
java.util.List<AutoCompletionListItem> getUnmodifiableList()
public void clear()
public int getColumnCount()
public int getRowCount()
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
public void dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |