Interface ITimebox
-
- All Superinterfaces:
IAnyGroup<ITimebox>,IChildrenOfInputgroup<ITimebox>,IComponent<ITimebox>,IDateTimeFormatInputElement<ITimebox>,IFormatInputElement<ITimebox,java.util.Date>,IHtmlBasedComponent<ITimebox>,IInputElement<ITimebox,java.util.Date>,IReadonly<ITimebox>,IXulElement<ITimebox>
public interface ITimebox extends IDateTimeFormatInputElement<ITimebox>, IAnyGroup<ITimebox>
ImmutableTimeboxcomponent.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
constraintattribute. It could beno 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,longandfull(representing the styling ofDateFormat).
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 Classes Modifier and Type Interface Description static classITimebox.BuilderBuilds instances of typeITimebox.static classITimebox.UpdaterBuilds an updater of typeITimeboxforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Field Summary
Fields Modifier and Type Field Description static ITimeboxDEFAULTConstant for default attributes of this immutable component.static intDEFAULT_COLS_VALUEConstant for default cols for timebox auto sizing
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intgetCols()Returns the cols which determines the visible width, in characters.default java.lang.StringgetFormat()Returns the format of the timebox.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisButtonVisible()Returns whether the button (on the right of the timebox) is visible.static ITimeboxof(java.time.temporal.Temporal date)Return the instance of the given date.static ITimeboxof(java.util.Date date)Return the instance of the given date.static ITimeboxofCols(int cols)Returns the instance with the given cols.static ITimeboxofConstraint(java.lang.String constraint)Returns the instance with the given constraint.static ITimeboxofFormat(java.lang.String format)Returns the instance with the given format.static ITimeboxofId(java.lang.String id)Returns the instance with the given id.static ITimeboxofLocale(java.lang.String locale)Returns the instance with the given locale.static ITimeboxofLocale(java.util.Locale locale)Returns the instance with the given locale.ITimeboxwithButtonVisible(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, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IDateTimeFormatInputElement
getLocale, getTimeZone, getValueInLocalDate, getValueInLocalDateTime, getValueInLocalTime, getValueInZonedDateTime, withLocale, withLocale, withTimeZone, withTimeZone, withValue, withValueInLocalDate, withValueInLocalDateTime, withValueInLocalTime, withValueInZonedDateTime
-
Methods inherited from interface org.zkoss.stateless.sul.IFormatInputElement
withFormat
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods 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, withPlaceholder
-
Methods inherited from interface org.zkoss.stateless.sul.IReadonly
isReadonly, withReadonly
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final ITimebox DEFAULT
Constant for default attributes of this immutable component.
-
DEFAULT_COLS_VALUE
static final int DEFAULT_COLS_VALUE
Constant for default cols for timebox auto sizing- See Also:
- Constant Field Values
-
-
Method Detail
-
getWidgetClass
default java.lang.String 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
ITimebox withButtonVisible(boolean buttonVisible)
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,java.util.Date>
-
getFormat
default java.lang.String getFormat()
Returns the format of the timebox.Default:
""(empty string).- Specified by:
getFormatin interfaceIFormatInputElement<ITimebox,java.util.Date>
-
of
static ITimebox of(java.util.Date date)
Return the instance of the given date.- Parameters:
date- The date to indicate the time for the timebox.
-
of
static ITimebox of(java.time.temporal.Temporal date)
Return the instance of the given date.- Parameters:
date- The date to indicate the time for the timebox.
-
ofCols
static ITimebox ofCols(int cols)
Returns the instance with the given cols.- Parameters:
cols- The cols which determines the visible width
-
ofConstraint
static ITimebox ofConstraint(java.lang.String constraint)
Returns the instance with the given constraint.- Parameters:
constraint- The timebox constraint
-
ofFormat
static ITimebox ofFormat(java.lang.String format)
Returns the instance with the given format.- Parameters:
format- The timebox format
-
ofLocale
static ITimebox ofLocale(java.lang.String locale)
Returns the instance with the given locale.- Parameters:
locale- The timebox locale
-
ofLocale
static ITimebox ofLocale(java.util.Locale locale)
Returns the instance with the given locale.- Parameters:
locale- The timebox locale
-
ofId
static ITimebox ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-
-