Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.schooltool.client.gui.widgets
Class TableViewModel  view TableViewModel download TableViewModel.java

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.schooltool.client.gui.widgets.TableViewModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
TableMap

public class TableViewModel
extends javax.swing.table.AbstractTableModel


Field Summary
private  java.util.Hashtable cachedMethods
           
private  boolean[] columnEditable
           
 int[] columnEditorTypes
           
private  java.lang.String[] Columns
           
private  java.lang.Class[] columnsTypes
           
private  java.lang.Object[][] DataModel
           
private  java.text.SimpleDateFormat dateFormat
           
private  ComboBoxViewModel[] fkModels
           
private  boolean hasData
           
private  long[] primaryKeyArray
           
private  java.util.Hashtable searchWidgetCachedMethods
           
private  java.util.Hashtable searchWidgetObjects
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableViewModel()
           
TableViewModel(java.util.Collection objectCollection, java.lang.String[] getterMethodNames, java.lang.String[] columnNames, boolean[] editableValues, ComboBoxViewModel[] cbModels)
           
TableViewModel(java.lang.Object[][] dataModel, java.lang.String[] columns, boolean[] editableValues, long[] PkArray, ComboBoxViewModel[] cbModels)
           
 
Method Summary
 boolean add()
           
 void addSearchWidgetArray(SearchWidget srch, java.lang.Object session, java.lang.String finderMethod, java.lang.String[] MethNames, int[] order)
           
 java.lang.Object callMethod(java.lang.Object objectToCall, java.lang.String methodName, java.lang.reflect.Method cachedMethod)
           
 java.lang.Object callMethod(java.lang.Object objectToCall, java.lang.String methodName, java.lang.reflect.Method cachedMethod, java.util.Hashtable cache, java.lang.Integer key)
           
 java.lang.Object callMethod(java.lang.Object objectToCall, java.lang.String methodName, java.lang.reflect.Method cachedMethod, java.lang.Object[] args, java.lang.Class[] types)
           
private  void clearRow(int row)
           
 java.lang.Object[][] copyModel(java.lang.Object[][] src, int srcOffset, java.lang.Object[][] dest, int destOffset, int rowsToCopy)
           
 boolean delete(int row)
           
 java.lang.Class getColumnClass(int column)
          Returns the Class for all Object instances in the specified column.
 int getColumnCount()
          Returns the number of columns in the model.
 int[] getColumnEditorTypes()
           
 java.lang.String getColumnName(int columnNumber)
          Returns the name of the specified column.
 java.lang.Long getComboBoxFK(int row, int column)
           
 long getCurrentPK(int row)
           
 java.lang.Object[][] getDataModel()
          Getter for property dataModel.
 ComboBoxViewModel[] getFkModels()
           
 int[] getOrderArray(int Key)
           
 long[] getPkArray()
           
 int getRowCount()
          Returns the number of rows in the model.
 SearchWidget getSearchWidget(int Key)
           
 java.lang.Object getValueAt(int row, int column)
          Returns the value (Object) at a particular cell in the table.
 boolean isCellEditable(int row, int col)
          Returns true if the specified cell is editable, and false if it is not.
private  void reorderSparseComboBoxModelArray(ComboBoxViewModel[] cbModels, int Columns)
           
 void setColumnEditorTypes(int[] values)
           
 void setCurrentPK(int row, long value)
           
 void setFkModels(ComboBoxViewModel[] models)
           
 void setPkArray(long[] pkArray)
           
 void setValueAt(java.lang.Object value, int row, int column)
          Sets the value of the given cell.
 java.lang.Object translateKey(int column, int row)
           
 
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
 

Field Detail

Columns

private java.lang.String[] Columns

columnsTypes

private java.lang.Class[] columnsTypes

DataModel

private java.lang.Object[][] DataModel

columnEditable

private boolean[] columnEditable

hasData

private boolean hasData

dateFormat

private java.text.SimpleDateFormat dateFormat

columnEditorTypes

public int[] columnEditorTypes

searchWidgetObjects

private java.util.Hashtable searchWidgetObjects

searchWidgetCachedMethods

private java.util.Hashtable searchWidgetCachedMethods

primaryKeyArray

private long[] primaryKeyArray

fkModels

private ComboBoxViewModel[] fkModels

