public class Organigram extends XulElement
TreeModel to render the data.
Event:
SelectEvent is sent when user changes the selection.
To retrieve what is selected in Organigram with a TreeSelectableModel,
you shall use TreeSelectableModel.isPathSelected(int[])
to check whether the current path is selected in TreeSelectableModel
rather than using getSelectedItem(). That is, you shall operate on
the item of the TreeSelectableModel rather than on the Orgitem
of the Organigram if you use the TreeSelectableModel and TreeModel.
To retrieve what are opened nodes in Organigram with a TreeOpenableModel,
you shall use TreeOpenableModel.isPathOpened(int[])
to check whether the current path is opened in TreeOpenableModel
rather than using Orgitem.isOpen(). That is, you shall operate on
the item of the TreeOpenableModel rather than on the Orgitem
of the Organigram if you use the TreeOpenableModel and TreeModel.
HtmlBasedComponent.ExtraCtrlAbstractComponent.Children_zclassAPPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEAFTER_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 and Description |
|---|
Organigram() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeChildAdded(Component child,
Component insertBefore)
Default: does nothing.
|
void |
clear()
Clears all child Orgitems (
Orgitem. |
java.lang.Object |
clone()
Clones the component.
|
int |
getItemCount()
Returns the number of child
Orgitem. |
<T> OrgitemRenderer<T> |
getItemRenderer()
Returns the renderer to render each item, or null if the default renderer is used.
|
java.util.Collection<Orgitem> |
getItems()
Returns a readonly list of all descending
Orgitem
(children's children and so on). |
<T> TreeModel<T> |
getModel()
Returns the tree model associated with this Organigram, or null
if this Organigram is not associated with any tree data model.
|
Orgchildren |
getOrgchildren()
Returns the Orgchildren that this Organigram owns.
|
Orgitem |
getSelectedItem()
Returns the selected item.
|
int |
getVisibleItemCount()
Returns the number of visible descendant
Orgitem. |
java.lang.String |
getZclass()
Returns the ZK Cascading Style class(es) for this component.
|
boolean |
insertBefore(Component newChild,
Component refChild)
Inserts a child before the reference child.
|
void |
onChildRemoved(Component child)
Default: handles special event listeners.
|
void |
onInitRender()
Handles a private event, onInitRender.
|
void |
onPageAttached(Page newpage,
Page oldpage)
Default: handles special event listeners.
|
void |
onPageDetached(Page page)
Default: handles special event listeners.
|
void |
renderItem(Orgitem item)
Renders the specified
Orgitem, if not loaded yet,
with getItemRenderer(). |
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing
tags and children.
|
void |
service(AuRequest request,
boolean everError)
Processes an AU request.
|
void |
sessionDidActivate(Page page)
Notification that the session, which owns this component,
has just been activated (a.k.a., deserialized).
|
void |
sessionWillPassivate(Page page)
Notification that the session, which owns this component,
is about to be passivated (a.k.a., serialized).
|
void |
setItemRenderer(OrgitemRenderer<?> renderer)
Sets the renderer which is used to render each item
if
getModel() is not null. |
void |
setItemRenderer(java.lang.String clsnm)
Sets the renderer by use of a class name.
|
void |
setModel(TreeModel<?> model)
Sets the tree model associated with this Organigram.
|
void |
setSelectedItem(Orgitem selectedItem)
Deselects previous selected item and selects the given item.
|
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesaddSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyaddAnnotation, 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, getChildren, 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, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerializeequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinvalidatePartialpublic Orgchildren getOrgchildren()
public java.util.Collection<Orgitem> getItems()
Orgitem
(children's children and so on).
Note: the performance of the size method of returned collection is no good.
Orgitempublic int getItemCount()
Orgitem.
The same as getItems().size().
Note: the performance of this method is no good.
Orgitem.public int getVisibleItemCount()
Orgitem.
Descendants include direct children, grand children and so on.Orgitem.public Orgitem getSelectedItem()
public void setSelectedItem(Orgitem selectedItem)
selectedItem - the item will be selectedpublic void clear()
Orgitem.
Note: after clear, getOrgchildren() won't be null, but it has no child.
public void beforeChildAdded(Component child, Component insertBefore)
AbstractComponentbeforeChildAdded in interface ComponentCtrlbeforeChildAdded in class AbstractComponentchild - the child to be added (never null).insertBefore - another child component that the new child
will be inserted before it. If null, the new child will be the
last child.ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)public boolean insertBefore(Component newChild, Component refChild)
ComponentYou could use Component.setParent(org.zkoss.zk.ui.Component) or Component.appendChild(org.zkoss.zk.ui.Component)
instead of this method, unless
you want to control where to put the child.
Note: Component.setParent(org.zkoss.zk.ui.Component) always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component),
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component),
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.setParent(org.zkoss.zk.ui.Component), if you want
to customize the behavior.
If you would like to monitor if a component is attached or detached
from a page, you could register a desktop listener implementing
UiLifeCycle.
insertBefore in interface ComponentinsertBefore in class AbstractComponentnewChild - the new child to be inserted.refChild - the child before which you want the new child
being inserted. If null, the new child is append to the end.public void onChildRemoved(Component child)
AbstractComponentonChildRemoved in interface ComponentCtrlonChildRemoved in class AbstractComponentComponentCtrl.onChildRemoved(org.zkoss.zk.ui.Component)public void onPageAttached(Page newpage, Page oldpage)
AbstractComponentonPageAttached in interface ComponentCtrlonPageAttached in class AbstractComponentnewpage - the new page (never null).oldpage - the previous page, if any, or null if it didn't
belong to any page.ComponentCtrl.onPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Page)public void onPageDetached(Page page)
AbstractComponentonPageDetached in interface ComponentCtrlonPageDetached in class AbstractComponentpage - the previous page (never null)ComponentCtrl.onPageDetached(org.zkoss.zk.ui.Page)public java.lang.Object clone()
Componentclone in interface Componentclone in class XulElementpublic void sessionWillPassivate(Page page)
ComponentCtrlNote: only root components are notified by this method.
sessionWillPassivate in interface ComponentCtrlsessionWillPassivate in class AbstractComponentpublic void sessionDidActivate(Page page)
ComponentCtrlNote: only root components are notified by this method.
sessionDidActivate in interface ComponentCtrlsessionDidActivate in class AbstractComponentpublic <T> TreeModel<T> getModel()
public void setModel(TreeModel<?> model)
model - the tree model to associate, or null to dissociate any previous model.UiException - if failed to initialize with the modelpublic void onInitRender()
public <T> OrgitemRenderer<T> getItemRenderer()
public void setItemRenderer(OrgitemRenderer<?> renderer)
getModel() is not null.
Note: changing a render will cause the Organigram to re-render.
renderer - the renderer, or null to use the default.public void setItemRenderer(java.lang.String clsnm)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.lang.reflect.InvocationTargetException
clsnm - the class name of rendererjava.lang.ClassNotFoundExceptionjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetExceptionpublic void renderItem(Orgitem item)
Orgitem, if not loaded yet,
with getItemRenderer().
It does nothing if getModel() returns null.
item - the item to be renderedpublic void service(AuRequest request, boolean everError)
HtmlBasedComponentDefault: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.
service in interface ComponentCtrlservice in class HtmlBasedComponenteverError - whether any error ever occurred before
processing this request.AbstractComponent.setAuService(org.zkoss.zk.au.AuService)protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponentrenderProperties in class XulElementjava.io.IOExceptionpublic java.lang.String getZclass()
HtmlBasedComponentAbstractComponent.getMold()).
Default: null (the default value depends on element).
HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style
of a component. In other words, the default style of a component
is associated with the default value of HtmlBasedComponent.getZclass().
Once it is changed, the default style won't be applied at all.
If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String)
instead.
getZclass in class HtmlBasedComponentHtmlBasedComponent.getSclass()Copyright © 2005-2024 Potix Corporation. All Rights Reserved.