|
||||||||||
| 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.Timebox
public class Timebox
An input box for holding a time (a java.util.Date Object , but only Hour & Minute are used.
Default getZclass(): z-timebox. (since 3.5.0)
timebox doens't support customized format. It support HH:mm formate, where HH is hour of day and mm is minute of hour.
timebox supports below key events.
Like Combobox and Datebox,
the value of a read-only time box (InputElement.isReadonly()) can be changed
by clicking the up or down button (though users cannot type anything
in the input box).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zul.impl.InputElement |
|---|
InputElement.ExtraCtrl |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
_zclass, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
_visible |
| 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 | |
|---|---|
Timebox()
|
|
Timebox(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()
Returns the date format of the time only, Default: it uses SimpleDateFormat to format the date. |
java.lang.String |
getImage()
Deprecated. As of release 3.5.0 |
java.lang.String |
getInnerAttrs()
Generates the Client-Side-Action attributes to the interior tag. |
java.util.TimeZone |
getTimeZone()
Returns the time zone that this time 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. |
java.lang.String |
getZclass()
Returns the ZK Cascading Style class(es) for this component. |
boolean |
isButtonVisible()
Returns whether the button (on the right of the textbox) is visible. |
void |
setButtonVisible(boolean visible)
Sets whether the button (on the right of the textbox) is visible. |
void |
setImage(java.lang.String img)
Deprecated. As of release 3.5.0 |
void |
setTimeZone(java.util.TimeZone tzone)
Sets the time zone that this time 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.InputElement |
|---|
checkUserError, clearErrorMessage, clearErrorMessage, getAreaText, getCols, getConstraint, getErrorMessage, getMaxlength, getName, getOuterAttrs, 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, setValueDirectly, shallServerFormat, showCustomError, validate |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zul.impl.api.InputElement |
|---|
clearErrorMessage, clearErrorMessage, getAreaText, getCols, getErrorMessage, getMaxlength, getName, getRawText, getRawValue, getTabindex, getText, getType, isDisabled, isMultiline, isReadonly, isValid, select, setCols, setConstraint, setDisabled, setMaxlength, setName, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText |
| Methods inherited from interface org.zkoss.zul.impl.api.XulElement |
|---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent |
|---|
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from interface org.zkoss.zul.ext.Constrainted |
|---|
getConstraint, setConstraint |
| Constructor Detail |
|---|
public Timebox()
public Timebox(java.util.Date date)
throws WrongValueException
WrongValueException| Method Detail |
|---|
public java.util.Date getValue()
throws WrongValueException
getValue in interface TimeboxWrongValueException - if user entered a wrong value
public void setValue(java.util.Date value)
throws WrongValueException
setValue in interface TimeboxWrongValueException - if value is wrongpublic boolean isButtonVisible()
Default: true.
isButtonVisible in interface Timeboxpublic void setButtonVisible(boolean visible)
setButtonVisible in interface Timeboxpublic java.lang.String getImage()
Default: null. (since 3.5.0)
public void setImage(java.lang.String img)
img - the URI of the button image.public java.lang.String getInnerAttrs()
XulElement
getInnerAttrs in class InputElementpublic java.util.TimeZone getTimeZone()
The default time zone is determined by TimeZones.getCurrent().
getTimeZone in interface Timeboxpublic void setTimeZone(java.util.TimeZone tzone)
The default time zone is determined by TimeZones.getCurrent().
setTimeZone in interface Timebox
protected java.lang.Object coerceFromString(java.lang.String value)
throws 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 InputElementWrongValueExceptionprotected 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()
Default: it uses SimpleDateFormat to format the date.
public java.lang.String getZclass()
HtmlBasedComponentDefault: null (the default value depends on element).
HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style
of a component. In other words, the default style of a component
is associated with the default value of HtmlBasedComponent.getZclass().
Once it is changed, the default style won't be applied at all.
If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String)
instead.
getZclass in interface HtmlBasedComponentgetZclass in class HtmlBasedComponentHtmlBasedComponent.getSclass(),
HtmlBasedComponent.getRealSclass()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||