cachedMethods

private java.util.Hashtable cachedMethods
Constructor Detail

TableViewModel

public TableViewModel()

TableViewModel

public TableViewModel(java.lang.Object[][] dataModel,
                      java.lang.String[] columns,
                      boolean[] editableValues,
                      long[] PkArray,
                      ComboBoxViewModel[] cbModels)

TableViewModel

public TableViewModel(java.util.Collection objectCollection,
                      java.lang.String[] getterMethodNames,
                      java.lang.String[] columnNames,
                      boolean[] editableValues,
                      ComboBoxViewModel[] cbModels)
Method Detail

addSearchWidgetArray

public void addSearchWidgetArray(SearchWidget srch,
                                 java.lang.Object session,
                                 java.lang.String finderMethod,
                                 java.lang.String[] MethNames,
                                 int[] order)

getOrderArray

public int[] getOrderArray(int Key)

getSearchWidget

public SearchWidget getSearchWidget(int Key)

translateKey

public java.lang.Object translateKey(int column,
                                     int row)

setColumnEditorTypes

public void setColumnEditorTypes(int[] values)

getColumnEditorTypes

public int[] getColumnEditorTypes()

getPkArray

public long[] getPkArray()

setPkArray

public void setPkArray(long[] pkArray)

getCurrentPK

public long getCurrentPK(int row)

setCurrentPK

public void setCurrentPK(int row,
                         long value)

setFkModels

public void setFkModels(ComboBoxViewModel[] models)

getFkModels

public ComboBoxViewModel[] getFkModels()

reorderSparseComboBoxModelArray

private void reorderSparseComboBoxModelArray(ComboBoxViewModel[] cbModels,
                                             int Columns)

callMethod

public java.lang.Object callMethod(java.lang.Object objectToCall,
                                   java.lang.String methodName,
                                   java.lang.reflect.Method cachedMethod)
                            throws java.lang.Exception

callMethod

public java.lang.Object callMethod(java.lang.Object objectToCall,
                                   java.lang.String methodName,
                                   java.lang.reflect.Method cachedMethod,
                                   java.util.Hashtable cache,
                                   java.lang.Integer key)
                            throws java.lang.Exception

callMethod

public java.lang.Object callMethod(java.lang.Object objectToCall,
                                   java.lang.String methodName,
                                   java.lang.reflect.Method cachedMethod,
                                   java.lang.Object[] args,
                                   java.lang.Class[] types)
                            throws java.lang.Exception

getColumnCount

public int getColumnCount()
Description copied from interface: javax.swing.table.TableModel
Returns the number of columns in the model.


getRowCount

public int getRowCount()
Description copied from interface: javax.swing.table.TableModel
Returns the number of rows in the model.


getColumnName

public java.lang.String getColumnName(int columnNumber)
Description copied from class: javax.swing.table.AbstractTableModel
Returns the name of the specified column. This method generates default names in a sequence (starting with column 0): A, B, C, ..., Z, AA, AB, AC, ..., AZ, BA, BB, BC, and so on. Subclasses may override this method to allow column names to be specified on some other basis.


getComboBoxFK

public java.lang.Long getComboBoxFK(int row,
                                    int column)

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Description copied from interface: javax.swing.table.TableModel
Returns the value (Object) at a particular cell in the table.


getColumnClass

public java.lang.Class getColumnClass(int column)
Description copied from class: javax.swing.table.AbstractTableModel
Returns the Class for all Object instances in the specified column.


setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int column)
Description copied from class: javax.swing.table.AbstractTableModel
Sets the value of the given cell. This implementation ignores all arguments and does nothing, subclasses should override the method if necessary.


isCellEditable

public boolean isCellEditable(int row,
                              int col)
Description copied from class: javax.swing.table.AbstractTableModel
Returns true if the specified cell is editable, and false if it is not. This implementation returns false for all arguments, subclasses should override the method if necessary.


add

public boolean add()

clearRow

private void clearRow(int row)

delete

public boolean delete(int row)

copyModel

public java.lang.Object[][] copyModel(java.lang.Object[][] src,
                                      int srcOffset,
                                      java.lang.Object[][] dest,
                                      int destOffset,
                                      int rowsToCopy)

getDataModel

public java.lang.Object[][] getDataModel()
Getter for property dataModel.