JIDE 3.5.15

com.jidesoft.list
Class DefaultPageListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by com.jidesoft.list.AbstractPageListModel
          extended by com.jidesoft.list.DefaultPageListModel
All Implemented Interfaces:
EventFireListModel, ListModelWrapper, PageNavigationSupport, Serializable, EventListener, ListDataListener, ListModel

public class DefaultPageListModel
extends AbstractPageListModel
implements ListModelWrapper, EventFireListModel

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
DefaultPageListModel(ListModel model)
           
DefaultPageListModel(ListModel model, int pageSize)
           
 
Method Summary
protected  CompoundListDataEvent createCompoundListDataEvent()
           
 void fireListDataEvent(ListDataEvent event)
          Fires a ListDataEvent.
 int getActualIndexAt(int visualRow)
          Gets the actual row index in the underlying list that corresponds the specified row index.
 ListModel getActualModel()
          Gets the underlying list model.
 Object getElementAt(int rowIndex)
           
 int getIndexAt(int actualRow)
          Gets the visual row index representing the specified actual row.
 int[] getIndexes()
          Gets the indexes that maps from the visual row index to the actual row index.
 int getTotalRecordCount()
          Gets the total record/row count.
protected  void reallocateIndexes()
           
 void setActualModel(ListModel model)
          Sets the actual list model.
 void setIndexes(int[] indexes)
          Sets the indexes of the row mapping.
 void setTotalRecordCount(int totalRecordCount)
          Sets the total record/row count.
 
Methods inherited from class com.jidesoft.list.AbstractPageListModel
addPageNavigationListener, contentsChanged, firePageNavigationEvent, firstPage, getCurrentPage, getPageCount, getPageNavigationListeners, getPageSize, getSize, intervalAdded, intervalRemoved, lastPage, nextPage, previousPage, removePageNavigationListener, setCurrentPage, setPageCount, setPageSize
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, 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

DefaultPageListModel

public DefaultPageListModel(ListModel model)

DefaultPageListModel

public DefaultPageListModel(ListModel model,
                            int pageSize)
Method Detail

getActualIndexAt

public int getActualIndexAt(int visualRow)
Description copied from interface: ListModelWrapper
Gets the actual row index in the underlying list that corresponds the specified row index.

Specified by:
getActualIndexAt in interface ListModelWrapper
Returns:
the actual row. If the actual row doesn't exist, return -1.

getIndexAt

public int getIndexAt(int actualRow)
Description copied from interface: ListModelWrapper
Gets the visual row index representing the specified actual row.

Specified by:
getIndexAt in interface ListModelWrapper
Returns:
the visual row index. -1 if there is no visual row representing it.

getActualModel

public ListModel getActualModel()
Description copied from interface: ListModelWrapper
Gets the underlying list model.

Specified by:
getActualModel in interface ListModelWrapper
Returns:
the underlying list model.

setActualModel

public void setActualModel(ListModel model)
Description copied from interface: ListModelWrapper
Sets the actual list model.

Specified by:
setActualModel in interface ListModelWrapper
Parameters:
model - the list model.

getIndexes

public int[] getIndexes()
Description copied from interface: ListModelWrapper
Gets the indexes that maps from the visual row index to the actual row index.

Specified by:
getIndexes in interface ListModelWrapper
Returns:
the indexes.

setIndexes

public void setIndexes(int[] indexes)
Description copied from interface: ListModelWrapper
Sets the indexes of the row mapping. We exposed this method to allow quick access to the underlying indexes. The method won't fire any table events. So once you change the indexes, you need to fire corresponding table event so that table can update itself.

Specified by:
setIndexes in interface ListModelWrapper

getElementAt

public Object getElementAt(int rowIndex)
Specified by:
getElementAt in interface ListModel

getTotalRecordCount

public int getTotalRecordCount()
Description copied from interface: PageNavigationSupport
Gets the total record/row count.

Specified by:
getTotalRecordCount in interface PageNavigationSupport
Returns:
the total record/row count.

setTotalRecordCount

public void setTotalRecordCount(int totalRecordCount)
Description copied from interface: PageNavigationSupport
Sets the total record/row count.

Specified by:
setTotalRecordCount in interface PageNavigationSupport
Parameters:
totalRecordCount - the new total row count.

reallocateIndexes

protected void reallocateIndexes()

createCompoundListDataEvent

protected CompoundListDataEvent createCompoundListDataEvent()

fireListDataEvent

public void fireListDataEvent(ListDataEvent event)
Description copied from interface: EventFireListModel
Fires a ListDataEvent.

Specified by:
fireListDataEvent in interface EventFireListModel
Parameters:
event - the event

JIDE 3.5.15