JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource
Class ReadOnlyBinding

java.lang.Object
  |
  +--com.klg.jclass.datasource.ReadOnlyBinding
All Implemented Interfaces:
BindingModel, ReadOnlyBindingModel, Serializable
Direct Known Subclasses:
Binding

public abstract class ReadOnlyBinding
extends Object
implements BindingModel, Serializable

This class provides a single-level, 2-dimensional view of a set of data. It groups all non-update methods and handles read-only events. This class exists only to provide a logical separation between read-only and non-read-only methods and event handling.

See Also:
Binding, Serialized Form

Field Summary
protected  String dataBinding
          The data binding hierarchy string.
 com.klg.jclass.datasource.DataModel dataModel
          The data model for this level.
protected  com.klg.jclass.util.JCListenerList listeners
          Listeners to this level.
protected  com.klg.jclass.datasource.MetaDataModel metaDataModel
          The meta data model for this level.
protected  com.klg.jclass.datasource.Binding parent
          The parent of this level.
 
Constructor Summary
ReadOnlyBinding(com.klg.jclass.datasource.Binding parent)
          Constructor for child levels.
ReadOnlyBinding(com.klg.jclass.datasource.DataModel dataModel)
          Root-level constructor.
 
Method Summary
 void addBindingListener(com.klg.jclass.datasource.DataModelListener listener)
          Implements DataModel method addDataModelListener.
 Object getCell(com.klg.jclass.datasource.DataModelListener originator, int rowIndex, int columnIndex)
          Get the value in a cell for a specified row.
 Object getCell(com.klg.jclass.datasource.DataModelListener originator, int rowIndex, String columnName)
          Get the value in a cell for a specified row.
 int getColumnCount()
          Return the number of columns in this table.
 String getColumnIdentifier(int colIndex)
          Return the name of this column.
 int getColumnIndex(String columnName)
          Return the index for this column name.
 com.klg.jclass.datasource.ColumnModel getColumnObject(String columnName)
           
 Object getCurrentCell(com.klg.jclass.datasource.DataModelListener originator, String columnName)
          Get the value in a cell for the row currently in focus.
 com.klg.jclass.datasource.DataTableModel getCurrentDataTableModel(com.klg.jclass.datasource.DataModelListener originator)
          Get the table currently in scope.
 int getCurrentRowIndex()
          Return the index of the row currently in focus.
 com.klg.jclass.datasource.DataModel getDataModel()
          Get the data model containing this level.
 String getDescription()
          Get the name for this level.
 int getJavaColumnType(int columnIndex)
          Return the MetaDataModel type for this column.
 int getJavaColumnType(String columnName)
          Return the MetaDataModel type for this column.
 Object getListeners()
          Returns a list of listeners
 com.klg.jclass.datasource.MetaDataModel getMetaDataModel()
          Get the meta data model for this level.
 com.klg.jclass.datasource.Binding getParent()
          Get the parent Binding of this table.
 int getRowCount()
          Return the number of rows in the table currently in scope.
 boolean isDataAvailable()
          Return true if data is available from this table.
 boolean isDescendantOf(com.klg.jclass.datasource.MetaDataModel possibleParent)
           
 boolean isOurData(com.klg.jclass.datasource.DataModelEvent e)
          Is the event intend for this level?
 boolean isOutDataOrOurAncestors(com.klg.jclass.datasource.DataModelEvent e)
          Will these event impact this level or any of its descendents?
 boolean moveToRowIndex(com.klg.jclass.datasource.DataModelListener originator, int rowIndex)
          Move focus to a new row in the current table.
 void removeBindingListener(com.klg.jclass.datasource.DataModelListener listener)
          Implements DataModel method removeDataModelListener.
 void requeryAll(com.klg.jclass.datasource.DataModelListener originator)
          Requery all levels.
 void requeryCurrentRow(com.klg.jclass.datasource.DataModelListener originator)
          Requery the row currently in focus.
 void requeryCurrentRowAndDetails(com.klg.jclass.datasource.DataModelListener originator)
          Requery the row currently in focus and its details.
 void requeryLevel(com.klg.jclass.datasource.DataModelListener originator)
          Requery all rows in the table currently in focus.
 void requeryRow(com.klg.jclass.datasource.DataModelListener originator, int rowIndex)
          Requery the specified row.
 void requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener originator, int rowIndex)
          Requery a row and its details.
 void setDataModel(com.klg.jclass.datasource.DataModel dataModel)
          Set the data model for this level.
 void setDescription(String name)
          Set the name for this level.
 void setMetaDataModel(com.klg.jclass.datasource.MetaDataModel metaDataModel)
          Set the meta data model for this level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.klg.jclass.datasource.BindingModel
