|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.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 FormField 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 IndexChangeListener s |
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 RowTableModelWrapper
visualRow
- the visual row index.
public int getVisualRowAt(int actualRow)
RowTableModelWrapper
getVisualRowAt
in interface RowTableModelWrapper
actualRow
- the actual row index.
public TableModel getActualModel()
TableModelWrapper
getActualModel
in interface TableModelWrapper
public void addIndexChangeListener(IndexChangeListener l)
IndexChangeEventGenerator
addIndexChangeListener
in interface IndexChangeEventGenerator
l
- the listenerpublic void removeIndexChangeListener(IndexChangeListener l)
IndexChangeEventGenerator
removeIndexChangeListener
in interface IndexChangeEventGenerator
l
- the listenerpublic IndexChangeListener[] getIndexChangeListeners()
IndexChangeEventGenerator
IndexChangeListener
s
getIndexChangeListeners
in interface IndexChangeEventGenerator
IndexChangeListener
s 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 AbstractPageTableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
public Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public ConverterContext getConverterContextAt(int rowIndex, int columnIndex)
ContextSensitiveTableModel
getConverterContextAt
in interface ContextSensitiveTableModel
getConverterContextAt
in class AbstractPageTableModel
rowIndex
- the row indexcolumnIndex
- the column index
public EditorContext getEditorContextAt(int rowIndex, int columnIndex)
ContextSensitiveTableModel
getEditorContextAt
in interface ContextSensitiveTableModel
getEditorContextAt
in class AbstractPageTableModel
rowIndex
- the row indexcolumnIndex
- the column index
public Class<?> getCellClassAt(int rowIndex, int columnIndex)
ContextSensitiveTableModel
getCellClassAt
in interface ContextSensitiveTableModel
getCellClassAt
in class AbstractPageTableModel
rowIndex
- the row indexcolumnIndex
- the column index
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public Object getColumnIdentifier(int columnIndex)
ColumnIdentifierTableModel
JideTable
uses this method to get the unique
identifier of this column.
getColumnIdentifier
in interface ColumnIdentifierTableModel
columnIndex
- the index of the column
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public int getTotalRecordCount()
PageNavigationSupport
getTotalRecordCount
in interface PageNavigationSupport
public void setTotalRecordCount(int totalRecordCount)
PageNavigationSupport
setTotalRecordCount
in interface PageNavigationSupport
totalRecordCount
- the new total row count.public int[] getIndexes()
IndexedRowTableModelWrapper
getIndexes
in interface IndexedRowTableModelWrapper
public void setIndexes(int[] indexes)
IndexedRowTableModelWrapper
setIndexes
in interface IndexedRowTableModelWrapper
indexes
- the new index array.protected void reallocateIndexes()
public boolean isUpdatable()
public int getColumnType(int columnIndex)
MultiTableModel
getColumnType
in interface MultiTableModel
getColumnType
in class AbstractPageTableModel
columnIndex
- the column index
public int getTableIndex(int columnIndex)
MultiTableModel
getTableIndex
in interface MultiTableModel
getTableIndex
in class AbstractPageTableModel
columnIndex
- the column index
public Row getRowAt(int rowIndex)
ITreeTableModel
row
.
getRowAt
in interface ITreeTableModel
rowIndex
- the row whose row is to be queried
public int getRowIndex(Row row)
ITreeTableModel
getRowIndex
in interface ITreeTableModel
row
- row
public Object getRoot()
ITreeTableModel
getRoot
in interface ITreeTableModel
public 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 |