|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnextapp.echo.AbstractComponent
net.sf.jzeno.echo.components.CustomComponent
net.sf.jzeno.echo.databinding.DynaDateField
public class DynaDateField
A date editor, bind it to a property of type java.util.Date . It features a calendar pop-up, to allow the user to select a date. Users can also enter the date by hand.
The date editor uses the globally configured date format (see
EchoSupport.getDateFormat()).
Regionalisation is supported, and conversion of the entered time (most likely
in local time of the user) into UTC for internal use can be configured by
specifying a propery path to a TimeZone.
Translation will also happen in the inverse direction. In general it is
highly recommended to store dates and times in your application in UTC, and
only translate to local dates and times at interfaces of your system
(GUI/Messageing/etc..).
| Nested Class Summary | |
|---|---|
class |
DynaDateField.DefaultValidator
|
| Nested classes/interfaces inherited from interface echopoint.positionable.Borderable |
|---|
Borderable.NestedStyleInfo |
| Nested classes/interfaces inherited from interface echopoint.positionable.MouseCursorable |
|---|
MouseCursorable.NestedStyleInfo |
| Field Summary | |
|---|---|
static int |
CHARACTER_UNITS
|
static int |
PERCENT_UNITS
|
static int |
PIXEL_UNITS
|
| 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 |
| Constructor Summary | |
|---|---|
DynaDateField()
Creates an unbound component. |
|
DynaDateField(java.lang.Class beanClass,
java.lang.String property,
java.lang.String constructionHints)
Creates a databound datefield. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Invoked when an action occurs. |
void |
applyContext()
|
java.lang.String |
getActionCommand()
|
Color |
getBackground()
Gets the background color of the date field. |
Color |
getBorderColor()
|
int |
getBorderSize()
|
int |
getBorderStyle()
Gets the border style of the button. |
Color |
getBottomBorderColor()
|
int |
getBottomBorderSize()
|
int |
getBottomBorderStyle()
|
java.lang.String |
getCssClass()
|
java.text.DateFormat |
getDateFormat()
|
Font |
getFont()
Returns the font. |
Color |
getForeground()
Gets the foregound color. |
java.lang.String |
getIconName()
|
java.lang.String |
getInvalidMessage()
Gets the message key that is added to the screen, when the component is marked as invalid. |
java.lang.String |
getInvalidMessageKey()
Deprecated. use getInvalidMessage() instead |
Color |
getLeftBorderColor()
|
int |
getLeftBorderSize()
|
int |
getLeftBorderStyle()
|
int |
getMaximumYear()
|
int |
getMinimumYear()
|
int |
getMouseCursor()
Returns the current mouse cursor in use. |
java.lang.String |
getMouseCursorURI()
|
java.lang.String |
getNullValue()
Gets the input string that corresponds with the value null. |
Color |
getRightBorderColor()
|
int |
getRightBorderSize()
|
int |
getRightBorderStyle()
|
java.lang.String |
getTimeZoneProperty()
Gets the property path that binds this date field to a TimeZoneinstance. |
Color |
getTopBorderColor()
|
int |
getTopBorderSize()
|
int |
getTopBorderStyle()
|
int |
getWidth()
Gets the width of the text field. |
int |
getWidthUnits()
Gets the units in which width is specified. |
boolean |
isAsync()
|
boolean |
isReadOnly()
Returns whether or not the datefield is read-only. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Used internally. |
void |
rebind()
This operation causes the component to reset it's content to that of the domain model. |
void |
setActionCommand(java.lang.String command)
|
void |
setAsync(boolean value)
|
void |
setBackground(Color backgroundColor)
Sets the background color of the date field. |
void |
setBorderColor(Color borderColor)
Sets the Color of the Borderable's border. |
void |
setBorderSize(int borderSize)
Sets the size of the Borderables's border. |
void |
setBorderStyle(int style)
Sets the border style of the button. |
void |
setBottomBorderColor(Color borderColor)
Sets the Color of the Borderable's bottom border. |
void |
setBottomBorderSize(int borderSize)
Sets the size of the Borderables's bottom border. |
void |
setBottomBorderStyle(int borderStyle)
Sets the border style of the Borderables's bottom border. |
void |
setCssClass(java.lang.String newValue)
|
void |
setFocused(boolean focused)
Sets the input focus to this component. |
void |
setFont(Font font)
Sets the font of the component. |
void |
setForeground(Color foreground)
Sets the foreground color. |
void |
setIconName(java.lang.String iconName)
Sets the drop down icon you want to use. |
void |
setInvalidMessage(java.lang.String invalidMessageKey)
Sets the message key that is shown when the component is marked as invalid. |
void |
setInvalidMessageKey(java.lang.String s)
Deprecated. use setInvalidMessage() instead |
void |
setLeftBorderColor(Color borderColor)
Sets the Color of the Borderable's left border. |
void |
setLeftBorderSize(int borderSize)
Sets the size of the Borderables's left border. |
void |
setLeftBorderStyle(int borderStyle)
Sets the border style of the Borderables's left border. |
void |
setMaximumLengh(int maximumLength)
|
void |
setMaximumYear(int maximumYear)
|
void |
setMinimumYear(int minimumYear)
|
void |
setMouseCursor(int mouseCursor)
Sets the mouse cursor to use. |
void |
setMouseCursorURI(java.lang.String mouseCursorURI)
Sets the URI to a custom platform mouse cursor. |
void |
setNullValue(java.lang.String nullValue)
Sets the input string that corresponds with the property value null . |
void |
setReadOnly(boolean readOnly)
Sets whether or not the datefield is read-only. |
void |
setRequired(boolean required)
Determine if the editor is required to be filled in. |
void |
setRightBorderColor(Color borderColor)
Sets the Color of the Borderable's right border. |
void |
setRightBorderSize(int borderSize)
Sets the size of the Borderables's right border. |
void |
setRightBorderStyle(int borderStyle)
Sets the border style of the Borderables's right border. |
void |
setTimeZoneProperty(java.lang.String property)
Sets the property path that binds this date field to a TimeZoneinstance. |
void |
setTopBorderColor(Color borderColor)
Sets the Color of the Borderable's top border. |
void |
setTopBorderSize(int borderSize)
Sets the size of the Borderables's top border. |
void |
setTopBorderStyle(int borderStyle)
Sets the border style of the Borderables's top border. |
void |
setWidth(int width)
Sets the width of the text field. |
void |
setWidthUnits(int units)
Sets the units in which width is specified. |
| Methods inherited from class net.sf.jzeno.echo.components.CustomComponent |
|---|
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isRequired, isValid, markInvalid, markValid, preRender, removeValidator, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setValue, traceValue, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface echopoint.positionable.Borderable |
|---|
applyStyle |
| Methods inherited from interface echopoint.positionable.MouseCursorable |
|---|
applyStyle |
| Field Detail |
|---|
public static final int CHARACTER_UNITS
public static final int PIXEL_UNITS
public static final int PERCENT_UNITS
| Constructor Detail |
|---|
public DynaDateField()
Creates an unbound component.
public DynaDateField(java.lang.Class beanClass,
java.lang.String property,
java.lang.String constructionHints)
Creates a databound datefield. You should bind it to a property of type java.util.Date.
| Method Detail |
|---|
public void rebind()
RebindableComponentThis operation causes the component to reset it's content to that of the domain model.
rebind in interface RebindableComponentrebind in class CustomComponentpublic void propertyChange(java.beans.PropertyChangeEvent evt)
Used internally.
propertyChange in interface java.beans.PropertyChangeListenerpublic java.lang.String getNullValue()
Gets the input string that corresponds with the value null.
Also see setNullValue(String).
public void setNullValue(java.lang.String nullValue)
Sets the input string that corresponds with the property value null
. If a users enters this special input string, null
will be written to our bound property. A typical case would be setting
nullValue to an empty string. To remove the nullValue, call this method
with null.
public java.lang.String getInvalidMessage()
Gets the message key that is added to the screen, when the component is
marked as invalid. Also see setInvalidMessage(String).
public void setInvalidMessage(java.lang.String invalidMessageKey)
Sets the message key that is shown when the component is marked as
invalid. Typically the component is marked invalid when you call
in
your code. The value specified for this property is translated through
the i18n support in jZeno (EchoSupport.doValidationRecursively(Component)i18n.properties).
public java.lang.String getInvalidMessageKey()
public void setInvalidMessageKey(java.lang.String s)
public boolean isReadOnly()
Returns whether or not the datefield is read-only. Also see
setReadOnly(boolean).
isReadOnly in interface PropertyComponentisReadOnly in class CustomComponentpublic void setReadOnly(boolean readOnly)
Sets whether or not the datefield is read-only. If it is read-only the user will not be able to enter a new date. He will not be able to use the calendar pop-up either. Besides this the component will be grayed out.
setReadOnly in interface PropertyComponentsetReadOnly in class CustomComponentpublic java.lang.String getCssClass()
public void setCssClass(java.lang.String newValue)
public int getMinimumYear()
public void setMinimumYear(int minimumYear)
public int getMaximumYear()
public void setMaximumYear(int maximumYear)
public Color getBackground()
Gets the background color of the date field.
getBackground in interface ComponentgetBackground in class AbstractComponentpublic void setBackground(Color backgroundColor)
Sets the background color of the date field. This corresponds to the color of the edit box where the user enters the date.
setBackground in interface ComponentsetBackground in class AbstractComponentbackgroundColor - The new background color of the component.public Color getForeground()
Gets the foregound color. This corresponds to the text color in the edit box, where the user enters a date.
getForeground in interface ComponentgetForeground in class AbstractComponentpublic void setForeground(Color foreground)
Sets the foreground color. This corresponds to the text color in the edit box, where the user enters a date.
setForeground in interface ComponentsetForeground in class AbstractComponentforeground - The new foreground color of the component.public void setRequired(boolean required)
PropertyComponentDetermine if the editor is required to be filled in.
setRequired in interface PropertyComponentsetRequired in class CustomComponentpublic void setTimeZoneProperty(java.lang.String property)
Sets the property path that binds this date field to a
TimeZoneinstance. This TimeZone instance will
translate from the java.util.Date we are bound to, to the date shown and
entered on the screen. The data binding property path specified starts
from the same root bean as our regular data binding.
Setting timeZenoProperty to null disables regionalisation.
This is also the default value.
public java.lang.String getTimeZoneProperty()
Gets the property path that binds this date field to a
TimeZoneinstance. Also see
setTimeZoneProperty(String).
public void setFocused(boolean focused)
Sets the input focus to this component.
setFocused in interface ComponentsetFocused in class AbstractComponentfocused - True if the component is to be focused.public int getBorderSize()
getBorderSize in interface BorderableBorderables's border.public Color getBottomBorderColor()
getBottomBorderColor in interface BorderableColor of the Borderable's bottom border.public int getBottomBorderSize()
getBottomBorderSize in interface BorderableBorderables's bottom border.public int getBottomBorderStyle()
getBottomBorderStyle in interface BorderableBorderables's bottom border.Borderable.getBorderStyle()public Color getLeftBorderColor()
getLeftBorderColor in interface BorderableColor of the Borderable's left border.public int getLeftBorderSize()
getLeftBorderSize in interface BorderableBorderables's left border.public int getLeftBorderStyle()
getLeftBorderStyle in interface BorderableBorderables's left border.Borderable.getBorderStyle()public Color getRightBorderColor()
getRightBorderColor in interface BorderableColor of the Borderable's right border.public int getRightBorderSize()
getRightBorderSize in interface BorderableBorderables's right border.public int getRightBorderStyle()
getRightBorderStyle in interface BorderableBorderables's right border.Borderable.getBorderStyle()public Color getTopBorderColor()
getTopBorderColor in interface BorderableColor of the Borderable's top border.public int getTopBorderSize()
getTopBorderSize in interface BorderableBorderables's top border.public int getTopBorderStyle()
getTopBorderStyle in interface BorderableBorderables's top border.Borderable.getBorderStyle()public void setBorderSize(int borderSize)
BorderableBorderables's border.
This will also set the left, top, right and bottom border size.
setBorderSize in interface Borderablepublic void setBottomBorderColor(Color borderColor)
BorderableColor of the Borderable's bottom border.
setBottomBorderColor in interface Borderablepublic void setBottomBorderSize(int borderSize)
BorderableBorderables's bottom border.
setBottomBorderSize in interface Borderablepublic void setBottomBorderStyle(int borderStyle)
BorderableBorderables's bottom border.
setBottomBorderStyle in interface BorderableBorderable.setBorderStyle(int)public void setLeftBorderColor(Color borderColor)
BorderableColor of the Borderable's left border.
setLeftBorderColor in interface Borderablepublic void setLeftBorderSize(int borderSize)
BorderableBorderables's left border.
setLeftBorderSize in interface Borderablepublic void setLeftBorderStyle(int borderStyle)
BorderableBorderables's left border.
setLeftBorderStyle in interface BorderableBorderable.setBorderStyle(int)public void setRightBorderColor(Color borderColor)
BorderableColor of the Borderable's right border.
setRightBorderColor in interface Borderablepublic void setRightBorderSize(int borderSize)
BorderableBorderables's right border.
setRightBorderSize in interface Borderablepublic void setRightBorderStyle(int borderStyle)
BorderableBorderables's right border.
setRightBorderStyle in interface BorderableBorderable.setBorderStyle(int)public void setTopBorderColor(Color borderColor)
BorderableColor of the Borderable's top border.
setTopBorderColor in interface Borderablepublic void setTopBorderSize(int borderSize)
BorderableBorderables's top border.
setTopBorderSize in interface Borderablepublic void setTopBorderStyle(int borderStyle)
BorderableBorderables's top border.
setTopBorderStyle in interface BorderableBorderable.setBorderStyle(int)public void setBorderStyle(int style)
Sets the border style of the button. (See the Borderable interface in EchoPoint).
setBorderStyle in interface Borderablepublic int getBorderStyle()
Gets the border style of the button.
getBorderStyle in interface Borderablepublic int getMouseCursor()
MouseCursorable
getMouseCursor in interface MouseCursorablepublic java.lang.String getMouseCursorURI()
getMouseCursorURI in interface MouseCursorablepublic void setMouseCursor(int mouseCursor)
MouseCursorable
setMouseCursor in interface MouseCursorablemouseCursor - - the mouse cursor to usepublic void setMouseCursorURI(java.lang.String mouseCursorURI)
MouseCursorable
setMouseCursorURI in interface MouseCursorablemouseCursorURI - the URI to a custom platform mouse cursor.public void setBorderColor(Color borderColor)
BorderableColor of the Borderable's border.
This will also set the left, top, right and bottom border color.
setBorderColor in interface Borderablepublic Color getBorderColor()
getBorderColor in interface BorderableColor of the Borderable's border.public void setIconName(java.lang.String iconName)
Sets the drop down icon you want to use. Specify the name of the gif/jpg/png/... image you want to show. Images should be located in the images folder, in the root of your web application.
public java.lang.String getIconName()
public void setWidth(int width)
Sets the width of the text field.
public int getWidth()
Gets the width of the text field.
public void setWidthUnits(int units)
Sets the units in which width is specified.
public int getWidthUnits()
Gets the units in which width is specified.
public void setMaximumLengh(int maximumLength)
public java.text.DateFormat getDateFormat()
public void setFont(Font font)
Component
setFont in interface ComponentsetFont in class AbstractComponentfont - The new font of the component.public Font getFont()
Component
getFont in interface ComponentgetFont in class AbstractComponentpublic void applyContext()
applyContext in interface Precreationpublic void setAsync(boolean value)
public boolean isAsync()
public void setActionCommand(java.lang.String command)
setActionCommand in interface EventSourcesetActionCommand in class CustomComponentpublic java.lang.String getActionCommand()
getActionCommand in interface EventSourcegetActionCommand in class CustomComponentpublic void actionPerformed(ActionEvent e)
ActionListener
actionPerformed in interface ActionListenere - The event describing the action.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||