Class Listbox

  • All Implemented Interfaces:
    Serializable, Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.sys.ComponentCtrl, org.zkoss.zul.ext.Paginated
    Direct Known Subclasses:
    WListbox

    public class Listbox
    extends org.zkoss.zul.Listbox
    implements org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
    Version:
    $Revision: 0.10 $
    Author:
    Ashley G Ramdass
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.zkoss.zul.Listbox

        org.zkoss.zul.Listbox.Children, org.zkoss.zul.Listbox.ExtraCtrl
      • Nested classes/interfaces inherited from class org.zkoss.zul.impl.MeshElement

        org.zkoss.zul.impl.MeshElement.InternalPaging
    • Field Summary

      • Fields inherited from class org.zkoss.zul.Listbox

        LOADING_MODEL, SYNCING_MODEL
      • Fields inherited from class org.zkoss.zul.impl.MeshElement

        CSS_FLEX_AUTO_DISABLED_COUNT
      • Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent

        _zclass
      • Fields inherited from interface org.zkoss.zk.ui.Component

        APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
      • Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

        AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addActionListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)
      alias for addEventListener(Events.ON_SELECT, listener), to ease porting of swing form
      void addDoubleClickListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)  
      void addItem​(KeyNamePair pp)
      shortcut for appendItem(pp.getName(), pp.getKey()), to ease porting of swing form
      void addItem​(ValueNamePair pp)
      shortcut for appendItem(pp.getName(), pp.getValue()), to ease porting of swing form
      void addOnDropListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)  
      protected void afterInsert​(org.zkoss.zk.ui.Component comp)  
      ListItem appendItem​(String label, Object value)  
      ListItem appendItem​(String label, String value)  
      ListItem getItemAtIndex​(int index)  
      ListHead getListHead()  
      String getOddRowSclass()  
      int[] getSelectedIndices()  
      ListItem getSelectedItem()  
      Object getValue()
      Get selected item for the list box based on the value of list item
      boolean insertBefore​(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild)  
      boolean isEnabled()  
      boolean isItemDraggable()  
      void onEvent​(org.zkoss.zk.ui.event.Event event)  
      void removeActionListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)
      alias for removeEventListener(Events.ON_SELECT, listener), to ease porting of swing form
      void removeAllItems()
      remove all items, to ease porting of swing form
      boolean removeChild​(org.zkoss.zk.ui.Component child)  
      void setEnabled​(boolean enabled)  
      void setItemDraggable​(boolean b)  
      void setOddRowSclass​(String scls)  
      void setSelectedIndices​(int[] selected)  
      void setSelectedKeyNamePair​(KeyNamePair kp)
      select selected item base on kp.getKey, to ease porting of swing form
      void setSelectedValueNamePair​(ValueNamePair vp)
      select selected item base on vp.getValue, to ease porting of swing form
      void setValue​(Object value)
      Set selected item for the list box based on the value of list item set selected to none if no item found matching the value given or value is null
      String toString()  
      • Methods inherited from class org.zkoss.zul.Listbox

        addItemToSelection, beforeChildAdded, beforeRemove, clearSelection, clone, getChildren, getEmptyMessage, getExtraCtrl, getFrozen, getGroupCount, getGroups, getGroupsModel, getHeads, getIndexOfItem, getInnerWidth, getItemCount, getItemRenderer, getItems, getListfoot, getListhead, getListModel, getMaxlength, getModel, getName, getNonselectableTags, getPaginal, getPagingChild, getPreloadSize, getRows, getSelectedCount, getSelectedIndex, getSelectedItems, getSeltype, getVisibleItemCount, getZclass, hasGroup, isAutohidePaging, isCheckmark, isDisabled, isFixedLayout, isMultiple, isSelectOnHighlightDisabled, isVflex, onAfterRender, onInitRender, onPageAttached, onPageDetached, onPagingInitRender, pgi, removeItemAt, removeItemFromSelection, renderAll, renderItem, renderItems, renderProperties, scrollToIndex, selectAll, selectItem, service, sessionDidActivate, sessionWillPassivate, setActivePage, setActivePage, setCheckmark, setDisabled, setEmptyMessage, setFixedLayout, setHeight, setInnerWidth, setItemRenderer, setItemRenderer, setMaxlength, setModel, setModel, setMold, setMultiple, setName, setNonselectableTags, setPageSize, setPaginal, setPreloadSize, setRows, setSelectedIndex, setSelectedItem, setSelectedItems, setSeltype, setVflex, setVflex, shallUpdateScrollPos, toggleItemSelection
      • Methods inherited from class org.zkoss.zul.impl.MeshElement

        checkBeforeSetRows, evalCSSFlex, getActivePage, getPageCount, getPageSize, getPagingPosition, getSpan, isAutopaging, isPagingDisabled, isSizedByContent, isSpan, setAutopaging, setPagingDisabled, setPagingPosition, setSizedByContent, setSpan, setSpan
      • Methods inherited from class org.zkoss.zul.impl.XulElement

        getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
      • Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent

        addSclass, focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
      • Methods inherited from class org.zkoss.zk.ui.AbstractComponent

        addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, invalidate, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
      • Methods inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

        invalidatePartial
    • Constructor Detail

      • Listbox

        public Listbox()
    • Method Detail

      • setEnabled

        public void setEnabled​(boolean enabled)
      • isEnabled

        public boolean isEnabled()
      • appendItem

        public ListItem appendItem​(String label,
                                   String value)
        Overrides:
        appendItem in class org.zkoss.zul.Listbox
      • getItemAtIndex

        public ListItem getItemAtIndex​(int index)
        Overrides:
        getItemAtIndex in class org.zkoss.zul.Listbox
      • getSelectedItem

        public ListItem getSelectedItem()
        Overrides:
        getSelectedItem in class org.zkoss.zul.Listbox
      • setValue

        public void setValue​(Object value)
        Set selected item for the list box based on the value of list item set selected to none if no item found matching the value given or value is null
        Parameters:
        value - Value of ListItem to set as selected
      • getListHead

        public ListHead getListHead()
      • getSelectedIndices

        public int[] getSelectedIndices()
      • setSelectedIndices

        public void setSelectedIndices​(int[] selected)
      • addOnDropListener

        public void addOnDropListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)
      • addDoubleClickListener

        public void addDoubleClickListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)
      • insertBefore

        public boolean insertBefore​(org.zkoss.zk.ui.Component newChild,
                                    org.zkoss.zk.ui.Component refChild)
        Specified by:
        insertBefore in interface org.zkoss.zk.ui.Component
        Overrides:
        insertBefore in class org.zkoss.zul.Listbox
      • isItemDraggable

        public boolean isItemDraggable()
      • setItemDraggable

        public void setItemDraggable​(boolean b)
      • onEvent

        public void onEvent​(org.zkoss.zk.ui.event.Event event)
                     throws Exception
        Specified by:
        onEvent in interface org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
        Throws:
        Exception
      • addItem

        public void addItem​(KeyNamePair pp)
        shortcut for appendItem(pp.getName(), pp.getKey()), to ease porting of swing form
        Parameters:
        pp -
      • removeAllItems

        public void removeAllItems()
        remove all items, to ease porting of swing form
      • removeActionListener

        public void removeActionListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)
        alias for removeEventListener(Events.ON_SELECT, listener), to ease porting of swing form
        Parameters:
        listener -
      • addActionListener

        public void addActionListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)
        alias for addEventListener(Events.ON_SELECT, listener), to ease porting of swing form
        Parameters:
        listener -
      • addItem

        public void addItem​(ValueNamePair pp)
        shortcut for appendItem(pp.getName(), pp.getValue()), to ease porting of swing form
        Parameters:
        pp -
      • setSelectedValueNamePair

        public void setSelectedValueNamePair​(ValueNamePair vp)
        select selected item base on vp.getValue, to ease porting of swing form
        Parameters:
        vp -
      • setSelectedKeyNamePair

        public void setSelectedKeyNamePair​(KeyNamePair kp)
        select selected item base on kp.getKey, to ease porting of swing form
        Parameters:
        kp -
      • afterInsert

        protected void afterInsert​(org.zkoss.zk.ui.Component comp)
        Overrides:
        afterInsert in class org.zkoss.zul.Listbox
      • removeChild

        public boolean removeChild​(org.zkoss.zk.ui.Component child)
        Specified by:
        removeChild in interface org.zkoss.zk.ui.Component
        Overrides:
        removeChild in class org.zkoss.zul.Listbox
      • getOddRowSclass

        public String getOddRowSclass()
        Overrides:
        getOddRowSclass in class org.zkoss.zul.Listbox
      • setOddRowSclass

        public void setOddRowSclass​(String scls)
        Overrides:
        setOddRowSclass in class org.zkoss.zul.Listbox
      • toString

        public String toString()
        Overrides:
        toString in class org.zkoss.zk.ui.AbstractComponent
      • getValue

        public Object getValue()
        Get selected item for the list box based on the value of list item
        Returns:
        Value of selected ListItem