Package org.adempiere.webui.component
Class Listbox
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.impl.MeshElement
org.zkoss.zul.Listbox
org.adempiere.webui.component.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>
Extend
Listbox
- Version:
- $Revision: 0.10 $
- Author:
- Ashley G Ramdass
- See Also:
-
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
-
Constructor Summary
ConstructorDescriptionListbox()
Default ConstructorListbox
(KeyNamePair[] pairs) Create Listbox with items from pairs -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 formvoid
addDoubleClickListener
(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener) Add listener for DOUBLE_CLICK eventvoid
addItem
(KeyNamePair pp) shortcut for appendItem(pp.getName(), pp.getKey()), to ease porting of swing formvoid
addItem
(ValueNamePair pp) shortcut for appendItem(pp.getName(), pp.getValue()), to ease porting of swing formvoid
addOnDropListener
(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener) Add listener for ON_DROP eventprotected void
afterInsert
(org.zkoss.zk.ui.Component comp) appendItem
(String label, Object value) Add and return newListItem
appendItem
(String label, String value) Add and return newListItem
getItemAtIndex
(int index) int[]
getValue()
Get selected item for the list box based on the value of list itemboolean
insertBefore
(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild) boolean
boolean
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 formvoid
remove all items, to ease porting of swing formboolean
removeChild
(org.zkoss.zk.ui.Component child) void
setEnabled
(boolean enabled) Set enable/disable listboxvoid
setItemDraggable
(boolean b) void
setOddRowSclass
(String scls) void
setSelectedIndices
(int[] selected) Set selected indicesvoid
select selected item base on kp.getKey, to ease porting of swing formvoid
select selected item base on vp.getValue, to ease porting of swing formvoid
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.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 class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
invalidatePartial
-
Constructor Details
-
Listbox
public Listbox()Default Constructor -
Listbox
Create Listbox with items from pairs- Parameters:
pairs
- KeyNamePair[]
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) Set enable/disable listbox- Parameters:
enabled
-
-
isEnabled
public boolean isEnabled()- Returns:
- true if enable, false otherwise
-
appendItem
Add and return newListItem
- Parameters:
label
-value
-- Returns:
- ListItem
-
appendItem
Add and return newListItem
- Overrides:
appendItem
in classorg.zkoss.zul.Listbox
- Parameters:
label
-value
-
-
getItemAtIndex
- Overrides:
getItemAtIndex
in classorg.zkoss.zul.Listbox
- Parameters:
index
-- Returns:
- ListItem at index
-
getSelectedItem
- Overrides:
getSelectedItem
in classorg.zkoss.zul.Listbox
- Returns:
- Current selected ListItem
-
setValue
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
- Returns:
- ListHead
-
getSelectedIndices
public int[] getSelectedIndices()- Returns:
- int[] selected indices
-
setSelectedIndices
public void setSelectedIndices(int[] selected) Set selected indices- Parameters:
selected
- int[] selected indices
-
addOnDropListener
public void addOnDropListener(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener) Add listener for ON_DROP event- Parameters:
listener
-
-
addDoubleClickListener
public void addDoubleClickListener(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener) Add listener for DOUBLE_CLICK event- Parameters:
listener
-
-
insertBefore
public boolean insertBefore(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild) - Specified by:
insertBefore
in interfaceorg.zkoss.zk.ui.Component
- Overrides:
insertBefore
in classorg.zkoss.zul.Listbox
-
isItemDraggable
public boolean isItemDraggable()- Returns:
- true if ListItem should be draggable
-
setItemDraggable
public void setItemDraggable(boolean b) - Parameters:
b
- true to enable draggable support for ListItem
-
onEvent
- Specified by:
onEvent
in interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
- Throws:
Exception
-
addItem
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
shortcut for appendItem(pp.getName(), pp.getValue()), to ease porting of swing form- Parameters:
pp
-
-
setSelectedValueNamePair
select selected item base on vp.getValue, to ease porting of swing form- Parameters:
vp
- ValueNamePair
-
setSelectedKeyNamePair
select selected item base on kp.getKey, to ease porting of swing form- Parameters:
kp
- KeyNamePair
-
afterInsert
protected void afterInsert(org.zkoss.zk.ui.Component comp) - Overrides:
afterInsert
in classorg.zkoss.zul.Listbox
-
removeChild
public boolean removeChild(org.zkoss.zk.ui.Component child) - Specified by:
removeChild
in interfaceorg.zkoss.zk.ui.Component
- Overrides:
removeChild
in classorg.zkoss.zul.Listbox
-
getOddRowSclass
- Overrides:
getOddRowSclass
in classorg.zkoss.zul.Listbox
-
setOddRowSclass
- Overrides:
setOddRowSclass
in classorg.zkoss.zul.Listbox
-
toString
- Overrides:
toString
in classorg.zkoss.zk.ui.AbstractComponent
-
getValue
Get selected item for the list box based on the value of list item- Returns:
- Value of selected ListItem
-