addRow, cancelAll, cancelCurrentRowChanges, cancelRowChanges, commitAll, commitCurrentRow, commitRow, deleteCurrentRow, deleteRow, deleteRows, getCurrentRowStatus, getRowStatus, isColumnEditable, isColumnEditable, isCurrentRowModified, isRowModified, moveToBestRowAfterDelete, setCell, setCurrentCell
 

Field Detail

metaDataModel

protected com.klg.jclass.datasource.MetaDataModel metaDataModel
The meta data model for this level.


dataModel

public com.klg.jclass.datasource.DataModel dataModel
The data model for this level.


parent

protected com.klg.jclass.datasource.Binding parent
The parent of this level.


listeners

protected com.klg.jclass.util.JCListenerList listeners
Listeners to this level.


dataBinding

protected String dataBinding
The data binding hierarchy string.

Constructor Detail

ReadOnlyBinding

public ReadOnlyBinding(com.klg.jclass.datasource.DataModel dataModel)
Root-level constructor.

Parameters:
dataModel - the DataModel to which this binding will belong.

ReadOnlyBinding

public ReadOnlyBinding(com.klg.jclass.datasource.Binding parent)
Constructor for child levels.

Parameters:
parent - the Binding which is the parent of this level.
Method Detail

getCurrentDataTableModel

public com.klg.jclass.datasource.DataTableModel getCurrentDataTableModel(com.klg.jclass.datasource.DataModelListener originator)
                                                                  throws DataModelException
Get the table currently in scope.

Specified by:
getCurrentDataTableModel in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener making this request.
Returns:
the DataTableModel currently in focus for this level.
DataModelException

getMetaDataModel

public com.klg.jclass.datasource.MetaDataModel getMetaDataModel()
Get the meta data model for this level.

Specified by:
getMetaDataModel in interface ReadOnlyBindingModel
Returns:
the MetaDataModel for this level.

setMetaDataModel

public void setMetaDataModel(com.klg.jclass.datasource.MetaDataModel metaDataModel)
Set the meta data model for this level.

Specified by:
setMetaDataModel in interface ReadOnlyBindingModel

getParent

public com.klg.jclass.datasource.Binding getParent()
Get the parent Binding of this table.

Specified by:
getParent in interface ReadOnlyBindingModel
Returns:
the Binding which is the parent of this level.

getDataModel

public com.klg.jclass.datasource.DataModel getDataModel()
Get the data model containing this level.

Specified by:
getDataModel in interface ReadOnlyBindingModel
Returns:
the DataModel which contains this level.

setDataModel

public void setDataModel(com.klg.jclass.datasource.DataModel dataModel)
Set the data model for this level.

Specified by:
setDataModel in interface ReadOnlyBindingModel
Parameters:
dataModel - the data model for this level.

setDescription

public void setDescription(String name)
Set the name for this level.

Specified by:
setDescription in interface ReadOnlyBindingModel

getDescription

public String getDescription()
Get the name for this level.

Specified by:
getDescription in interface ReadOnlyBindingModel
Returns:
the name for this level.

addBindingListener

public void addBindingListener(com.klg.jclass.datasource.DataModelListener listener)
Implements DataModel method addDataModelListener.

Specified by:
addBindingListener in interface ReadOnlyBindingModel

removeBindingListener

public void removeBindingListener(com.klg.jclass.datasource.DataModelListener listener)
Implements DataModel method removeDataModelListener.

Specified by:
removeBindingListener in interface ReadOnlyBindingModel

getListeners

public Object getListeners()
Returns a list of listeners

Specified by:
getListeners in interface ReadOnlyBindingModel
Returns:
the list of listeners.

getRowCount

public int getRowCount()
Return the number of rows in the table currently in scope.

Specified by:
getRowCount in interface ReadOnlyBindingModel
Returns:
the number of rows in the table currently in scope.

getColumnCount

public int getColumnCount()
Return the number of columns in this table.

Specified by:
getColumnCount in interface ReadOnlyBindingModel
Returns:
the number of columns in this table.

moveToRowIndex

public boolean moveToRowIndex(com.klg.jclass.datasource.DataModelListener originator,
                              int rowIndex)
                       throws DataModelException
Move focus to a new row in the current table.

Specified by:
moveToRowIndex in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener requesting the move.
rowIndex - the index of the row
DataModelException

isDataAvailable

public boolean isDataAvailable()
Return true if data is available from this table.

Specified by:
isDataAvailable in interface ReadOnlyBindingModel
Returns:
true if this table has data, false otherwise.

getColumnIdentifier

