|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
org.springframework.richclient.list.AbstractFilteredListModel
org.springframework.richclient.list.FilteredListModel
public class FilteredListModel
Decorates an existing ListModel by applying a constraint. The constraint can implement Observable to
notify a change of the filter condition.
| Field Summary |
|---|
| Fields inherited from class org.springframework.richclient.list.AbstractFilteredListModel |
|---|
filteredModel, logger |
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
FilteredListModel(ListModel listModel,
Constraint constraint)
Constructs a new instance |
|
| Method Summary | |
|---|---|
void |
contentsChanged(ListDataEvent e)
|
protected void |
fireContentsChanged(Object source,
int index0,
int index1)
|
Constraint |
getConstraint()
|
int |
getElementIndex(int filteredIndex)
Returns the element index for a filtered index |
int |
getSize()
Returns the size of the elements which passes the filter constraint. |
void |
intervalAdded(ListDataEvent e)
|
void |
intervalRemoved(ListDataEvent e)
|
protected void |
onMatchingElement(Object element)
Called to notify that an element has matched the filter constraint. |
protected void |
postConstraintApplied()
Called to notify that the constraint was applied to all elements. |
protected void |
reallocateIndexes()
Internally called to reallocate the indexes. |
void |
setConstraint(Constraint constraint)
Defines the constraint which is applied to the list model elements |
void |
update(Observable changed,
Object arg)
If the constraint implements Observable this method is called and will apply the constraint to the list
model elements |
| Methods inherited from class org.springframework.richclient.list.AbstractFilteredListModel |
|---|
getElementAt, getFilteredModel, setFilteredModel |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilteredListModel(ListModel listModel,
Constraint constraint)
listModel - the list model to filter.constraint - the constraint which is applied to the list model elements
IllegalArgumentException - if list model or constraint parameters where null| Method Detail |
|---|
protected void fireContentsChanged(Object source,
int index0,
int index1)
fireContentsChanged in class AbstractListModelpublic final void setConstraint(Constraint constraint)
constraint - the constraint to set
IllegalArgumentException - if constraint is nullpublic Constraint getConstraint()
protected void reallocateIndexes()
public void update(Observable changed,
Object arg)
Observable this method is called and will apply the constraint to the list
model elements
update in interface Observerprotected void onMatchingElement(Object element)
element - the element which was accepted by the filterprotected void postConstraintApplied()
public int getSize()
getSize in interface ListModelgetSize in class AbstractFilteredListModelpublic int getElementIndex(int filteredIndex)
getElementIndex in class AbstractFilteredListModelfilteredIndex - the filtered index
public void contentsChanged(ListDataEvent e)
contentsChanged in interface ListDataListenercontentsChanged in class AbstractFilteredListModelpublic void intervalAdded(ListDataEvent e)
intervalAdded in interface ListDataListenerintervalAdded in class AbstractFilteredListModelpublic void intervalRemoved(ListDataEvent e)
intervalRemoved in interface ListDataListenerintervalRemoved in class AbstractFilteredListModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||