JDatePicker v4.3

com.standbysoft.component.date.swing.dbswing
Class DBDateEditComponentDataBinder

java.lang.Object
  extended bycom.standbysoft.component.date.swing.dbswing.DBDateEditComponentDataBinder
All Implemented Interfaces:
com.borland.dx.dataset.AccessListener, com.borland.dx.dataset.ColumnAware, com.borland.dx.dataset.DataChangeListener, com.borland.dx.dataset.DataSetAware, DateSelectionListener, com.borland.dbswing.DBDataBinder, com.borland.dx.dataset.Designable, java.util.EventListener, com.borland.dx.dataset.NavigationListener, java.beans.PropertyChangeListener, java.io.Serializable

public class DBDateEditComponentDataBinder
extends java.lang.Object
implements DateSelectionListener, java.beans.PropertyChangeListener, com.borland.dbswing.DBDataBinder, com.borland.dx.dataset.AccessListener, com.borland.dx.dataset.DataChangeListener, com.borland.dx.dataset.NavigationListener, com.borland.dx.dataset.ColumnAware, com.borland.dx.dataset.Designable, java.io.Serializable

Maps the state of a JDateEditComponent DateSelectionModel to a value in a DataSet date type Column. JdbDateField automatically uses a DBDateEditComponentDataBinder, and therefore it becomes a data-aware component.

There are two ways to hook up a JDateEditComponent to a DBDateEditComponentDataBinder. The easier way is to set the jDateEditComponent property to a JDateEditComponent or a subclass of JDateEditComponent.

The second way is to make any component using a DateSelectionModel data-aware by setting DBDateEditComponentDataBinder's dateSelectionModel property to the component's model. Note that when you use this approach, you are responsible for opening the DataSet before using it.

You must also set the DBDateEditComponentDataBinder's dataSet and columnName properties to specify the DataSet and Column from which the date edit component value (its current position) is read and to which the date value is written.

If you set the jDateEditComponent property, DBDateEditComponentDataBinder binds the background, foreground, and font properties from those defined on Column columnName, if one exists. This does not happen if these properties are set explicitly on DBDateEditComponentDataBinder itself.

Example:

  JDateField jDateField = new JDateField();
  DBDateEditComponentDataBinder dBDateEditDataBinder = new DBDateEditComponentDataBinder();
          
  // attach the date field to DBDateEditComponentDataBinder
  dBDateEditDataBinder.setJDateEditComponent(jDateField);
          
  // set the target DataSet and Column
  dBDateEditDataBinder.setDataSet(dataSet);
  dBDateEditDataBinder.setColumnName("Delivery")
 

See Also:
JdbDateField, Serialized Form

Field Summary
 
Fields inherited from interface com.borland.dbswing.DBDataBinder
CLEAR_VALUE, DEFAULT, DISABLE_COMPONENT
 
Constructor Summary
DBDateEditComponentDataBinder()
          Creates a default data binder.
DBDateEditComponentDataBinder(JDateEditComponent dateEditComponent)
          Creates a data binder and specifies the date edit component it makes data aware.
 
Method Summary
 void accessChange(com.borland.dx.dataset.AccessEvent event)
           
 void dataChanged(com.borland.dx.dataset.DataChangeEvent event)
           
 void dateSelectionChanged(DateSelectionEvent evt)
          Notifies that the selection of some dates has changed.
 void disabledDatesChanged(DateSelectionEvent evt)
          Notifies that the set of dates that cannot be selected has changed.
 void disabledDateSelectionAttempted(DateSelectionEvent evt)
          Notifies the attempt of selecting a disabled date (one that cannot be selected).
 void emptySelectionAllowedChanged(DateSelectionEvent evt)
          Notifies that the permission of empty selection has changed.
 java.lang.String getColumnName()
          Returns the column name of the DataSet from which values are read and to which values are written.
 com.borland.dx.dataset.DataSet getDataSet()
          Returns the DataSet from which values are read and to which values are written.
 DateSelectionModel getDateSelectionModel()
          Returns the model of the component that this binder makes data-aware.
 JDateEditComponent getJDateEditComponent()
          Returns the date edit component to which this object binds to make it data-aware.
 void navigated(com.borland.dx.dataset.NavigationEvent event)
           
 void postRow(com.borland.dx.dataset.DataChangeEvent event)
           
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void selectionModeChanged(DateSelectionEvent evt)
          Notifies that the selection mode has changed.
 void setColumnName(java.lang.String columnName)
          Specifies the column name of the DataSet from which values are read and to which values are written.
 void setDataSet(com.borland.dx.dataset.DataSet dataSet)
          Sets the DataSet from which values are read and to which values are written.
 void setDateSelectionModel(DateSelectionModel dateSelectionModel)
          Specifies the date selection model of the component that this binder makes data-aware.
 void setJDateEditComponent(JDateEditComponent dateEditComponent)
          Sets the date edit component to which this object binds to make it data-aware.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBDateEditComponentDataBinder

public DBDateEditComponentDataBinder()
Creates a default data binder.


DBDateEditComponentDataBinder