public String getColumnIdentifier(int colIndex)
Return the name of this column.

Specified by:
getColumnIdentifier in interface ReadOnlyBindingModel
Parameters:
colIndex - the int column index.
Returns:
the String name of this column.

getJavaColumnType

public int getJavaColumnType(String columnName)
Return the MetaDataModel type for this column.

Specified by:
getJavaColumnType in interface ReadOnlyBindingModel
Parameters:
columnName - the name of the column.
Returns:
one of MetaDataModel.TYPE_*.
See Also:
MetaDataModel

getJavaColumnType

public int getJavaColumnType(int columnIndex)
Return the MetaDataModel type for this column.

Specified by:
getJavaColumnType in interface ReadOnlyBindingModel
Returns:
one of MetaDataModel.TYPE_*.
See Also:
MetaDataModel

getCell

public Object getCell(com.klg.jclass.datasource.DataModelListener originator,
                      int rowIndex,
                      int columnIndex)
               throws DataModelException
Get the value in a cell for a specified row.

Specified by:
getCell in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener making the commit request.
rowIndex - the row index.
columnIndex - the column index.
Throws:
DataModelException - If get fails.

getCell

public Object getCell(com.klg.jclass.datasource.DataModelListener originator,
                      int rowIndex,
                      String columnName)
               throws DataModelException
Get the value in a cell for a specified row.

Specified by:
getCell in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener making the commit request.
rowIndex - the row index.
columnName - the column name.
Throws:
DataModelException - If get fails.

getCurrentCell

public Object getCurrentCell(com.klg.jclass.datasource.DataModelListener originator,
                             String columnName)
                      throws DataModelException
Get the value in a cell for the row currently in focus.

Specified by:
getCurrentCell in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener requesting the value.
columnName - the String column name for the column.
Returns:
the Object in this cell.
Throws:
DataModelException - If get fails.

getCurrentRowIndex

public int getCurrentRowIndex()
Return the index of the row currently in focus.

Specified by:
getCurrentRowIndex in interface ReadOnlyBindingModel
Returns:
the index of the current row.

requeryRow

public void requeryRow(com.klg.jclass.datasource.DataModelListener originator,
                       int rowIndex)
                throws DataModelException
Requery the specified row.

Specified by:
requeryRow in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener making the requery request.
rowIndex - the row index to be requeried.
DataModelException

requeryCurrentRow

public void requeryCurrentRow(com.klg.jclass.datasource.DataModelListener originator)
                       throws DataModelException
Requery the row currently in focus.

Specified by:
requeryCurrentRow in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener making the requery request.
DataModelException

requeryRowAndDetails

public void requeryRowAndDetails(com.klg.jclass.datasource.DataModelListener originator,
                                 int rowIndex)
                          throws DataModelException
Requery a row and its details.

Specified by:
requeryRowAndDetails in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener making the requery request.
rowIndex - the row index to be requeried.
DataModelException

requeryCurrentRowAndDetails

public void requeryCurrentRowAndDetails(com.klg.jclass.datasource.DataModelListener originator)
                                 throws DataModelException
Requery the row currently in focus and its details.

Specified by:
requeryCurrentRowAndDetails in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener making the requery request.
DataModelException

requeryAll

public void requeryAll(com.klg.jclass.datasource.DataModelListener originator)
                throws DataModelException
Requery all levels.

Specified by:
requeryAll in interface ReadOnlyBindingModel
Parameters:
originator - the DataModelListener making the requery request.
DataModelException

getColumnIndex

public int getColumnIndex(String columnName)
Return the index for this column name.

Specified by:
getColumnIndex in interface ReadOnlyBindingModel
Returns:
the index of this column.

requeryLevel

public void requeryLevel(com.klg.jclass.datasource.DataModelListener originator)
                  throws DataModelException
Requery all rows in the table currently in focus.

Specified by:
requeryLevel in interface BindingModel
Parameters:
originator - the DataModelListener making the requery request.
DataModelException

isOurData

public boolean isOurData(com.klg.jclass.datasource.DataModelEvent e)
Is the event intend for this level?

Specified by:
isOurData in interface ReadOnlyBindingModel

isOutDataOrOurAncestors

public boolean isOutDataOrOurAncestors(com.klg.jclass.datasource.DataModelEvent e)
Will these event impact this level or any of its descendents?


isDescendantOf

public boolean isDescendantOf(com.klg.jclass.datasource.MetaDataModel possibleParent)

getColumnObject

public com.klg.jclass.datasource.ColumnModel getColumnObject(String columnName)
Specified by:
getColumnObject in interface ReadOnlyBindingModel

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