|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.impl.InputElement
org.zkoss.zul.impl.FormatInputElement
org.zkoss.zul.Datebox
public class Datebox
An edit box for holding a date.
Default HtmlBasedComponent.getSclass(): datebox.
The default format (FormatInputElement.getFormat()) depends on JVM's setting
and the current user's locale. That is,
DateFormat.getDateInstance(DateFormat,DEFAULT, Locales.getCurrent).
You might override getDefaultFormat() to provide your own default
format.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zul.impl.InputElement |
|---|
InputElement.ExtraCtrl |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
Datebox()
|
|
Datebox(java.util.Date date)
|
|
| Method Summary | |
|---|---|
protected java.lang.Object |
coerceFromString(java.lang.String value)
Coerces the value passed to InputElement.setText(java.lang.String). |
protected java.lang.String |
coerceToString(java.lang.Object value)
Coerces the value passed to InputElement.setText(java.lang.String). |
protected java.text.DateFormat |
getDateFormat(java.lang.String fmt)
Returns the date format of the specified format Default: it uses SimpleDateFormat to format the date. |
protected java.lang.String |
getDefaultFormat()
Returns the default format, which is used when contructing a datebox. |
java.lang.String |
getInnerAttrs()
Generates the Client-Side-Action attributes to the interior tag. |
java.lang.String |
getOuterAttrs()
|
protected int |
getRealStyleFlags()
Returns RS_NO_WIDTH|RS_NO_HEIGHT. |
java.util.TimeZone |
getTimeZone()
Returns the time zone that this date box belongs to, or null if the default time zone is used. |
java.util.Date |
getValue()
Returns the value (in Date), might be null unless a constraint stops it. |
boolean |
isButtonVisible()
Returns whether the button (on the right of the textbox) is visible. |
boolean |
isCompact()
Returns whether to use a compact layout. |
boolean |
isLenient()
Returns whether or not date/time parsing is to be lenient. |
void |
setButtonVisible(boolean visible)
Sets whether the button (on the right of the textbox) is visible. |
void |
setCompact(boolean compact)
Sets whether to use a compact layout. |
void |
setFormat(java.lang.String format)
Sets the format. |
void |
setLenient(boolean lenient)
Returns whether or not date/time parsing is to be lenient. |
void |
setTimeZone(java.util.TimeZone tzone)
Sets the time zone that this date box belongs to, or null if the default time zone is used. |
void |
setValue(java.util.Date value)
Sets the value (in Date). |
| Methods inherited from class org.zkoss.zul.impl.FormatInputElement |
|---|
getFormat, isAsapRequired |
| Methods inherited from class org.zkoss.zul.impl.InputElement |
|---|
checkUserError, clearErrorMessage, getAreaText, getCols, getConstraint, getErrorMessage, getMaxlength, getName, getRawText, getRawValue, getTabindex, getTargetValue, getText, getType, isChildable, isDisabled, isMultiline, isReadonly, isValid, newExtraCtrl, onWrongValue, select, setCols, setConstraint, setConstraint, setDisabled, setMaxlength, setName, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText, showCustomError, validate |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getAllOnClickAttrs, getContext, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex |
| Methods inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Datebox()
public Datebox(java.util.Date date)
throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException| Method Detail |
|---|
protected java.lang.String getDefaultFormat()
The default format (FormatInputElement.getFormat()) depends on JVM's setting
and the current user's locale. That is,
DateFormat.getDateInstance(DateFormat,DEFAULT, Locales.getCurrent).
You might override this method to provide your own default format.
public boolean isLenient()
With lenient parsing, the parser may use heuristics to interpret inputs that do not precisely match this object's format. With strict parsing, inputs must match this object's format.
public void setLenient(boolean lenient)
Default: true.
With lenient parsing, the parser may use heuristics to interpret inputs that do not precisely match this object's format. With strict parsing, inputs must match this object's format.
public boolean isCompact()
Default: true if zh_TW or zh_CN; false otherwise.
public void setCompact(boolean compact)
public boolean isButtonVisible()
Default: true.
public void setButtonVisible(boolean visible)
public java.util.Date getValue()
throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException - if user entered a wrong value
public void setValue(java.util.Date value)
throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException - if value is wrong
public void setFormat(java.lang.String format)
throws org.zkoss.zk.ui.WrongValueException
FormatInputElement
setFormat in class FormatInputElementorg.zkoss.zk.ui.WrongValueExceptionpublic java.util.TimeZone getTimeZone()
The default time zone is determined by TimeZones.getCurrent().
public void setTimeZone(java.util.TimeZone tzone)
The default time zone is determined by TimeZones.getCurrent().
protected java.lang.Object coerceFromString(java.lang.String value)
throws org.zkoss.zk.ui.WrongValueException
InputElementInputElement.setText(java.lang.String).
Deriving note:
If you want to store the value in other type, say BigDecimal,
you have to override InputElement.coerceToString(java.lang.Object) and InputElement.coerceFromString(java.lang.String)
to convert between a string and your targeting type.
Moreover, when Textbox is called, it calls this method
with value = null. Derives shall handle this case properly.
coerceFromString in class InputElementorg.zkoss.zk.ui.WrongValueExceptionprotected java.lang.String coerceToString(java.lang.Object value)
InputElementInputElement.setText(java.lang.String).
Default: convert null to an empty string.
Deriving note:
If you want to store the value in other type, say BigDecimal,
you have to override InputElement.coerceToString(java.lang.Object) and InputElement.coerceFromString(java.lang.String)
to convert between a string and your targeting type.
coerceToString in class InputElementprotected java.text.DateFormat getDateFormat(java.lang.String fmt)
Default: it uses SimpleDateFormat to format the date.
fmt - the pattern.public java.lang.String getOuterAttrs()
getOuterAttrs in class FormatInputElementpublic java.lang.String getInnerAttrs()
XulElement
getInnerAttrs in class InputElementprotected int getRealStyleFlags()
getRealStyleFlags in class org.zkoss.zk.ui.HtmlBasedComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||