borland Packages Class Hierarchy dbswing Package
java.lang.Object +----com.borland.dbswing.DBColumnAwareSupport +----com.borland.dbswing.DBLabelSupport
Constructors Properties Methods
Implements AccessListener, ColumnAware, DataChangeListener, DataSetAware, Serializable, EventListener
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.
DBListModel
, DBListDataBinder
, DBButtonDataBinder
,
DBLabelDataBinder
,
DBSliderDataBinder
,
DBTreeDataBinder
,
DBTreeNavBinder
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 null
for objects which don't implement either interface.
public Column getColumn()Returns the column.
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.
public int getColumnOrdinal()Returns the ordinal of the column in the
DataSet
. By default, this value is -1, meaning no column is indicated.
public DataSet getDataSet() public void setDataSet(DataSet dataSet)Returns and sets the
DataSet
from which values are read and to which values are written.
public String getFormattedString()Returns the value of the column as a formatted string.
public boolean isNull()If the column value is
null
, this property returns true
.
public void setObject(Object object)Sets the column value in the
DataSet
using the value of the object
parameter.
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
.
public Variant getVariant() public void setVariant(Variant value)Returns and sets the column value as a
Variant
.
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.
public void resetValue()Resets the value of the column to its previous value.
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
.
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.
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.