JDatePicker v4.3

com.standbysoft.component.date.swing.binding
Class DateEditComponentAdapter

java.lang.Object
  extended bycom.standbysoft.component.date.DefaultDateModel
      extended bycom.standbysoft.component.date.swing.binding.DateEditComponentAdapter
All Implemented Interfaces:
DateModel

public class DateEditComponentAdapter
extends DefaultDateModel

Converts ValueModels to the DateModel interface. Useful to bind JDateEditComponents to a ValueModel.

Example:

 ValueModel model = new PropertyAdapter(book, "published", date);
 JDateField publishedDateField = new JDateField();
 publishedDateField.setDateModel(new DateEditComponentAdapter(model));
 publishedDateField.commitEdit();
 


Field Summary
 
Fields inherited from class com.standbysoft.component.date.DefaultDateModel
FIELDS
 
Constructor Summary
DateEditComponentAdapter(com.jgoodies.binding.value.ValueModel subject)
          Constructs a DateEditComponentAdapter on the given subject for the specified choice.
 
Method Summary
static void bind(JDateEditComponent dateEditComponent, com.jgoodies.binding.value.ValueModel model)
          Binds a date edit component to a specified value model.
 java.util.Date getDate()
          Returns the date wrapped by this model.
 void setDate(java.util.Date date)
          Specifies a new date to be represented by this model that can later be modified field by field.
 
Methods inherited from class com.standbysoft.component.date.DefaultDateModel
addDateListener, clear, fireDateChanged, fireDateFieldChanged, fireDateFieldCleared, get, getAutoCenturyYear, getMaximumAllowed, getMinimumAllowed, getTimeZone, isAutoCentury, isDateValid, isSet, isUsed, removeDateListener, set, setAutoCentury, setAutoCenturyYear, setTimeZone, setUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateEditComponentAdapter

public DateEditComponentAdapter(com.jgoodies.binding.value.ValueModel subject)
Constructs a DateEditComponentAdapter on the given subject for the specified choice.

Parameters:
subject - the subject that holds the value
Throws:
java.lang.NullPointerException - if the subject is null
Method Detail

setDate

public void setDate(java.util.Date date)
Description copied from interface: DateModel
Specifies a new date to be represented by this model that can later be modified field by field. A null date will clear all the basic fields like Calendar.YEAR, Calendar.MONTH, Calendar.DATE, Calendar.HOUR, Calendar.MINUTE, Calendar.SECOND and Calendar.MILLISECOND.

Specified by:
setDate in interface DateModel
Overrides:
setDate in class DefaultDateModel

getDate

public java.util.Date getDate()
Description copied from interface: DateModel
Returns the date wrapped by this model. If there are missing fields and the date cannot be computed then a null date is returned.

Specified by:
getDate in interface DateModel
Overrides:
getDate in class DefaultDateModel
See Also:
DefaultDateModel.isDateValid()

bind

public static void bind(JDateEditComponent dateEditComponent,
                        com.jgoodies.binding.value.ValueModel model)
Binds a date edit component to a specified value model.

Parameters:
dateEditComponent - component that is binded to a value model
model - value model where the component is binded

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.