|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
nextapp.echo.text.TextComponent
nextapp.echo.TextField
echopoint.TextField
echopoint.AbstractDateTimeField
public abstract class AbstractDateTimeField
The AbstractDateTimeField
class is an abstract Component that
can be used as the baisis for allowing a user to enter in a date or time.
The AbstractDateTimeField
has a DateFormat
that
is used to parse and sets its current value (remember it is derived from
TextField
).
Remember that at any one time the text value can be an invalid date/time. You must check the date/time in you code before accepting it as valid.
Nested Class Summary | |
---|---|
static class |
AbstractDateTimeField.NestedStyleInfo
Nested public static StyleInfo class. |
Field Summary | |
---|---|
static java.lang.String |
AUTO_COLLAPSE_CHANGED_PROPERTY
Auto Collapse Property |
static java.lang.String |
CSS_CLASS_CHANGED_PROPERTY
Css Class Property |
static java.lang.String |
DATE_FORMAT_CHANGED_PROPERTY
DateFormat Property |
static ImageReference |
DEFAULT_DROP_DOWN_ICON
Default Drop Down Icon |
static java.lang.String |
DROP_DOWN_BUTTON_BACKGROUND_CHANGED_PROPERTY
|
static java.lang.String |
DROP_DOWN_ICON_CHANGED_PROPERTY
|
static java.lang.String |
EXPANSION_MODEL_CHANGED_PROPERTY
Model Property |
static java.lang.String |
INVALID_COLOR_CHANGED_PROPERTY
|
static java.lang.String |
STYLE_DROP_DOWN_BUTTON_BACKGROUND
Drop Down Button Color Property |
static java.lang.String |
STYLE_DROP_DOWN_ICON
Drop Down Icon Property |
static java.lang.String |
STYLE_INVALID_COLOR
Invalid Date Color Property |
Fields inherited from interface echopoint.positionable.MouseCursorable |
---|
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI |
Fields inherited from interface nextapp.echo.ToolTipSupport |
---|
TOOL_TIP_TEXT_CHANGED_PROPERTY |
Constructor Summary | |
---|---|
AbstractDateTimeField()
Creates a AbstractDateTimeField |
|
AbstractDateTimeField(java.util.Calendar cal)
Creates a AbstractDateTimeField with cal as
the initial Date value. |
|
AbstractDateTimeField(java.util.Calendar cal,
int columns)
Creates a AbstractDateTimeField with cal as
the initial value and a given column size. |
|
AbstractDateTimeField(java.util.Calendar cal,
int columns,
java.util.Locale locale)
Creates a AbstractDateTimeField with cal as
the initial value and a given column size as well as a specific Locale. |
|
AbstractDateTimeField(java.util.Calendar cal,
java.util.Locale locale)
Creates a AbstractDateTimeField with cal as
the initial Date value and a specific Locale. |
|
AbstractDateTimeField(int columns)
Creates a AbstractDateTimeField that is columns
wide. |
|
AbstractDateTimeField(java.lang.String text)
Creates a AbstractDateTimeField with text
as the initial value. |
|
AbstractDateTimeField(java.lang.String text,
int columns)
Creates a AbstractDateTimeField with text
as the initial value and that is columns wide. |
Method Summary | |
---|---|
protected void |
_reRegisterComponents(Component oldValue,
Component newValue)
adds and removes an Component from the current hierarchy tree |
void |
applyStyle(Style style)
Applies the provided style to the component. |
java.lang.String |
getCssClass()
|
java.util.Calendar |
getDate()
This method will return a Calendar object created by parsing the current text in the AbstractDateTimeField with the current DateFormat. |
java.text.DateFormat |
getDateFormat()
Returns the DateFormat in use. |
protected abstract java.text.DateFormat |
getDefaultDateFormat(java.util.Locale locale)
Implementing classes must return a default DateFormat that
is used during object contruction. |
Color |
getDropDownButtonBackground()
Returns the background Color of the drop down button |
ImageReference |
getDropDownIcon()
Gets the icon to be used as the drop down image |
ExpandableModel |
getExpansionModel()
|
Color |
getInvalidColor()
Returns the color used by the AbstractDateTimeField when an invalid date/time value is currently entered. |
boolean |
isAutoCollapse()
Returns TRUE if the AbstractDateTimeField will revert to a collapsed state when a date/time is selected. |
boolean |
isExpanded()
|
boolean |
isValidDateTime()
This method returns TRUE if the text of the AbstractDateTimeField can be parsed into a valid date/time with the current DateFormat. |
protected void |
localeChanged()
Called when the Locale properly has changed. |
protected abstract void |
onConstruction(java.util.Calendar cal)
Implementing classes can implement this to do extra object construction. |
java.lang.Object |
set(java.lang.reflect.Field field,
java.lang.Object newValue)
Called to save the old value of a field, set in a new value and return the old value of a field. |
void |
setAutoCollapse(boolean newAutoCollapse)
Sets whether the AbstractDateTimeField will revert to a collapsed state when a date/time is selected from its drop down. |
void |
setCssClass(java.lang.String newValue)
|
void |
setDateFormat(java.text.DateFormat newDateFormat)
Sets the DateFormat to be used by the AbstractDateTimeField for displaying and parsing entered data. |
void |
setDropDownButtonBackground(Color newValue)
Sets the background Color of the drop down button |
void |
setDropDownIcon(ImageReference dropDownIcon)
Sets the icon to be used as the drop down image |
void |
setEnabled(boolean newValue)
Sets whether the component is enabled. |
void |
setExpanded(boolean isExpanded)
Sets whether the AbstractDateTimeField is expanded or not
and hence whether its contained DatePicker is showing. |
void |
setExpansionModel(ExpandableModel newExpansionModel)
Sets the ExpandableModel model used by the
AbstractDateTimeField . |
void |
setInvalidColor(Color newInvalidColor)
Sets the color used by the AbstractDateTimeField when an invalid date/time value is currently entered. |
void |
stateChanged(ChangeEvent e)
Invoked when a state change occurs. |
Methods inherited from class nextapp.echo.text.TextComponent |
---|
getDocument, getHorizontalAlignment, getText, isEditable, setDocument, setEditable, setHorizontalAlignment, setText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface echopoint.validation.Validateable |
---|
getIdentifier, getLocale, getText |
Field Detail |
---|
public static final java.lang.String EXPANSION_MODEL_CHANGED_PROPERTY
public static final java.lang.String DATE_FORMAT_CHANGED_PROPERTY
public static final java.lang.String STYLE_INVALID_COLOR
public static final java.lang.String INVALID_COLOR_CHANGED_PROPERTY
public static final java.lang.String STYLE_DROP_DOWN_BUTTON_BACKGROUND
public static final java.lang.String DROP_DOWN_BUTTON_BACKGROUND_CHANGED_PROPERTY
public static final ImageReference DEFAULT_DROP_DOWN_ICON
public static final java.lang.String STYLE_DROP_DOWN_ICON
public static final java.lang.String DROP_DOWN_ICON_CHANGED_PROPERTY
public static final java.lang.String AUTO_COLLAPSE_CHANGED_PROPERTY
public static final java.lang.String CSS_CLASS_CHANGED_PROPERTY
Constructor Detail |
---|
public AbstractDateTimeField()
AbstractDateTimeField
public AbstractDateTimeField(int columns)
AbstractDateTimeField
that is columns
wide.
public AbstractDateTimeField(java.lang.String text)
AbstractDateTimeField
with text
as the initial value.
public AbstractDateTimeField(java.lang.String text, int columns)
AbstractDateTimeField
with text
as the initial value and that is columns
wide.
public AbstractDateTimeField(java.util.Calendar cal)
AbstractDateTimeField
with cal
as
the initial Date value.
public AbstractDateTimeField(java.util.Calendar cal, java.util.Locale locale)
AbstractDateTimeField
with cal
as
the initial Date value and a specific Locale.
public AbstractDateTimeField(java.util.Calendar cal, int columns)
AbstractDateTimeField
with cal
as
the initial value and a given column size.
public AbstractDateTimeField(java.util.Calendar cal, int columns, java.util.Locale locale)
AbstractDateTimeField
with cal
as
the initial value and a given column size as well as a specific Locale.
Method Detail |
---|
protected void localeChanged()
protected abstract java.text.DateFormat getDefaultDateFormat(java.util.Locale locale)
DateFormat
that
is used during object contruction.
protected abstract void onConstruction(java.util.Calendar cal)
protected void _reRegisterComponents(Component oldValue, Component newValue)
public void applyStyle(Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle
in interface Borderable
applyStyle
in interface MouseCursorable
applyStyle
in interface Component
applyStyle
in class TextField
style
- The style object from which to retrieve properties for this
Component
.Borderable.applyStyle(nextapp.echo.Style)
public java.util.Calendar getDate()
public java.text.DateFormat getDateFormat()
public ExpandableModel getExpansionModel()
ExpandableModel
model of the
AbstractDateTimeField
.public Color getInvalidColor()
public boolean isAutoCollapse()
public boolean isExpanded()
AbstractDateTimeField
is expanded or not,
and hence whether it is showing its underlying drop down
component.public boolean isValidDateTime()
public void setAutoCollapse(boolean newAutoCollapse)
newAutoCollapse
- booleanpublic void setDateFormat(java.text.DateFormat newDateFormat)
newDateFormat
- java.text.DateFormatpublic void setExpanded(boolean isExpanded)
AbstractDateTimeField
is expanded or not
and hence whether its contained DatePicker is showing.
public void setExpansionModel(ExpandableModel newExpansionModel)
ExpandableModel
model used by the
AbstractDateTimeField
.
public void setInvalidColor(Color newInvalidColor)
newInvalidColor
- nextapp.echo.Colorpublic Color getDropDownButtonBackground()
public void setDropDownButtonBackground(Color newValue)
newValue
- -
the new background colorpublic void setEnabled(boolean newValue)
Component
setEnabled
in interface Component
setEnabled
in class AbstractComponent
newValue
- True if the component is enabled.Component.setEnabled(boolean)
public ImageReference getDropDownIcon()
public void setDropDownIcon(ImageReference dropDownIcon)
dropDownIcon
- -
the new drop down iconpublic java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue) throws java.lang.Exception
ReflectionSetter
public Object set(Field f, Object newValue) throws Exception { Object oldValue = f.get(this); f.set(this,newValue); return oldValue; }
set
in interface ReflectionSetter
set
in class TextField
field
- - the field to be setnewValue
- - the new value to be set
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.Exception
ReflectionSetter.set(Field, Object)
public void stateChanged(ChangeEvent e)
ChangeListener
stateChanged
in interface ChangeListener
e
- The event describing the state change.public java.lang.String getCssClass()
getCssClass
in class TextComponent
public void setCssClass(java.lang.String newValue)
setCssClass
in class TextComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |