|
JComponentPack 1.3.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.zfqjava.swing.model.ResultSetTableModel
com.zfqjava.swing.model.RowSetTableModel
public class RowSetTableModel
RowSetTableModel provides a
RowSet table model.
The TableModel methods use the model row index, all
other methods use the data row index of the ResultSet, but it is
0 based.
The page index also is 0 based.
All row index must be >= 0, and all first index must be
<= last index.
| Field Summary |
|---|
| Fields inherited from class com.zfqjava.swing.model.ResultSetTableModel |
|---|
CHANGE_CELL, CHANGE_PAGE, CHANGE_ROW, changeSupport, OFF, UNKNOWN_COUNT |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
RowSetTableModel(RowSet rs,
boolean sync,
int pageSize)
|
|
RowSetTableModel(RowSet rs,
int pageSize)
|
|
| Method Summary | |
|---|---|
void |
acceptChanges()
Propagates all row update, insert and delete changes to the underlying data source. |
int |
dataToModelRow(int dataRow)
Converts the ResultSet row index to the model row index. |
void |
deleteRow()
Deletes the data row at the specified current row index. |
void |
deleteRow(int rowIndex)
Deletes the data row at the specified row index. |
void |
deleteRow(int firstRow,
int lastRow)
Deletes the data row from firstRow to lastRow |
void |
firstPage()
|
void |
firstRow()
Goto the fist row. |
int |
getAllRowCount()
Returns all row count. |
Class |
getColumnClass(int columnIndex)
|
int |
getColumnCount()
|
String |
getColumnName(int columnIndex)
|
String |
getCommand()
Returns the command. |
int |
getFirstRowIndex()
Returns the first row index in current page. |
int |
getPageCount()
Returns the page count. |
int |
getPageIndex()
Returns the current page index. |
int |
getPageSize()
Returns the page size. |
String |
getPassword()
Returns the password |
int |
getRowCount()
|
int |
getRowIndex()
Returns the current row index. |
String |
getUrl()
Returns the url. |
String |
getUsername()
Returns the user name. |
Object |
getValueAt(int rowIndex,
int columnIndex)
|
void |
insertRow()
Inserts the data row. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
|
void |
lastPage()
|
void |
lastRow()
Goto the last row. |
int |
modelToDataRow(int modelRow)
Converts the model row index to the ResultSet row index. |
void |
moveToInsertRow()
Move the cursor to the insert row. |
void |
nextPage()
Show the next page. |
void |
nextRow()
Goto the next row. |
void |
previousPage()
Show the previous page. |
void |
previousRow()
Goto the previous row. |
void |
refreshCell(int rowIndex,
int columnIndex)
Refreshs the cell at the specified row and column index. |
void |
refreshCell(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
Refreshs the cell at the specified row and column index. |
void |
refreshRow()
Refreshs the data row at the specified current row index. |
void |
refreshRow(int rowIndex)
Refreshs the data row at the specified row index. |
void |
refreshRow(int firstRow,
int lastRow)
Refreshs the data row from firstRow to lastRow |
void |
reload()
Reloads all record from database. |
void |
setCommand(String sql)
Sets the command. |
void |
setPageIndex(int pageIndex)
Sets the page index. |
void |
setPassword(String password)
Sets the password |
void |
setRowIndex(int rowIndex)
Sets the row index. |
void |
setUrl(String url)
Sets the url. |
void |
setUsername(String username)
Sets the user name. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
|
void |
updateCell(int rowIndex,
int columnIndex)
Updates the cell at the specified row and column index. |
void |
updateCell(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
Updates the cell at the specified row and column index. |
void |
updateRow()
Updates the data row at the specified current row index. |
void |
updateRow(int rowIndex)
Updates the data row at the specified row index. |
void |
updateRow(int firstRow,
int lastRow)
Updates the data row from firstRow to lastRow |
| Methods inherited from class com.zfqjava.swing.model.ResultSetTableModel |
|---|
addPropertyChangeListener, close, firePropertyChange, firePropertyChange, getAutoInsertPolicy, getAutoUpdatePolicy, getCountCommand, getCurrentAllRowCount, getKeyColumns, getPropertyChangeListeners, getTableName, hasNextPage, hasPreviousPage, isFirstPage, isLastPage, removePropertyChangeListener, setAllRowCount, setAutoInsertPolicy, setAutoUpdatePolicy, setCountCommand, setKeyColumns, setTableName |
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, 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 |
| Constructor Detail |
|---|
public RowSetTableModel(RowSet rs,
int pageSize)
public RowSetTableModel(RowSet rs,
boolean sync,
int pageSize)
| Method Detail |
|---|
public void setUrl(String url)
setUrl in class ResultSetTableModelurl - the urlpublic String getUrl()
getUrl in class ResultSetTableModelpublic void setUsername(String username)
setUsername in class ResultSetTableModelusername - public String getUsername()
getUsername in class ResultSetTableModelpublic void setPassword(String password)
setPassword in class ResultSetTableModelpassword - the passwordpublic String getPassword()
getPassword in class ResultSetTableModelpublic void setCommand(String sql)
setCommand in class ResultSetTableModelsql - the SQL commandpublic String getCommand()
getCommand in class ResultSetTableModelpublic void reload()
reload in interface Reloadablereload in class ResultSetTableModelpublic void firstPage()
firstPage in interface PageablefirstPage in class ResultSetTableModelpublic void lastPage()
lastPage in interface PageablelastPage in class ResultSetTableModelpublic int getPageSize()
getPageSize in interface PageablegetPageSize in class ResultSetTableModelpublic int getPageCount()
getPageCount in interface PageablegetPageCount in class ResultSetTableModelpublic void setPageIndex(int pageIndex)
setPageIndex in interface PageablesetPageIndex in class ResultSetTableModelpageIndex - the page indexgetPageIndex()public int getPageIndex()
getPageIndex in interface PageablegetPageIndex in class ResultSetTableModelsetPageIndex(int)public void nextPage()
nextPage in interface PageablenextPage in class ResultSetTableModelpublic void lastRow()
lastRow in class ResultSetTableModelpublic void previousPage()
previousPage in interface PageablepreviousPage in class ResultSetTableModelpublic void firstRow()
firstRow in class ResultSetTableModelpublic void setRowIndex(int rowIndex)
setRowIndex in class ResultSetTableModelrowIndex - the row indexgetRowIndex()public int getRowIndex()
getRowIndex in class ResultSetTableModelsetRowIndex(int)public int getFirstRowIndex()
getFirstRowIndex in class ResultSetTableModelpublic int getAllRowCount()
Note:This is different with getRowCount
when use page mode.
getAllRowCount in interface PageablegetAllRowCount in class ResultSetTableModelpublic void nextRow()
nextRow in class ResultSetTableModelpublic void previousRow()
previousRow in class ResultSetTableModelpublic int modelToDataRow(int modelRow)
modelToDataRow in class ResultSetTableModelmodelRow - the mode row index
public int dataToModelRow(int dataRow)
dataToModelRow in class ResultSetTableModeldataRow - the data row index
public void insertRow()
insertRow in class ResultSetTableModelpublic void moveToInsertRow()
moveToInsertRow in class ResultSetTableModel
public void updateCell(int rowIndex,
int columnIndex)
updateCell in class ResultSetTableModelrowIndex - the data row indexcolumnIndex - the data column index
public void refreshCell(int rowIndex,
int columnIndex)
refreshCell in class ResultSetTableModelrowIndex - the data row indexcolumnIndex - the data column index
public void updateCell(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
updateCell in class ResultSetTableModelfirstRow - the first row index of the specified cell arealastRow - the last row index of the specified cell areafirstColumn - the first column index of the specified cell arealastColumn - the last column index of the specified cell area
public void refreshCell(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
refreshCell in class ResultSetTableModelfirstRow - the first row index of the specified cell arealastRow - the last row index of the specified cell areafirstColumn - the first column index of the specified cell arealastColumn - the last column index of the specified cell areapublic void updateRow()
updateRow in class ResultSetTableModelpublic void updateRow(int rowIndex)
updateRow in class ResultSetTableModelrowIndex - the row index
public void updateRow(int firstRow,
int lastRow)
firstRow to lastRow
updateRow in class ResultSetTableModelfirstRow - the first row indexlastRow - the last row indexpublic void deleteRow()
deleteRow in class ResultSetTableModelpublic void deleteRow(int rowIndex)
deleteRow in class ResultSetTableModelrowIndex - the row index
public void deleteRow(int firstRow,
int lastRow)
firstRow to lastRow
deleteRow in class ResultSetTableModelfirstRow - the first row indexlastRow - the last row indexpublic void refreshRow()
refreshRow in class ResultSetTableModelpublic void refreshRow(int rowIndex)
refreshRow in class ResultSetTableModelrowIndex - the row index
public void refreshRow(int firstRow,
int lastRow)
firstRow to lastRow
refreshRow in class ResultSetTableModelfirstRow - the first row indexlastRow - the last row indexpublic int getRowCount()
getRowCount in interface PageablegetRowCount in interface TableModelgetRowCount in class ResultSetTableModelpublic int getColumnCount()
getColumnCount in interface TableModelgetColumnCount in class ResultSetTableModelpublic String getColumnName(int columnIndex)
getColumnName in interface TableModelgetColumnName in class ResultSetTableModelpublic Class getColumnClass(int columnIndex)
getColumnClass in interface TableModelgetColumnClass in class ResultSetTableModel
public boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface TableModelisCellEditable in class ResultSetTableModel
public Object getValueAt(int rowIndex,
int columnIndex)
getValueAt in interface TableModelgetValueAt in class ResultSetTableModel
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface TableModelsetValueAt in class ResultSetTableModelpublic void acceptChanges()
ResultSetTableModel
acceptChanges in class ResultSetTableModel
|
JComponentPack 1.3.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||