|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.jidesoft.grid.AbstractPageTableModel
com.jidesoft.grid.DefaultPageTableModel
public class DefaultPageTableModel
DefaultPageTableModel extends AbstractPageTableModel to provide a default implementation
for PageNavigationSupport. It uses the table model wrapper technique we used in JIDE
Grids to provide a view into one page of the original table model. PageNavigationBar
leverages this class to implement the page navigation for any table model.
DefaultPageTableModel, you need the original table model.
DefaultPageTableModel pageTableModel = new DefaultPageTableModel(originalTableModel);
JTable table = new JTable(pageTableModel);
With this code above, JTable will display the first 10 rows of the original table model. You can call methods such as
AbstractPageTableModel.setCurrentPage(int) to open other pages. You could add buttons to control this
DefaultPageTableModel but that's exactly what PageNavigationBar is for. So in the other
word, there is no need to use DefaultPageTableModel directly unless you want to control the page
navigation yourself.
PageNavigationBar,
Serialized Form| Field Summary |
|---|
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Fields inherited from interface com.jidesoft.grid.MultiTableModel |
|---|
FOOTER_COLUMN, HEADER_COLUMN, REGULAR_COLUMN |
| Constructor Summary | |
|---|---|
DefaultPageTableModel(TableModel model)
Creates a DefaultPageTableModel with 10 as the page size. |
|
DefaultPageTableModel(TableModel model,
int pageSize)
Creates a DefaultPageTableModel with a page size. |
|
| Method Summary | |
|---|---|
void |
addIndexChangeListener(IndexChangeListener l)
Add IndexChangelistener. |
TableModel |
getActualModel()
Gets the underlying table model. |
int |
getActualRowAt(int visualRow)
Gets the actual row index in the underlying table that corresponds the specified row index. |
Class<?> |
getCellClassAt(int rowIndex,
int columnIndex)
Gets the type at cell (row, column). |
Class<?> |
getColumnClass(int columnIndex)
|
int |
getColumnCount()
|
Object |
getColumnIdentifier(int columnIndex)
Returns the identifier of the column in the model. |
String |
getColumnName(int column)
|
int |
getColumnType(int columnIndex)
Checks if the column at the columnIndex is a header column or footer column or just regular column. |
ConverterContext |
getConverterContextAt(int rowIndex,
int columnIndex)
Gets the converter context at cell (row, column). |
EditorContext |
getEditorContextAt(int rowIndex,
int columnIndex)
Gets the editor context at cell (row, column). |
IndexChangeListener[] |
getIndexChangeListeners()
Returns an array of all the IndexChangeListeners |
IndexedRowTableModelWrapper |
getIndexedRowTableModelWrapper()
|
int[] |
getIndexes()
Gets the indexes that maps from the visual row index to the actual row index. |
Object |
getRoot()
Gets the root expandable row which has the original rows as children. |
Row |
getRowAt(int rowIndex)
Returns the row at row specified by row. |
int |
getRowIndex(Row row)
Gets the index of the row. |
int |
getTableIndex(int columnIndex)
Gets the table index that this column belongs to. |
int |
getTotalRecordCount()
Gets the total record/row count. |
Object |
getValueAt(int rowIndex,
int columnIndex)
|
int |
getVisualRowAt(int actualRow)
Gets the visual row index representing the specified actual row. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
|
boolean |
isUpdatable()
|
protected void |
pageCountChanged(int oldPageCount,
int newPageCount)
|
protected void |
pageIndexChanged(int oldPageIndex,
int newPageIndex)
|
protected void |
reallocateIndexes()
|
void |
removeIndexChangeListener(IndexChangeListener l)
Remove IndexChangelistener. |
void |
setIndexes(int[] indexes)
Sets the indexes of the row mapping. |
void |
setTableModel(TableModel model)
Sets the new table model for the DefaultPageTableModel. |
void |
setTotalRecordCount(int totalRecordCount)
Sets the total record/row count. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
|
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.table.TableModel |
|---|
addTableModelListener, removeTableModelListener |
| Constructor Detail |
|---|
public DefaultPageTableModel(TableModel model)
DefaultPageTableModel with 10 as the page size.
model - the original table model.
public DefaultPageTableModel(TableModel model,
int pageSize)
DefaultPageTableModel with a page size.
model - the original table model.pageSize - the page size.| Method Detail |
|---|
public void setTableModel(TableModel model)
model - the new table modelpublic int getActualRowAt(int visualRow)
RowTableModelWrapper
getActualRowAt in interface RowTableModelWrappervisualRow - the visual row index.
public int getVisualRowAt(int actualRow)
RowTableModelWrapper
getVisualRowAt in interface RowTableModelWrapperactualRow - the actual row index.
public TableModel getActualModel()
TableModelWrapper
getActualModel in interface TableModelWrapperpublic void addIndexChangeListener(IndexChangeListener l)
IndexChangeEventGenerator
addIndexChangeListener in interface IndexChangeEventGeneratorl - the listenerpublic void removeIndexChangeListener(IndexChangeListener l)
IndexChangeEventGenerator
removeIndexChangeListener in interface IndexChangeEventGeneratorl - the listenerpublic IndexChangeListener[] getIndexChangeListeners()
IndexChangeEventGeneratorIndexChangeListeners
getIndexChangeListeners in interface IndexChangeEventGeneratorIndexChangeListeners added or an empty array if no listeners have been addedIndexChangeEventGenerator.addIndexChangeListener(com.jidesoft.grid.IndexChangeListener)
protected void pageCountChanged(int oldPageCount,
int newPageCount)
pageCountChanged in class AbstractPageTableModel
protected void pageIndexChanged(int oldPageIndex,
int newPageIndex)
pageIndexChanged in class AbstractPageTableModelpublic int getColumnCount()
getColumnCount in interface TableModel
public Object getValueAt(int rowIndex,
int columnIndex)
getValueAt in interface TableModelpublic Class<?> getColumnClass(int columnIndex)
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModel
public ConverterContext getConverterContextAt(int rowIndex,
int columnIndex)
ContextSensitiveTableModel
getConverterContextAt in interface ContextSensitiveTableModelgetConverterContextAt in class AbstractPageTableModelrowIndex - the row indexcolumnIndex - the column index
public EditorContext getEditorContextAt(int rowIndex,
int columnIndex)
ContextSensitiveTableModel
getEditorContextAt in interface ContextSensitiveTableModelgetEditorContextAt in class AbstractPageTableModelrowIndex - the row indexcolumnIndex - the column index
public Class<?> getCellClassAt(int rowIndex,
int columnIndex)
ContextSensitiveTableModel
getCellClassAt in interface ContextSensitiveTableModelgetCellClassAt in class AbstractPageTableModelrowIndex - the row indexcolumnIndex - the column index
public String getColumnName(int column)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic Object getColumnIdentifier(int columnIndex)
ColumnIdentifierTableModelJideTable uses this method to get the unique
identifier of this column.
getColumnIdentifier in interface ColumnIdentifierTableModelcolumnIndex - the index of the column
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface TableModelsetValueAt in class AbstractTableModel
public boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModelpublic int getTotalRecordCount()
PageNavigationSupport
getTotalRecordCount in interface PageNavigationSupportpublic void setTotalRecordCount(int totalRecordCount)
PageNavigationSupport
setTotalRecordCount in interface PageNavigationSupporttotalRecordCount - the new total row count.public int[] getIndexes()
IndexedRowTableModelWrapper
getIndexes in interface IndexedRowTableModelWrapperpublic void setIndexes(int[] indexes)
IndexedRowTableModelWrapper
setIndexes in interface IndexedRowTableModelWrapperindexes - the new index array.protected void reallocateIndexes()
public boolean isUpdatable()
public int getColumnType(int columnIndex)
MultiTableModel
getColumnType in interface MultiTableModelgetColumnType in class AbstractPageTableModelcolumnIndex - the column index
public int getTableIndex(int columnIndex)
MultiTableModel
getTableIndex in interface MultiTableModelgetTableIndex in class AbstractPageTableModelcolumnIndex - the column index
public Row getRowAt(int rowIndex)
ITreeTableModelrow.
getRowAt in interface ITreeTableModelrowIndex - the row whose row is to be queried
public int getRowIndex(Row row)
ITreeTableModel
getRowIndex in interface ITreeTableModelrow - row
public Object getRoot()
ITreeTableModel
getRoot in interface ITreeTableModelpublic IndexedRowTableModelWrapper getIndexedRowTableModelWrapper()
getIndexedRowTableModelWrapper in interface WrapperOfIndexdRowTableModelWrapper
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||