public class SimpleDateFormatEditor extends Object implements PropertyEditor
SimpleDateFormat| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_FORMAT
the default format
|
| Constructor and Description |
|---|
SimpleDateFormatEditor()
Constructs a new SimpleDateFormatEditor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds an object to the list of those that wish to be informed when the
date format changes.
|
String |
getAsText()
Returns the date format string.
|
Component |
getCustomEditor()
Gets a GUI component with which the user can edit the date format.
|
String |
getJavaInitializationString()
Returns the Java code that generates an object the same as the one being edited.
|
String[] |
getTags()
Some objects can return tags, but a date format cannot.
|
Object |
getValue()
Gets the date format that is being edited.
|
boolean |
isPaintable()
Indicates whether the object can be represented graphically.
|
void |
paintValue(Graphics gfx,
Rectangle box)
Paints a graphical representation of the object.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes an object from the list of those that wish to be informed when the
date format changes.
|
void |
setAsText(String text)
Sets the date format string.
|
void |
setValue(Object value)
Sets the value of the date format to be edited.
|
boolean |
supportsCustomEditor()
Indicates whether the date format can be edited in a GUI, which it can.
|
public static final String DEFAULT_FORMAT
public SimpleDateFormatEditor()
public void setValue(Object value)
setValue in interface PropertyEditorvalue - a SimpleDateFormat object to be editedpublic Object getValue()
getValue in interface PropertyEditorpublic boolean isPaintable()
isPaintable in interface PropertyEditorpublic void paintValue(Graphics gfx, Rectangle box)
paintValue in interface PropertyEditorgfx - the graphics context to draw the representation tobox - the bounds within which the representation should fit.public String getJavaInitializationString()
getJavaInitializationString in interface PropertyEditorpublic String getAsText()
getAsText in interface PropertyEditorpublic void setAsText(String text)
setAsText in interface PropertyEditortext - the date format stringpublic String[] getTags()
getTags in interface PropertyEditorpublic Component getCustomEditor()
getCustomEditor in interface PropertyEditorpublic boolean supportsCustomEditor()
supportsCustomEditor in interface PropertyEditorpublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface PropertyEditorlistener - a new listener to add to the listpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface PropertyEditorlistener - the listener to remove from the listCopyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.