org.jminor.common.model
Interface FilteredModel<T>

Type Parameters:
T - the type of data in the model.
All Known Subinterfaces:
EntityComboBoxModel, EntityTableModel, FilteredComboBoxModel<T>, FilteredTableModel<R,C>
All Known Implementing Classes:
AbstractFilteredTableModel, DefaultEntityComboBoxModel, DefaultEntityTableModel, DefaultFilteredComboBoxModel, DefaultPropertyComboBoxModel

public interface FilteredModel<T>

Specifies a data model that can be filtered.


Method Summary
 void addFilteringListener(ActionListener listener)
           
 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().
 List<T> getAllItems()
           
 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()
           
 int getVisibleItemCount()
           
 List<T> getVisibleItems()
           
 boolean isFiltered(T item)
          Returns true if the given item is filtered in this combo box model
 boolean isVisible(T item)
          Returns true if the given item is visible in this combo box model
 void removeFilteringListener(ActionListener listener)
           
 void setFilterCriteria(FilterCriteria<T> filterCriteria)
           
 

Method Detail

addFilteringListener

void addFilteringListener(ActionListener listener)
Parameters:
listener - a listener notified each time this model is filtered

removeFilteringListener

void removeFilteringListener(ActionListener listener)
Parameters:
listener - the listener to remove

filterContents

void filterContents()
Filters the table according to the criteria returned by getFilterCriteria(). This method does not interfere with the internal ordering of the visible items.

See Also:
getFilterCriteria(), addFilteringListener(java.awt.event.ActionListener)

getFilterCriteria

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.

Returns:
the filter criteria
See Also:
FilterCriteria.AcceptAllCriteria

setFilterCriteria

void setFilterCriteria(FilterCriteria<T> filterCriteria)
Parameters:
filterCriteria - the FilterCriteria to use

getVisibleItems

List<T> getVisibleItems()
Returns:
an unmodifiable view of the visible items

getFilteredItems

List<T> getFilteredItems()
Returns:
an unmodifiable view of the filtered items

getAllItems

List<T> getAllItems()
Returns:
all visible and filtered items in this table model

getVisibleItemCount

int getVisibleItemCount()
Returns:
the number of currently visible items

getFilteredItemCount

int getFilteredItemCount()
Returns:
the number of currently filtered items

contains

boolean contains(T item,
                 boolean includeFiltered)
Returns true if this model contains the given item, visible or filtered.

Parameters:
item - the item
includeFiltered - if true then the filtered items are included
Returns:
true if this combo box model contains the item

isVisible

boolean isVisible(T item)
Returns true if the given item is visible in this combo box model

Parameters:
item - the item
Returns:
true if the given item is visible

isFiltered

boolean isFiltered(T item)
Returns true if the given item is filtered in this combo box model

Parameters:
item - the item
Returns:
true if the given item is filtered