|
|||||||||
| 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
echopoint.DateField
public class DateField
The DateField class is a TextField component that can be
used to allow a user to enter in a date.
The DateField has a DateFormat that is used to parse and sets its
current value (remember it is derived from TextField).
The DateField also contains a DatePicker object that
can be popped down by the user. This allows the user to navigate to
a valid date without having to enter it in the right format.
Remember that at any one time the text value can be an invalid date. You must check the date in you code before accepting it as valid.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class echopoint.AbstractDateTimeField |
|---|
AbstractDateTimeField.NestedStyleInfo |
| Field Summary | |
|---|---|
static java.lang.String |
DATEPICKER_CHANGED_PROPERTY
DatePicker 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 | |
|---|---|
DateField()
Creates a DateField |
|
DateField(java.util.Calendar cal)
Creates a DateField with cal as the initial
value. |
|
DateField(java.util.Calendar cal,
int columns)
Creates a DateField with cal as the initial
value and a given column size. |
|
DateField(java.util.Calendar cal,
int columns,
java.util.Locale locale)
Creates a DateField with cal as the initial
value and a given column size and a specified Locale. |
|
DateField(java.util.Calendar cal,
java.util.Locale locale)
Creates a DateField with cal as the initial
value and specified Locale. |
|
DateField(int columns)
Creates a DateField that is columns wide. |
|
DateField(java.lang.String text)
Creates a DateField with text as the initial
value. |
|
DateField(java.lang.String text,
int columns)
Creates a DateField with text as the initial
value and that is columns wide. |
|
| Method Summary | |
|---|---|
void |
applyStyle(Style style)
Applies the provided style to the component. |
java.util.Calendar |
getDate()
This method will return a Calendar object created by parsing the current text in the DateField with the current DateFormat. |
DatePicker |
getDatePicker()
Returns the underlying DatePicker being used by the DateField |
protected java.text.DateFormat |
getDefaultDateFormat(java.util.Locale locale)
Returns DateFormat.getDateInstance(DateFormat.MEDIUM,locale); |
protected void |
localeChanged()
Called when the Locale properly has changed. |
protected void |
onConstruction(java.util.Calendar cal)
Called at contruction time to add extra bits to the DateField |
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 |
setDate(java.util.Calendar newValue)
This will set the text fo the DateField according to the format of the current DateFormat. |
void |
setDatePicker(DatePicker newDatePicker)
Sets the a new DatePicker into the DateField. |
void |
setText(java.lang.String newValue)
Sets the text contained in the document model. |
| Methods inherited from class nextapp.echo.text.TextComponent |
|---|
getDocument, getHorizontalAlignment, getText, isEditable, setDocument, setEditable, setHorizontalAlignment |
| 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 DATEPICKER_CHANGED_PROPERTY
| Constructor Detail |
|---|
public DateField()
DateField
public DateField(int columns)
DateField that is columns wide.
public DateField(java.lang.String text)
DateField with text as the initial
value.
public DateField(java.lang.String text,
int columns)
DateField with text as the initial
value and that is columns wide.
public DateField(java.util.Calendar cal)
DateField with cal as the initial
value.
public DateField(java.util.Calendar cal,
java.util.Locale locale)
DateField with cal as the initial
value and specified Locale.
public DateField(java.util.Calendar cal,
int columns)
DateField with cal as the initial
value and a given column size.
public DateField(java.util.Calendar cal,
int columns,
java.util.Locale locale)
DateField with cal as the initial
value and a given column size and a specified Locale.
| Method Detail |
|---|
protected java.text.DateFormat getDefaultDateFormat(java.util.Locale locale)
getDefaultDateFormat in class AbstractDateTimeFieldAbstractDateTimeField.getDefaultDateFormat(Locale)protected void onConstruction(java.util.Calendar cal)
onConstruction in class AbstractDateTimeFieldprotected void localeChanged()
AbstractDateTimeField
localeChanged in class AbstractDateTimeFieldAbstractDateTimeField.localeChanged()public void applyStyle(Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle in interface BorderableapplyStyle in interface MouseCursorableapplyStyle in interface ComponentapplyStyle in class AbstractDateTimeFieldstyle - The style object from which to retrieve properties for this
Component.Borderable.applyStyle(nextapp.echo.Style)public java.util.Calendar getDate()
getDate in class AbstractDateTimeFieldpublic void setDate(java.util.Calendar newValue)
newValue - public DatePicker getDatePicker()
public void setDatePicker(DatePicker newDatePicker)
The implication of all this is that CalendarSelectionModel model listeners should be added after the DatePicker has been set into the DateField. /
newDatePicker - echopoint..DatePickerpublic void setText(java.lang.String newValue)
setText in class TextComponentnewValue - The text to replace the text in the document model.
public 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 ReflectionSetterset in class AbstractDateTimeFieldfield - - the field to be setnewValue - - the new value to be set
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.ExceptionReflectionSetter.set(Field, Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||