T
- the type of the combo box model elementspublic interface FilteredComboBoxModel<T> extends FilteredModel<T>, Refreshable
Modifier and Type | Method and Description |
---|---|
void |
addItem(T item)
Adds the given item to this model, respecting the sorting order if specified
|
void |
addSelectionListener(EventDataListener<T> listener) |
T |
getElementAt(int index) |
T |
getNullValue() |
T |
getSelectedItem() |
T |
getSelectedValue() |
int |
getSize() |
java.util.Comparator<T> |
getSortComparator() |
boolean |
isCleared() |
boolean |
isFilterSelectedItem()
Specifies whether or not filtering can change the selected item, if true then
the selected item is set to null when the currently selected item is filtered
from the model, otherwise the selected item can potentially represent a value
which is not currently visible in the model.
|
boolean |
isNullValueSelected()
Returns true if the value representing null is selected, false if no such value has been
specified or if it is not selected.
|
boolean |
isSelectionEmpty() |
void |
removeItem(T item)
Removes the given item from this model
|
void |
removeSelectionListener(EventDataListener listener) |
void |
setContents(java.util.Collection<T> contents)
Resets the contents of this model using the values found in
contents ,
if contents is null then the model is considered to be cleared. |
void |
setFilterSelectedItem(boolean value)
Specifies whether or not filtering can change the selected item, if true then
the selected item is set to null when the currently selected item is filtered
from the model, otherwise the selected item can potentially represent a value
which is not currently visible in the model.
|
void |
setNullValue(T nullValue)
Sets the value which should represent a null value, a refresh is required for it to show up
|
void |
setSelectedItem(java.lang.Object item) |
void |
setSortComparator(java.util.Comparator<T> sortComparator)
Sets the Comparator used when sorting the items visible in this model and sorts the model accordingly.
|
addFilteringListener, contains, filterContents, getAllItems, getFilterCondition, getFilteredItemCount, getFilteredItems, getVisibleItemCount, getVisibleItems, isFiltered, isVisible, removeFilteringListener, setFilterCondition
clear, refresh
void addSelectionListener(EventDataListener<T> listener)
listener
- a listener notified each time the selection changesvoid removeSelectionListener(EventDataListener listener)
listener
- a selection listener to removevoid setContents(java.util.Collection<T> contents)
contents
,
if contents is null then the model is considered to be cleared.contents
- the contents to display in this combo box modelisCleared()
void addItem(T item)
item
- the item to addvoid removeItem(T item)
item
- the item to removeboolean isCleared()
boolean isSelectionEmpty()
boolean isNullValueSelected()
setNullValue(Object)
T getSelectedValue()
setNullValue(Object)
void setSortComparator(java.util.Comparator<T> sortComparator)
nullValueString
is specified.
If a null sortComparator
is provided no sorting will be performed.sortComparator
- the Comparator, null if the contents of this model should not be sortedjava.util.Comparator<T> getSortComparator()
void setNullValue(T nullValue)
nullValue
- a value which is used to represent a null valueT getNullValue()
void setFilterSelectedItem(boolean value)
value
- if true then the selected item is changed when it is filtered out,boolean isFilterSelectedItem()
void setSelectedItem(java.lang.Object item)
item
- the item to selectint getSize()
T getElementAt(int index)
index
- the indexT getSelectedItem()