Package com.illumon.iris.gui.list
Class LoadOnScrollListModel<T>
java.lang.Object
javax.swing.AbstractListModel<T>
com.illumon.iris.gui.list.LoadOnScrollListModel<T>
- Type Parameters:
T- the data type
- All Implemented Interfaces:
AdjustmentListener,Serializable,EventListener,ListModel<T>
A model for a JList containing large amounts of data. Sets a Display Size so that only a small slice of the data is
loaded at anyone time. Adjust data displayed on scroll. Supports text search.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractListModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(Collection<T> items) voidaddElement(T element) voidvoidclear()voidintgetElementAt(int index) protected StringgetSearchText(T item) Gets the text used for searching items.intgetSize()intvoidvoidvoidsetNullSearchText(String text) Sets the text to be used to search on null values.Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Constructor Details
-
LoadOnScrollListModel
-
-
Method Details
-
getSize
public int getSize() -
getVisibleSize
public int getVisibleSize() -
getAllSize
public int getAllSize() -
getVisibleItems
-
clear
public void clear() -
addAll
-
getElementAt
- Specified by:
getElementAtin interfaceListModel<T>
-
addElement
-
clearSearch
public void clearSearch() -
search
-
getSearchText
Gets the text used for searching items. Override this method for something other than toString().- Parameters:
item- the item to search- Returns:
- the text to use for the search
-
setNullSearchText
Sets the text to be used to search on null values. By default this is an empty string.- Parameters:
text- the text to search for null values e.g. "null"
-
requestRedraw
public void requestRedraw() -
adjustmentValueChanged
- Specified by:
adjustmentValueChangedin interfaceAdjustmentListener
-