Interface ITimebox
- All Superinterfaces:
IAnyGroup<ITimebox>,IChildrenOfInputgroup<ITimebox>,IComponent<ITimebox>,IDateTimeFormatInputElement<ITimebox>,IFormatInputElement<ITimebox,,Date> IHtmlBasedComponent<ITimebox>,IInputElement<ITimebox,,Date> IReadonly<ITimebox>,IXulElement<ITimebox>
Timebox component.
An input box for holding a time (a java.util.Date Object), but only Hour & Minute are used.
Constraint
You could specify what value to accept for input controls by use of the
constraint attribute. It could be no empty.
Format
Use a to signify it is am or pm. The input string follows the formatting of
the SimpleDateFormat.
Below is an example of using a within the format.
ITimebox.ofCols(20).withFormat("a hh:mm:ss");
24 hours mode:
ITimebox.ofCols(8).withFormat("HH:mm:ss");
In addition to specifying the format explicitly, you could specify the styling.
There are four different types of styling: short, medium,
long and full (representing the styling of DateFormat).
For example, you could specify the styling rather than the real format as follows.
ITimebox.ofFormat("short");
ITimebox.ofFormat("long");
Locale
By default, the real format depends on the current locale (i.e., Locales.getCurrent().
However, you could specify the locale for an individual instance such as:
ITimebox.ofFormat("medium").withLocale("de_DE");
ITimebox.ofFormat("long").withLocale("fr");
- Author:
- katherine
- See Also:
-
Timebox
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeITimebox.static classBuilds an updater of typeITimeboxforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ITimeboxConstant for default attributes of this immutable component.static final intConstant for default cols for timebox auto sizing -
Method Summary
Modifier and TypeMethodDescriptiondefault intgetCols()Returns the cols which determines the visible width, in characters.default StringReturns the format of the timebox.default StringReturns the client widget class.default booleanReturns whether the button (on the right of the timebox) is visible.static ITimeboxReturn the instance of the given date.static ITimeboxReturn the instance of the given date.static ITimeboxofCols(int cols) Returns the instance with the given cols.static ITimeboxofConstraint(String constraint) Returns the instance with the given constraint.static ITimeboxReturns the instance with the given format.static ITimeboxReturns the instance with the given id.static ITimeboxReturns the instance with the given locale.static ITimeboxReturns the instance with the given locale.withButtonVisible(boolean buttonVisible) Returns a copy ofthisimmutable component with the specifiedbuttonVisible.Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IDateTimeFormatInputElement
getLocale, getTimeZone, getValueInLocalDate, getValueInLocalDateTime, getValueInLocalTime, getValueInZonedDateTime, withLocale, withLocale, withTimeZone, withTimeZone, withValue, withValueInLocalDate, withValueInLocalDateTime, withValueInLocalTime, withValueInZonedDateTimeMethods inherited from interface org.zkoss.stateless.sul.IFormatInputElement
withFormatMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IInputElement
getConstraint, getErrorboxIconSclass, getErrorboxSclass, getErrorMessage, getInputAttributes, getInstant, getMaxlength, getName, getPlaceholder, getValue, isDisabled, isInplace, withCols, withConstraint, withDisabled, withErrorboxIconSclass, withErrorboxSclass, withErrorMessage, withInplace, withInputAttributes, withInstant, withMaxlength, withName, withPlaceholderMethods inherited from interface org.zkoss.stateless.sul.IReadonly
isReadonly, withReadonlyMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component. -
DEFAULT_COLS_VALUE
static final int DEFAULT_COLS_VALUEConstant for default cols for timebox auto sizing- See Also:
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zul.db.Timebox"- Specified by:
getWidgetClassin interfaceIComponent<ITimebox>
-
isButtonVisible
default boolean isButtonVisible()Returns whether the button (on the right of the timebox) is visible.Default:
true. -
withButtonVisible
Returns a copy ofthisimmutable component with the specifiedbuttonVisible.Sets whether the button (on the right of the timebox) is visible.
- Parameters:
buttonVisible-falseto disable the button visibility.Default:
true.- Returns:
- A modified copy of the
thisobject
-
getCols
default int getCols()Returns the cols which determines the visible width, in characters.Default:
DEFAULT_COLS_VALUE(it means that if cols is not set by user, it will match the formatted value at the beginning)- Specified by:
getColsin interfaceIInputElement<ITimebox,Date>
-
getFormat
Returns the format of the timebox.Default:
""(empty string).- Specified by:
getFormatin interfaceIFormatInputElement<ITimebox,Date>
-
of
Return the instance of the given date.- Parameters:
date- The date to indicate the time for the timebox.
-
of
Return the instance of the given date.- Parameters:
date- The date to indicate the time for the timebox.
-
ofCols
Returns the instance with the given cols.- Parameters:
cols- The cols which determines the visible width
-
ofConstraint
Returns the instance with the given constraint.- Parameters:
constraint- The timebox constraint
-
ofFormat
Returns the instance with the given format.- Parameters:
format- The timebox format
-
ofLocale
Returns the instance with the given locale.- Parameters:
locale- The timebox locale
-
ofLocale
Returns the instance with the given locale.- Parameters:
locale- The timebox locale
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-