JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Interface DataViewModel

All Superinterfaces:
EventListener, JCTableDataListener, JCTableDataModel, TableDataModel
All Known Subinterfaces:
SortableDataViewModel
All Known Implementing Classes:
BaseDataView, TableDataView

public interface DataViewModel
extends TableDataModel, JCTableDataListener

The DataViewModel interface defines the methods for classes that can serve as an intermediary between the JCTable and the data source (TableDataModel).

See Also:
TableDataModel

Method Summary
 com.klg.jclass.cell.JCCellEditor getCellEditor(int row, int column)
          Returns the cell editor for a row/column.
 com.klg.jclass.cell.JCCellEditor getCellEditor(Object o)
          Returns the cell editor given an object.
 com.klg.jclass.cell.JCCellRenderer getCellRenderer(int row, int column)
          Returns the cell renderer for a row/column.
 com.klg.jclass.cell.JCCellRenderer getCellRenderer(int row, int column, Object o)
          Returns the cell renderer for a row/column given the data for the cell.
 com.klg.jclass.cell.JCCellRenderer getCellRenderer(Object o)
          Returns the cell renderer given an object.
 com.klg.jclass.table.TableDataModel getDataSource()
          Returns the bound data source.
 Hashtable getEditorsTable()
          Returns a Hashtable of object to editor mappings.
 Object getObject(int row, int column)
          Returns the object given a row or column.
 Hashtable getRenderersTable()
          Returns a Hashtable of object to renderer mappings.
 com.klg.jclass.table.JCTable getTable()
          Returns the JCTable controlled by the DataViewModel.
 boolean isEditable()
          Returns true if the data source implements EditableTableData.
 void setDataSource(com.klg.jclass.table.TableDataModel tableData)
          Sets the bound data source.
 void setEditorsTable(Hashtable ht)
          Sets the Hashtable for object to editor mappings.
 void setRenderersTable(Hashtable ht)
          Sets the Hashtable of object to renderer mappings.
 void setTable(com.klg.jclass.table.JCTable table)
          Sets the JCTable controlled by the DataViewModel.
 boolean setTableDataItem(Object o, int row, int column)
          Sets the cell value for editable data sources.
 
Methods inherited from interface com.klg.jclass.table.TableDataModel
addTableDataListener, removeTableDataListener
 
Methods inherited from interface com.klg.jclass.util.JCTableDataModel
getNumColumns, getNumRows, getTableColumnLabel, getTableDataItem, getTableRowLabel
 
Methods inherited from interface com.klg.jclass.table.JCTableDataListener
dataChanged
 

Method Detail

getTable

public com.klg.jclass.table.JCTable getTable()
Returns the JCTable controlled by the DataViewModel.

Returns:
The current table controlled by this DataView.

setTable

public void setTable(com.klg.jclass.table.JCTable table)
Sets the JCTable controlled by the DataViewModel.

Parameters:
table - The new table for this DataView

getCellRenderer

public com.klg.jclass.cell.JCCellRenderer getCellRenderer(int row,
                                                          int column)
Returns the cell renderer for a row/column.

Parameters:
row - The row index
column - The column index
Returns:
The cell renderer for the given row and column.

getCellRenderer

public com.klg.jclass.cell.JCCellRenderer getCellRenderer(int row,
                                                          int column,
                                                          Object o)
Returns the cell renderer for a row/column given the data for the cell.

Parameters:
row - The row index
column - The column index
o - The data in the cell indexed by row and column
Returns:
The cell renderer based on the data in the cell given the row and column indicies

getCellRenderer

public com.klg.jclass.cell.JCCellRenderer getCellRenderer(Object o)
Returns the cell renderer given an object.

Parameters:
o - The object the cell renderer needs to render
Returns:
The cell renderer based on the object.

getRenderersTable

public Hashtable getRenderersTable()
Returns a Hashtable of object to renderer mappings.

Returns:
The current renderer cache

setRenderersTable

public void setRenderersTable(Hashtable ht)
Sets the Hashtable of object to renderer mappings.

Parameters:
ht - The new renderer cache

getCellEditor

public com.klg.jclass.cell.JCCellEditor getCellEditor(int row,
                                                      int column)
Returns the cell editor for a row/column.

Parameters:
row - The row index
column - The column index
Returns:
The cell editor for the given row and column

getCellEditor

public com.klg.jclass.cell.JCCellEditor getCellEditor(Object o)
Returns the cell editor given an object.

Parameters:
o - The object for which a cell editor is required
Returns:
The cell editor based on the given object

getEditorsTable

public Hashtable getEditorsTable()
Returns a Hashtable of object to editor mappings.

Returns:
The current editor cache

setEditorsTable

public void setEditorsTable(Hashtable ht)
Sets the Hashtable for object to editor mappings.

Parameters:
ht - The new eidtor cache

getDataSource

public com.klg.jclass.table.TableDataModel getDataSource()
Returns the bound data source.

Returns:
The current bound data source

setDataSource

public void setDataSource(com.klg.jclass.table.TableDataModel tableData)
Sets the bound data source.

Parameters:
tableData - The new bound data source

isEditable

public boolean isEditable()
Returns true if the data source implements EditableTableData.

Returns:
Is the data source editable?

getObject

public Object getObject(int row,
                        int column)
Returns the object given a row or column. This convenience method handles both cells and labels.

Parameters:
row - The row index
column - The column index
Returns:
The data object based on the given row and column

setTableDataItem

public boolean setTableDataItem(Object o,
                                int row,
                                int column)
Sets the cell value for editable data sources.

Parameters:
o - The new cell value
row - The row index
column - The column index
Returns:
The status of the edit. Note that if the datasource is not editable, no edit is done and true is returned.

Copyright © 2004 Quest Software Inc..
All rights reserved.