public DBDateEditComponentDataBinder(JDateEditComponent dateEditComponent)
Creates a data binder and specifies the date edit component it makes data aware.

Parameters:
dateEditComponent - date edit component it makes data aware.
Method Detail

setJDateEditComponent

public void setJDateEditComponent(JDateEditComponent dateEditComponent)
Sets the date edit component to which this object binds to make it data-aware.

Parameters:
dateEditComponent - date edit component that this binder makes data-aware
See Also:
getJDateEditComponent()

getJDateEditComponent

public JDateEditComponent getJDateEditComponent()
Returns the date edit component to which this object binds to make it data-aware.

Returns:
date edit component to which this object binds to make it data-aware.
See Also:
setJDateEditComponent(JDateEditComponent)

setDateSelectionModel

public void setDateSelectionModel(DateSelectionModel dateSelectionModel)
Specifies the date selection model of the component that this binder makes data-aware. When you set this property, you are responsible for opening the DataSet before using it. Specifying the model binds this object to the component the model supplies data values to.

Parameters:
dateSelectionModel - model of the component that this object makes data-aware
See Also:
getDateSelectionModel()

getDateSelectionModel

public DateSelectionModel getDateSelectionModel()
Returns the model of the component that this binder makes data-aware.

Returns:
model of the component that this binder makes data-aware.
See Also:
setDateSelectionModel(DateSelectionModel)

setDataSet

public void setDataSet(com.borland.dx.dataset.DataSet dataSet)
Sets the DataSet from which values are read and to which values are written.

Specified by:
setDataSet in interface com.borland.dx.dataset.DataSetAware
Parameters:
dataSet - data set from which values are read and to which values are written
See Also:
getDataSet(), setColumnName(String)

getDataSet

public com.borland.dx.dataset.DataSet getDataSet()
Returns the DataSet from which values are read and to which values are written.

Specified by:
getDataSet in interface com.borland.dx.dataset.DataSetAware
Returns:
data set from which values are read and to which values are written.
See Also:
setDataSet(DataSet), getColumnName()

setColumnName

public void setColumnName(java.lang.String columnName)
Specifies the column name of the DataSet from which values are read and to which values are written.

Specified by:
setColumnName in interface com.borland.dx.dataset.ColumnAware
Parameters:
columnName - DataSet column name from which values are read and to which values are written
See Also:
getColumnName(), setDataSet(DataSet)

getColumnName

public java.lang.String getColumnName()
Returns the column name of the DataSet from which values are read and to which values are written.

Specified by:
getColumnName in interface com.borland.dx.dataset.ColumnAware
Returns:
data set from which values are read and to which values are written.
See Also:
setColumnName(String), getDataSet()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

dateSelectionChanged

public void dateSelectionChanged(DateSelectionEvent evt)
Description copied from interface: DateSelectionListener
Notifies that the selection of some dates has changed. This means that they either have been selected or deselected.

Specified by:
dateSelectionChanged in interface DateSelectionListener
Parameters:
evt - event that describes the new selection

disabledDateSelectionAttempted

public void disabledDateSelectionAttempted(DateSelectionEvent evt)
Description copied from interface: DateSelectionListener
Notifies the attempt of selecting a disabled date (one that cannot be selected).

Specified by:
disabledDateSelectionAttempted in interface DateSelectionListener
Parameters:
evt - event that describes this action

disabledDatesChanged

public void disabledDatesChanged(DateSelectionEvent evt)
Description copied from interface: DateSelectionListener
Notifies that the set of dates that cannot be selected has changed.

Specified by:
disabledDatesChanged in interface DateSelectionListener
Parameters:
evt - event that describes this action

selectionModeChanged

public void selectionModeChanged(DateSelectionEvent evt)
Description copied from interface: DateSelectionListener
Notifies that the selection mode has changed.

Specified by:
selectionModeChanged in interface DateSelectionListener
Parameters:
evt - event that describes this action

emptySelectionAllowedChanged

public void emptySelectionAllowedChanged(DateSelectionEvent evt)
Description copied from interface: DateSelectionListener
Notifies that the permission of empty selection has changed.

Specified by:
emptySelectionAllowedChanged in interface DateSelectionListener
Parameters:
evt - event that describes this action

navigated

public void navigated(com.borland.dx.dataset.NavigationEvent event)
Specified by:
navigated in interface com.borland.dx.dataset.NavigationListener

dataChanged

public void dataChanged(com.borland.dx.dataset.DataChangeEvent event)
Specified by:
dataChanged in interface com.borland.dx.dataset.DataChangeListener

postRow

public void postRow(com.borland.dx.dataset.DataChangeEvent event)
             throws java.lang.Exception
Specified by:
postRow in interface com.borland.dx.dataset.DataChangeListener
Throws:
java.lang.Exception

accessChange

public void accessChange(com.borland.dx.dataset.AccessEvent event)
Specified by:
accessChange in interface com.borland.dx.dataset.AccessListener

JDatePicker v4.3

Visit www.jdatepicker.com for further information or send us your suggestions.

Copyright © 2003-2007 Stand By Soft Ltd. All Rights Reserved.