org.tbee.swing.jdbc
Class RowSetTableModelForEdit

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.tbee.swing.table.AbstractTableModel
          extended by org.tbee.swing.table.AbstractTableModelForEdit
              extended by org.tbee.swing.jdbc.RowSetTableModelForEdit
All Implemented Interfaces:
Serializable, EventListener, RowSetListener, TableModel, TableModelForEdit

public class RowSetTableModelForEdit
extends AbstractTableModelForEdit
implements TableModel, RowSetListener

Implements an TableModelForEdit on top of a JDBC RowSet

Version:
$Revision: 1.12 $
See Also:
Serialized Form

Field Summary
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
RowSetTableModelForEdit(RowSet rowSet)
           
 
Method Summary
 void acceptChanges()
          Only valid for CachedRowSet: performs a acceptChanges and tries to give some sensible errors.
 int addRowAt(int rowIdx)
           
 void cursorMoved(RowSetEvent arg0)
           
 void deleteRowAt(int rowIdx)
           
 boolean getAllowSetValue()
           
 Class getColumnClass(int colIdx)
           
 int getColumnCount()
           
 String getColumnLabel(int idx)
           
 String getColumnName(int colIdx)
           
 boolean getColumnTrim(int idx)
           
 boolean getDataIsValid()
           
 String getErrorMessageAt(int arg0, int arg1)
           
 Object getInitialValue(int colIdx)
          It is required for the RowSet to have all not nullable fields initialized with correct values
 int getRowCount()
           
 RowSet getRowSet()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 String getWarnMessageAt(int arg0, int arg1)
           
 boolean isCellEditable(int rowIndex, int colIdx)
           
 boolean isColumnEditable(int idx)
           
 boolean isEditable()
           
 void rowChanged(RowSetEvent arg0)
           
 void rowSetChanged(RowSetEvent arg0)
           
 void setAllowSetValue(boolean value)
           
 void setColumnEditable(int idx, boolean value)
           
 void setColumnLabel(int idx, String value)
           
 void setColumnTrim(int idx, boolean value)
           
 void setDataIsValid(boolean value)
           
 void setEditable(boolean value)
           
 void setRowSet(RowSet value)
           
 void setValueAt(Object value, int rowIndex, int columnIndex)
           
 
Methods inherited from class org.tbee.swing.table.AbstractTableModel
fireTableCellUpdatedInvokeAndWait, fireTableCellUpdatedInvokeLater, fireTableDataChangedInvokeAndWait, fireTableDataChangedInvokeLater, getTooltipAt
 
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
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

RowSetTableModelForEdit

public RowSetTableModelForEdit(RowSet rowSet)
Method Detail

getRowSet

public RowSet getRowSet()

setRowSet

public void setRowSet(RowSet value)

getColumnLabel

public String getColumnLabel(int idx)

setColumnLabel

public void setColumnLabel(int idx,
                           String value)

getColumnTrim

public boolean getColumnTrim(int idx)

setColumnTrim

public void setColumnTrim(int idx,
                          boolean value)

isColumnEditable

public boolean isColumnEditable(int idx)

setColumnEditable

public void setColumnEditable(int idx,
                              boolean value)

isEditable

public boolean isEditable()

setEditable

public void setEditable(boolean value)

getAllowSetValue

public boolean getAllowSetValue()

setAllowSetValue

public void setAllowSetValue(boolean value)

getDataIsValid

public boolean getDataIsValid()

setDataIsValid

public void setDataIsValid(boolean value)

getInitialValue

public Object getInitialValue(int colIdx)
It is required for the RowSet to have all not nullable fields initialized with correct values


acceptChanges

public void acceptChanges()
                   throws SQLException
Only valid for CachedRowSet: performs a acceptChanges and tries to give some sensible errors.

Throws:
SQLException

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int colIdx)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

getColumnClass

public Class getColumnClass(int colIdx)
Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int colIdx)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

setValueAt

public void setValueAt(Object value,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel

addRowAt

public int addRowAt(int rowIdx)
Specified by:
addRowAt in interface TableModelForEdit

deleteRowAt

public void deleteRowAt(int rowIdx)
Specified by:
deleteRowAt in interface TableModelForEdit

getErrorMessageAt

public String getErrorMessageAt(int arg0,
                                int arg1)
Specified by:
getErrorMessageAt in interface TableModelForEdit
Overrides:
getErrorMessageAt in class AbstractTableModelForEdit

getWarnMessageAt

public String getWarnMessageAt(int arg0,
                               int arg1)
Specified by:
getWarnMessageAt in interface TableModelForEdit
Overrides:
getWarnMessageAt in class AbstractTableModelForEdit

rowSetChanged

public void rowSetChanged(RowSetEvent arg0)
Specified by:
rowSetChanged in interface RowSetListener

rowChanged

public void rowChanged(RowSetEvent arg0)
Specified by:
rowChanged in interface RowSetListener

cursorMoved

public void cursorMoved(RowSetEvent arg0)
Specified by:
cursorMoved in interface RowSetListener


Copyright © 2011 KnowledgePlaza. All Rights Reserved.