Interface IOrgitem
-
- All Superinterfaces:
IComponent<IOrgitem>,IComposite<IOrgitem,IOrgitemComposite>,IDisable<IOrgitem>,IHtmlBasedComponent<IOrgitem>,IXulElement<IOrgitem>
public interface IOrgitem extends IXulElement<IOrgitem>, IDisable<IOrgitem>, IComposite<IOrgitem,IOrgitemComposite>
ImmutableOrgitemcomponentOrgitem 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 Classes Modifier and Type Interface Description static classIOrgitem.BuilderBuilds instances of typeIOrgitem.static classIOrgitem.UpdaterBuilds an updater of typeIOrgitemforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.StringgetImage()Returns the image of the firstIOrgnodeit contains.default java.lang.StringgetLabel()Returns the label of theIOrgnodeit contains, or null if no such node.IOrgchildrengetOrgchildren()Returns the Orgchildren that this Orgitem owns, or null if doesn't have any child.IOrgnode<IAnyGroup>getOrgnode()Returns the Orgnode that this Orgitem owns, or null if doesn't have any child.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisContainer()Returns whether the component is to act as a container which can have sublevel items.default booleanisDisabled()Returns 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 booleanisRendered()Returns true whether this Orgitem is rendered at client.default booleanisSelectable()Returns whether it is selectable.default booleanisSelected()Returns whether this item is selected.static IOrgitemof(java.lang.String label)Returns the instance with the given label.static IOrgitemofId(java.lang.String id)Returns the instance with the given id.static IOrgitemofImage(java.lang.String image)Returns the instance with the given image.default IOrgitemwithAllComponents(java.lang.Iterable<? extends IOrgitemComposite> elements)Copy the current immutable object with elements that replace the content ofchildren.IOrgitemwithDisabled(boolean disabled)Returns a copy ofthisimmutable component with the specifieddisabled.IOrgitemwithImage(java.lang.String image)Returns a copy ofthisimmutable component with the specifiedimage.IOrgitemwithLabel(java.lang.String label)Returns a copy ofthisimmutable component with the specifiedlabel.IOrgitemwithOpen(boolean open)Returns a copy ofthisimmutable component with the specifiedopen.IOrgitemwithOrgchildren(IOrgchildren children)Returns a copy ofthisimmutable component with the specifiedtreechildren.IOrgitemwithOrgnode(IOrgnode<IAnyGroup> orgnode)Returns a copy ofthisimmutable component with the specifiedorgnode.IOrgitemwithSelectable(boolean selectable)Returns a copy ofthisimmutable component with the specifiedselectable.IOrgitemwithSelected(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, withWidgetOverrides
-
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.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final IOrgitem DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zkmax.layout.Orgitem"- Specified by:
getWidgetClassin interfaceIComponent<IOrgitem>- Returns:
-
getLabel
@Nullable default java.lang.String getLabel()
Returns the label of theIOrgnodeit contains, or null if no such node.- Returns:
- the label of the
IOrgnodeit contains
-
withLabel
IOrgitem withLabel(@Nullable java.lang.String label)
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
@Nullable default java.lang.String getImage()
Returns the image of the firstIOrgnodeit contains.Default:
null
-
withImage
IOrgitem withImage(@Nullable java.lang.String image)
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
IOrgitem withSelectable(boolean selectable)
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
IOrgitem withDisabled(boolean disabled)
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
IOrgitem withOpen(boolean open)
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
IOrgitem withSelected(boolean selected)
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
@Nullable IOrgchildren getOrgchildren()
Returns the Orgchildren that this Orgitem owns, or null if doesn't have any child.
-
withOrgchildren
IOrgitem withOrgchildren(@Nullable IOrgchildren children)
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
@Nullable IOrgnode<IAnyGroup> getOrgnode()
Returns the Orgnode that this Orgitem owns, or null if doesn't have any child.
-
withOrgnode
IOrgitem withOrgnode(@Nullable IOrgnode<IAnyGroup> orgnode)
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
default IOrgitem withAllComponents(java.lang.Iterable<? extends IOrgitemComposite> elements)
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
static IOrgitem of(java.lang.String label)
Returns the instance with the given label.- Parameters:
label- The label that the node holds.
-
ofImage
static IOrgitem ofImage(java.lang.String image)
Returns the instance with the given image.- Parameters:
image- The image that the node holds.
-
ofId
static IOrgitem ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-
-