photospace.beans
Class DateEditor

java.lang.Object
  extended byjava.beans.PropertyEditorSupport
      extended byphotospace.beans.DateEditor
All Implemented Interfaces:
java.beans.PropertyEditor

public class DateEditor
extends java.beans.PropertyEditorSupport


Constructor Summary
DateEditor(java.text.DateFormat dateFormat, boolean allowEmpty)
          Create a new instance, using the given DateFormat for parsing and rendering.
 
Method Summary
 void addDateFormat(java.text.DateFormat format)
           
 java.lang.String getAsText()
          Format the Date as String, using the specified DateFormat.
 void setAsText(java.lang.String text)
           
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateEditor

public DateEditor(java.text.DateFormat dateFormat,
                  boolean allowEmpty)
Create a new instance, using the given DateFormat for parsing and rendering.

The allowEmpty parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Else, an IllegalArgumentException gets thrown in that case.

Parameters:
dateFormat - DateFormat to use for parsing and rendering
allowEmpty - if empty strings should be allowed
Method Detail

addDateFormat

public void addDateFormat(java.text.DateFormat format)

setAsText

public void setAsText(java.lang.String text)
               throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getAsText

public java.lang.String getAsText()
Format the Date as String, using the specified DateFormat.