Interface IOrgitem
- All Superinterfaces:
IComponent<IOrgitem>,IComposite<IOrgitem,,IOrgitemComposite> IDisable<IOrgitem>,IHtmlBasedComponent<IOrgitem>,IXulElement<IOrgitem>
Orgitem component
Orgitem contains a node (Orgnode), and an optional Orgchildren. If the component doesn't contain an Orgchildren, it is a leaf node that doesn't accept any child items. If it contains an Orgchildren, it is a branch node that might contain other items.
For a branch node, an +/- button will appear at the bottom right of the node, such that user could open and close the item by clicking on the +/- button.
Support @Action
| Name | Action Type |
|---|---|
| onOpen | ActionData: OpenData
Denotes user has opened or closed a component. It is useful to implement load-on-demand by listening to the onOpen action, and creating components when the first time the component is opened. |
- Author:
- katherine
- See Also:
-
Orgitem
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIOrgitem.static classBuilds an updater of typeIOrgitemforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetImage()Returns the image of the firstIOrgnodeit contains.default StringgetLabel()Returns the label of theIOrgnodeit contains, or null if no such node.Returns the Orgchildren that this Orgitem owns, or null if doesn't have any child.Returns the Orgnode that this Orgitem owns, or null if doesn't have any child.default StringReturns the client widget class.default booleanReturns whether the component is to act as a container which can have sublevel items.default booleanReturns whether it is disabled, Default:false.default booleanisEmpty()Returns whether to contain any sublevel items or not.default booleanisLoaded()Return true whether all children of this tree item, if any, is loaded at clientdefault booleanisOpen()Returns whether this container is open.default booleanReturns true whether this Orgitem is rendered at client.default booleanReturns whether it is selectable.default booleanReturns whether this item is selected.static IOrgitemReturns the instance with the given label.static IOrgitemReturns the instance with the given id.static IOrgitemReturns the instance with the given image.default IOrgitemwithAllComponents(Iterable<? extends IOrgitemComposite> elements) Copy the current immutable object with elements that replace the content ofchildren.withDisabled(boolean disabled) Returns a copy ofthisimmutable component with the specifieddisabled.Returns a copy ofthisimmutable component with the specifiedimage.Returns a copy ofthisimmutable component with the specifiedlabel.withOpen(boolean open) Returns a copy ofthisimmutable component with the specifiedopen.withOrgchildren(IOrgchildren children) Returns a copy ofthisimmutable component with the specifiedtreechildren.withOrgnode(IOrgnode<IAnyGroup> orgnode) Returns a copy ofthisimmutable component with the specifiedorgnode.withSelectable(boolean selectable) Returns a copy ofthisimmutable component with the specifiedselectable.withSelected(boolean selected) Returns a copy ofthisimmutable component with the specifiedselected.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.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.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zkmax.layout.Orgitem"- Specified by:
getWidgetClassin interfaceIComponent<IOrgitem>- Returns:
-
getLabel
Returns the label of theIOrgnodeit contains, or null if no such node.- Returns:
- the label of the
IOrgnodeit contains
-
withLabel
Returns a copy ofthisimmutable component with the specifiedlabel.Sets the label of the
IOrgnodeit contains.If Orgnode is not created, we automatically create it.
Notice that this method will create an Orgnode automatically if it doesn't exist. Thus, you cannot attach a node to it again if set an image or a label.
- Parameters:
label- The label of theIOrgnodeit contains.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getImage
Returns the image of the firstIOrgnodeit contains.Default:
null -
withImage
Returns a copy ofthisimmutable component with the specifiedimage.Sets the image of the
IOrgnodeit contains.If Orgnode is not created, we automatically create it.
Notice that this method will create an Orgnode automatically if it doesn't exist. Thus, you cannot attach a node to it again if set an image or a label.
- Parameters:
image- The image of theIOrgnodeit contains.Default:
null.- Returns:
- A modified copy of the
thisobject
-
isSelectable
default boolean isSelectable()Returns whether it is selectable. Default:true. -
withSelectable
Returns a copy ofthisimmutable component with the specifiedselectable.Sets whether it is selectable.
When selectable equals true, user can select this item by clicking it.
- Parameters:
selectable- Whether it is selectable.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isDisabled
default boolean isDisabled()Returns whether it is disabled, Default:false.- Specified by:
isDisabledin interfaceIDisable<IOrgitem>
-
withDisabled
Returns a copy ofthisimmutable component with the specifieddisabled.Sets whether it is disabled.
When disabled equals true, user can't select this item.
- Specified by:
withDisabledin interfaceIDisable<IOrgitem>- Parameters:
disabled- Whether it is disabled.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isRendered
default boolean isRendered()Returns true whether this Orgitem is rendered at client. UnlikeisLoaded()which is used to check whether all children of this Orgitem are loaded.Default:
true -
isLoaded
default boolean isLoaded()Return true whether all children of this tree item, if any, is loaded at clientDefault:
false -
isOpen
default boolean isOpen()Returns whether this container is open.Default:
true. -
withOpen
Returns a copy ofthisimmutable component with the specifiedopen.Sets whether this container is open.
- Parameters:
open-falseto hide all sublevel items.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isSelected
default boolean isSelected()Returns whether this item is selected.Default:
false -
withSelected
Returns a copy ofthisimmutable component with the specifiedselected.Sets whether the component is selected.
- Parameters:
selected-trueto select this component.Default:
false.- Returns:
- A modified copy of the
thisobject
-
getOrgchildren
Returns the Orgchildren that this Orgitem owns, or null if doesn't have any child. -
withOrgchildren
Returns a copy ofthisimmutable component with the specifiedtreechildren.Sets the Orgchildren as a child to this component
- Parameters:
children- The Orgchildren child.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getOrgnode
Returns the Orgnode that this Orgitem owns, or null if doesn't have any child. -
withOrgnode
Returns a copy ofthisimmutable component with the specifiedorgnode.Sets the Orgnode as a child to this component
- Parameters:
orgnode- The Orgnode child.Default:
null.- Returns:
- A modified copy of the
thisobject
-
isContainer
@Lazy default boolean isContainer()Returns whether the component is to act as a container which can have sublevel items. -
isEmpty
@Lazy default boolean isEmpty()Returns whether to contain any sublevel items or not. -
withAllComponents
Description copied from interface:ICompositeCopy the current immutable object with elements that replace the content ofchildren. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Specified by:
withAllComponentsin interfaceIComposite<IOrgitem,IOrgitemComposite> - Parameters:
elements- An iterable of children elements to set- Returns:
- A modified copy of
thisobject
-
of
Returns the instance with the given label.- Parameters:
label- The label that the node holds.
-
ofImage
Returns the instance with the given image.- Parameters:
image- The image that the node holds.
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-