|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jminor.common.model.combobox.DefaultFilteredComboBoxModel<T>
public class DefaultFilteredComboBoxModel<T>
A default FilteredComboBoxModel implementation.
Constructor Summary | |
---|---|
DefaultFilteredComboBoxModel()
Instantiates a new DefaultFilteredComboBoxModel that does not sort its contents and does not include a nullValueItem. |
|
DefaultFilteredComboBoxModel(String nullValueString)
Instantiates a new FilteredComboBoxModel. |
Method Summary | |
---|---|
void |
addFilteringListener(ActionListener listener)
|
void |
addItem(T item)
|
void |
addListDataListener(ListDataListener l)
|
void |
addSelectionListener(ActionListener listener)
|
void |
clear()
Clears all data from this refreshable instance |
boolean |
contains(T item,
boolean includeFiltered)
Returns true if this model contains the given item, visible or filtered. |
void |
filterContents()
Filters the table according to the criteria returned by getFilterCriteria() . |
protected void |
fireContentsChanged()
|
List<T> |
getAllItems()
|
Object |
getElementAt(int index)
|
FilterCriteria<T> |
getFilterCriteria()
Returns the filter criteria defined by this model, this method should return a "accept all" criteria instead of null, if no criteria is defined. |
int |
getFilteredItemCount()
|
List<T> |
getFilteredItems()
|
String |
getNullValueString()
|
Object |
getSelectedItem()
|
int |
getSize()
|
int |
getVisibleItemCount()
|
List<T> |
getVisibleItems()
|
protected List<T> |
initializeContents()
|
boolean |
isCleared()
|
boolean |
isFiltered(T item)
Returns true if the given item is filtered in this combo box model |
boolean |
isNullValueSelected()
|
boolean |
isVisible(T item)
Returns true if the given item is visible in this combo box model |
void |
refresh()
Performs a refresh |
void |
removeFilteringListener(ActionListener listener)
|
void |
removeItem(T item)
Removes the given item from this model |
void |
removeListDataListener(ListDataListener l)
|
void |
removeSelectionListener(ActionListener listener)
|
void |
setContents(Collection<T> contents)
Resets the contents of this model using the values found in contents |
void |
setFilterCriteria(FilterCriteria<T> filterCriteria)
|
void |
setNullValueString(String nullValueString)
Sets the nullValueItem, a refresh is required for it to show up |
void |
setSelectedItem(Object anItem)
|
protected Object |
translateSelectionItem(Object item)
|
protected boolean |
vetoSelectionChange(Object item)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFilteredComboBoxModel()
public DefaultFilteredComboBoxModel(String nullValueString)
nullValueString
- a string representing a null value, which is shown at the top of the item listisNullValueSelected()
Method Detail |
---|
public final void refresh()
refresh
in interface Refreshable
public final void clear()
clear
in interface Refreshable
public final boolean isCleared()
isCleared
in interface FilteredComboBoxModel<T>
public final void setContents(Collection<T> contents)
contents
setContents
in interface FilteredComboBoxModel<T>
contents
- the contents to be used by this modelpublic final void filterContents()
getFilterCriteria()
.
This method does not interfere with the internal ordering of the visible items.
filterContents
in interface FilteredModel<T>
FilteredModel.getFilterCriteria()
,
FilteredModel.addFilteringListener(java.awt.event.ActionListener)
public final List<T> getFilteredItems()
getFilteredItems
in interface FilteredModel<T>
public final List<T> getVisibleItems()
getVisibleItems
in interface FilteredModel<T>
public final void setFilterCriteria(FilterCriteria<T> filterCriteria)
setFilterCriteria
in interface FilteredModel<T>
filterCriteria
- the FilterCriteria to usepublic final FilterCriteria<T> getFilterCriteria()
getFilterCriteria
in interface FilteredModel<T>
FilterCriteria.AcceptAllCriteria
public final List<T> getAllItems()
getAllItems
in interface FilteredModel<T>
public final int getFilteredItemCount()
getFilteredItemCount
in interface FilteredModel<T>
public final int getVisibleItemCount()
getVisibleItemCount
in interface FilteredModel<T>
public final boolean isVisible(T item)
isVisible
in interface FilteredModel<T>
item
- the item
public final boolean isFiltered(T item)
isFiltered
in interface FilteredModel<T>
item
- the item
public final void addItem(T item)
addItem
in interface FilteredComboBoxModel<T>
item
- the item to addpublic final void removeItem(T item)
removeItem
in interface FilteredComboBoxModel<T>
item
- the item to removepublic final boolean contains(T item, boolean includeFiltered)
contains
in interface FilteredModel<T>
item
- the itemincludeFiltered
- if true then the filtered items are included
public final String getNullValueString()
getNullValueString
in interface FilteredComboBoxModel<T>
public final void setNullValueString(String nullValueString)
setNullValueString
in interface FilteredComboBoxModel<T>
nullValueString
- a String representing a null valuepublic final boolean isNullValueSelected()
isNullValueSelected
in interface FilteredComboBoxModel<T>
public final Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
public final void setSelectedItem(Object anItem)
setSelectedItem
in interface ComboBoxModel
public final void addListDataListener(ListDataListener l)
addListDataListener
in interface ListModel
public final void removeListDataListener(ListDataListener l)
removeListDataListener
in interface ListModel
public final Object getElementAt(int index)
getElementAt
in interface ListModel
public final int getSize()
getSize
in interface ListModel
public final void addFilteringListener(ActionListener listener)
addFilteringListener
in interface FilteredModel<T>
listener
- a listener notified each time this model is filteredpublic final void removeFilteringListener(ActionListener listener)
removeFilteringListener
in interface FilteredModel<T>
listener
- the listener to removepublic final void addSelectionListener(ActionListener listener)
addSelectionListener
in interface FilteredComboBoxModel<T>
listener
- a listener notified each time the selection changespublic final void removeSelectionListener(ActionListener listener)
removeSelectionListener
in interface FilteredComboBoxModel<T>
listener
- a selection listener to removeprotected List<T> initializeContents()
protected boolean vetoSelectionChange(Object item)
protected Object translateSelectionItem(Object item)
protected final void fireContentsChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |