JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource.util
Class FieldDataBinding

java.lang.Object
  |
  +--com.klg.jclass.datasource.util.DataBinding
        |
        +--com.klg.jclass.datasource.util.ColumnDataBinding
              |
              +--com.klg.jclass.datasource.util.FieldDataBinding
All Implemented Interfaces:
DataModelListener, EventListener, ReadOnlyBindingListener, Serializable
Direct Known Subclasses:
DataBinding

public abstract class FieldDataBinding
extends ColumnDataBinding

An extension of DataBinding that further allows binding to a particular column

This is an abstract class and is further extended to either (as of this writing) by FieldDataBinding which allows one to bind to the current of the bound column and ColumnDataBinding which allows you to bind to the whole column of the current table of the particular meta-data level.

To complete an implementation of this class tableChanged() must be implemented.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.klg.jclass.datasource.util.ColumnDataBinding
column_name, column_type
 
Fields inherited from class com.klg.jclass.datasource.util.DataBinding
binding, component, dataBinding, PATH_DELIMITER, SOURCE_DELIMITER
 
Constructor Summary
FieldDataBinding(Component component)
           
 
Method Summary
protected  boolean beforeCurrentRowChange()
          Checks if all listeners have accepted the move.
protected  void cellDataChanged(int rowIndex, String columnName)
          Must be called after a single cell value was changed.
 void convertAndSaveItem(String value)
          convert the value from a string and save it by invoking saveItem
protected  void currentRowChanged(int rowIndex)
          Changes the current row in the component.
protected  Object readCurrentCell()
          This should be called from implementation of tableChanged to see if we need to change the our data
protected abstract  void refreshCell(Object item)
          Must be implemented by subclasses in order to update the component's data contents when the current row changes or the record is modified.
protected  void rowDataChanged(int rowIndex)
          Must be called after row data were changed.
protected  void rowDeleted()
          Must be called after a row was deleted.
protected  void rowInserted()
          Must be called after a row was inserted.
protected abstract  boolean saveCell()
          Must be implemented by subclasses in order to save the component's data to the datasource.
 void saveItem(Object new_value)
          This method is invoked by the sub-class to save the data item to the super-class
 void setDataAvailable(boolean state)
          Disables the component if there is no DataTableModel or there is no current row.
 void setDataAvailableState()
          Checks and sets the new data available state.
protected  void tableChanged()
          Process a change in the data
protected  void toggleDataAvailableState()
          Checks whether the current bookmark is available and calls toggleDataAvailableState() for a superclass.
 
Methods inherited from class com.klg.jclass.datasource.util.ColumnDataBinding
getDataBinding, isColumnEditable, setDataBinding, setDataBinding, setDataBinding
 
Methods inherited from class com.klg.jclass.datasource.util.DataBinding
afterChangeOfRowData, afterDeleteRow, afterInsertRow, afterMoveToCurrentRow, afterRequeryRowAndDetails, afterRequeryTable, afterReset, beforeCancelAll, beforeCancelRowChanges, beforeCommitAll, beforeCommitConditional, beforeCommitRow, beforeDeleteRow, beforeDeleteTable, beforeEditCell, beforeInsertRow, beforeMoveToCurrentRow, beforeRequery, beforeReset, beginEvents, checkDataTableChanged, checkDataTableChanged, dispose, endEvents, finalize, getBinding, getComponent, getCurrentRowIndex, getJavaColumnType, getNativeMetaData, getNumColumns, getNumRows, getTableColumnLabel, handleCancellingBeforeEvents, handleCheckingAfterEvents, initialize, isColumnEditable, isDataAvailable, moveToBestRowAfterDelete, moveToRowIndex, originatorNavigateRow, processException, setDataBinding, setDataBinding, setDataBinding, setDataBindingInternalBegin, setDataBindingInternalEnd
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldDataBinding

public FieldDataBinding(Component component)
Method Detail

tableChanged

protected void tableChanged()
Process a change in the data

Specified by:
tableChanged in class DataBinding

rowDataChanged

protected void rowDataChanged(int rowIndex)
Must be called after row data were changed.

Specified by:
rowDataChanged in class DataBinding

cellDataChanged

protected void cellDataChanged(int rowIndex,
                               String columnName)
Must be called after a single cell value was changed.

Specified by:
cellDataChanged in class DataBinding

currentRowChanged

protected void currentRowChanged(int rowIndex)
Changes the current row in the component.

Specified by:
currentRowChanged in class DataBinding

beforeCurrentRowChange

protected boolean beforeCurrentRowChange()
Checks if all listeners have accepted the move.

Specified by:
beforeCurrentRowChange in class DataBinding

rowInserted

protected void rowInserted()
Must be called after a row was inserted.

Specified by:
rowInserted in class DataBinding

rowDeleted

protected void rowDeleted()
Must be called after a row was deleted.

Specified by:
rowDeleted in class DataBinding

refreshCell

protected abstract void refreshCell(Object item)
Must be implemented by subclasses in order to update the component's data contents when the current row changes or the record is modified.


saveCell

protected abstract boolean saveCell()
Must be implemented by subclasses in order to save the component's data to the datasource.


readCurrentCell

protected Object readCurrentCell()
This should be called from implementation of tableChanged to see if we need to change the our data


saveItem

public void saveItem(Object new_value)
This method is invoked by the sub-class to save the data item to the super-class


convertAndSaveItem

public void convertAndSaveItem(String value)
convert the value from a string and save it by invoking saveItem


setDataAvailable

public void setDataAvailable(boolean state)
Disables the component if there is no DataTableModel or there is no current row.

Specified by:
setDataAvailable in class DataBinding

setDataAvailableState

public void setDataAvailableState()
Checks and sets the new data available state.


toggleDataAvailableState

protected void toggleDataAvailableState()
Checks whether the current bookmark is available and calls toggleDataAvailableState() for a superclass.

Overrides:
toggleDataAvailableState in class DataBinding

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