borland Packages  Class Hierarchy  dbswing Package 

DBColumnAwareSupport class

java.lang.Object
   +----com.borland.dbswing.DBColumnAwareSupport
           +----com.borland.dbswing.DBLabelSupport

About the DBColumnAwareSupport class

Constructors  Properties  Methods  

Implements AccessListener, ColumnAware, DataChangeListener, DataSetAware, Serializable, EventListener

Note: This is a feature of JBuilder Professional and Enterprise.

DBColumnAwareSupport provides a basic implementation of the ColumnAware interface, with support for deferred (lazy) opening of the DataSet until requested by calling lazyOpen().

Data-aware components implementing the ColumnAware interface can delegate their setDataSet() and setColumnName() methods to DBColumnAwareSupport. Such components should invoke the lazyOpen() method just before any attempt to read data from or write data to the DataSet. Also, if the component needs to implement the AccessListener or DataChangeListener interface, it should not register as a listener directly, but rather pass a reference to itself to the DBColumnAwareSupport's constructor. This ensures that the DataSet is properly initialized before the component accesses it.

See also: DBListModel, DBListDataBinder, DBButtonDataBinder, DBLabelDataBinder, DBSliderDataBinder, DBTreeDataBinder, DBTreeNavBinder


DBColumnAwareSupport constructors

DBColumnAwareSupport properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

DBColumnAwareSupport methods

Methods implemented in this class

Methods implemented in java.lang.Object


DBColumnAwareSupport constructors

DBColumnAwareSupport(com.borland.dx.dataset.ColumnAware)

  public DBColumnAwareSupport(ColumnAware columnAwareObject)
Initializes DBColumnAwareSupport. The single parameter should be the instance of the object delegating ColumnAware support to DBColumnAwareSupport. If the object needs to implement the AccessListener and/or DataChangeListener interfaces, it should not register itself as a listener on its DataSet directly. It is be called automatically by DBColumnAwareSupport after the DataSet has been properly initialized. Note that columnAwareObject can be nullfor objects which don't implement either interface.

DBColumnAwareSupport properties

column

 public Column getColumn()
Returns the column.

columnName

 public String getColumnName()
 public void setColumnName(String columnName)
Returns and sets the column name of the DataSet from which values are read and to which values are written.

columnOrdinal

 public int getColumnOrdinal()
Returns the ordinal of the column in the DataSet. By default, this value is -1, meaning no column is indicated.

dataSet

 public DataSet getDataSet()
 public void setDataSet(DataSet dataSet)
Returns and sets the DataSet from which values are read and to which values are written.

formattedString

 public String getFormattedString()
Returns the value of the column as a formatted string.

null

 public boolean isNull()
If the column value is null, this property returns true.

object

 public void setObject(Object object)
Sets the column value in the DataSet using the value of the object parameter.

validDataSetState

 public boolean isValidDataSetState()
Returns true if the DataSet is not null, the DataSet has been opened, and the columnOrdinal value is not -1. In other words, if a column has been specified on an open DataSet containing data, validDataSetState is true.

variant

 public Variant getVariant()
 public void setVariant(Variant value)
Returns and sets the column value as a Variant.

DBColumnAwareSupport methods

lazyOpen()

  protected void lazyOpen()
lazyOpen() is used to allow the DataSet to be opened only after both the dataSet and columnName values are set. It sets to true on the first valid open attempt.

resetValue()

  public void resetValue()
Resets the value of the column to its previous value.

setFromString(java.lang.String)

  public boolean setFromString(String string)
Sets the column value with the specified string by calling the setFromString(java.lang.String, java.awt.Component) method and returns true if setting the value was successful. The string parameter contains the text string to which the column value is set. If the column value is not set successfully, the method returns false.

setFromString(java.lang.String, java.awt.Component)

  public boolean setFromString(String string, Component focusedComponent)
Sets the column value with the specified string and returns true if the column is successfully set. If the column value is not set successfully, the method returns false. The string parameter contains the text string to which the column value is set. The focusedComponent is the component that has the current focus.

setFromString2(java.lang.String, java.awt.Component, com.borland.dbswing.DBColumnAwareSupport)

  public void setFromString2(String string, Component focusedComponent, DBColumnAwareSupport columnAwareSupport)
Sets the column value with the specified string. The string parameter contains the text string to which the column value is set. The focusedComponent is the component that has the current focus.