org.zkoss.zul.api
Interface Timebox

All Superinterfaces:
java.lang.Cloneable, Component, Constrainted, HtmlBasedComponent, InputElement, Scope, java.io.Serializable, XulElement
All Known Implementing Classes:
Timebox

public interface Timebox
extends InputElement

An input box for holding a time (a java.util.Date Object , but only Hour & Minute are used.

Default HtmlBasedComponent.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.

  • 0-9 : set the time digit depend on the position on the inner text box.
  • up : increase time digit depend on the position on the inner text box.
  • down : decrease time digit depend on the position on the inner text box.
  • delete : clear the time to empty (null)

    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).

    Since:
    3.5.2
    Author:
    Dennis Chen

    Field Summary
     
    Fields inherited from interface org.zkoss.zk.ui.Component
    APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
     
    Method Summary
     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.
     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 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 interface org.zkoss.zul.impl.api.InputElement
    clearErrorMessage, clearErrorMessage, 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, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
     
    Methods inherited from interface org.zkoss.zk.ui.Component
    addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
     
    Methods inherited from interface org.zkoss.zk.ui.ext.Scope
    addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
     
    Methods inherited from interface org.zkoss.zul.ext.Constrainted
    getConstraint, setConstraint
     

    Method Detail

    getValue

    java.util.Date getValue()
                            throws WrongValueException
    Returns the value (in Date), might be null unless a constraint stops it. And, only Hour and Mintue field is effective.

    Throws:
    WrongValueException - if user entered a wrong value

    setValue

    void setValue(java.util.Date value)
                  throws WrongValueException
    Sets the value (in Date). If value is null, then an empty will be sent(render) to client. If else, only the Hour and Mintue field will be sent(render) to client.

    Throws:
    WrongValueException - if value is wrong

    isButtonVisible

    boolean isButtonVisible()
    Returns whether the button (on the right of the textbox) is visible.

    Default: true.


    setButtonVisible

    void setButtonVisible(boolean visible)
    Sets whether the button (on the right of the textbox) is visible.


    getTimeZone

    java.util.TimeZone getTimeZone()
    Returns the time zone that this time box belongs to, or null if the default time zone is used.

    The default time zone is determined by TimeZones.getCurrent().


    setTimeZone

    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.

    The default time zone is determined by TimeZones.getCurrent().



    Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo