Class Splitlayout

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.sys.ComponentCtrl

    public class Splitlayout
    extends org.zkoss.zul.impl.XulElement
    A layout container which is used to divide a component into two components. These two components inside Splitlayout, the splitlayouts, are placed either horizontally or vertically by setting the orientation, and users can easily resize these two viewports by dragging the splitter bar. It also supports hflex and vflex, indicating that users can divide the area into three or more spaces by putting the splitlayouts into the outer Splitlayout.

    Default getZclass(): z-splitlayout.

    Since:
    8.5.0
    Author:
    jameschu
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent

        org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
      • Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

        org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo
    • Field Summary

      • 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_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
    • Constructor Summary

      Constructors 
      Constructor Description
      Splitlayout()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void beforeChildAdded​(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component refChild)  
      java.lang.String getCollapse()
      Returns which side of the splitter is collapsed when its grippy is clicked.
      java.lang.String getHeights()
      Returns the heights.
      java.lang.String getMinHeights()
      Returns the minimum heights.
      java.lang.String getMinWidths()
      Returns the minimum widths.
      java.lang.String getOrient()
      Returns the orient.
      java.lang.String getWidths()
      Returns the widths.
      java.lang.String getZclass()
      The default zclass is "z-splitlayout"
      boolean isOpen()
      Returns whether it is open (i.e., not collapsed.
      boolean isResizable()
      Returns resizable of the splitter
      boolean isVertical()
      Returns whether it is a vertical splitlayout.
      protected void renderProperties​(org.zkoss.zk.ui.sys.ContentRenderer renderer)  
      void service​(org.zkoss.zk.au.AuRequest request, boolean everError)  
      void setCollapse​(java.lang.String collapse)
      Sets which side of the splitter is collapsed when its grippy is clicked.
      void setHeights​(java.lang.String heightsStr)
      Sets the heights, which is a list of numbers separated by comma to denote the width/height of two caves in splitlayout.
      void setMinHeights​(java.lang.String minHeightsStr)
      Sets the minimum heights, which is a list of numbers separated by comma to denote the minimum heights of two caves in splitlayout.
      void setMinWidths​(java.lang.String minWidthsStr)
      Sets the minimum widths, which is a list of numbers separated by comma to denote the minimum width of two caves in splitlayout.
      void setOpen​(boolean open)
      Opens or collapses the splitter.
      void setOrient​(java.lang.String orient)
      Sets the orient.
      void setResizable​(boolean resizable)
      Sets resizable of the splitter.
      void setWidths​(java.lang.String widthsStr)
      Sets the widths, which is a list of numbers separated by comma to denote the width/height of two caves in splitlayout.
      • Methods inherited from class org.zkoss.zul.impl.XulElement

        clone, 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, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, 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, setZIndexDirectly
      • Methods inherited from class org.zkoss.zk.ui.AbstractComponent

        addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, 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, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Splitlayout

        public Splitlayout()
    • Method Detail

      • setOrient

        public void setOrient​(java.lang.String orient)
                       throws org.zkoss.zk.ui.WrongValueException
        Sets the orient.
        Parameters:
        orient - either "horizontal" or "vertical".
        Throws:
        org.zkoss.zk.ui.WrongValueException
      • getOrient

        public java.lang.String getOrient()
        Returns the orient.

        Default: vertical

      • getCollapse

        public java.lang.String getCollapse()
        Returns which side of the splitter is collapsed when its grippy is clicked. If this attribute is not specified, the splitter will not cause a collapse. If it is collapsed, isOpen() returns false.

        Default: none.

        The returned value can be one of the following.

        none
        No collapsing occurs.
        before
        When the grippy is clicked, the element immediately before the splitter in the same parent is collapsed so that its width or height is 0.
        after
        When the grippy is clicked, the element immediately after the splitter in the same parent is collapsed so that its width or height is 0.

        Unlike XUL, you don't have to put a so-called grippy component as a child of the splitter.

      • setCollapse

        public void setCollapse​(java.lang.String collapse)
                         throws org.zkoss.zk.ui.WrongValueException
        Sets which side of the splitter is collapsed when its grippy is clicked. If this attribute is not specified, the splitter will not cause a collapse.
        Parameters:
        collapse - one of none, before and after. If null or empty is specified, none is assumed.
        Throws:
        org.zkoss.zk.ui.WrongValueException
        See Also:
        getCollapse()
      • isOpen

        public boolean isOpen()
        Returns whether it is open (i.e., not collapsed. Meaningful only if getCollapse() is not "none".
      • setOpen

        public void setOpen​(boolean open)
        Opens or collapses the splitter. Meaningful only if getCollapse() is not "none".
      • isResizable

        public boolean isResizable()
        Returns resizable of the splitter
      • setResizable

        public void setResizable​(boolean resizable)
        Sets resizable of the splitter.
      • getWidths

        public java.lang.String getWidths()
        Returns the widths.
      • setWidths

        public void setWidths​(java.lang.String widthsStr)
                       throws org.zkoss.zk.ui.WrongValueException
        Sets the widths, which is a list of numbers separated by comma to denote the width/height of two caves in splitlayout.

        For example, "100, 200" means the first cave shall occupy 100px width, the second cave 200px.

        Note: the splitters are ignored, i.e., they are not two children in the splitlayout.

        Another example, ",300" means the second caves shall occupy 300px width, and the first cave don't specify any width. Of course, the real widths depend on the interpretation of the browser.

        Throws:
        org.zkoss.zk.ui.WrongValueException
      • getHeights

        public java.lang.String getHeights()
        Returns the heights.
      • setHeights

        public void setHeights​(java.lang.String heightsStr)
                        throws org.zkoss.zk.ui.WrongValueException
        Sets the heights, which is a list of numbers separated by comma to denote the width/height of two caves in splitlayout.

        For example, "100 ,200" means the first cave shall occupy 100px height, the second cave 200px.

        Note: the splitters are ignored, i.e., they are not two children in the splitlayout.

        Another example, ",300" means the second caves shall occupy 300px height, and the first cave don't specify any height.

        Throws:
        org.zkoss.zk.ui.WrongValueException
      • getMinWidths

        public java.lang.String getMinWidths()
        Returns the minimum widths.
      • setMinWidths

        public void setMinWidths​(java.lang.String minWidthsStr)
                          throws org.zkoss.zk.ui.WrongValueException
        Sets the minimum widths, which is a list of numbers separated by comma to denote the minimum width of two caves in splitlayout.

        For example, "10%,20%" in "horizontal" splitlayout means that the first cave should not be smaller than 10% width and the second cave 20% when moving the splitter.

        Note: If the sum of minWidths larger than the width of splitlayout, the splitter would be fixed.

        Another example, ",30%" in "horizontal" splitlayout means the second caves should not be smaller than 30% height, and the first cave has no restrictions. Of course, the real width depend on the interpretation of the browser.

        Throws:
        org.zkoss.zk.ui.WrongValueException
      • getMinHeights

        public java.lang.String getMinHeights()
        Returns the minimum heights.
      • setMinHeights

        public void setMinHeights​(java.lang.String minHeightsStr)
                           throws org.zkoss.zk.ui.WrongValueException
        Sets the minimum heights, which is a list of numbers separated by comma to denote the minimum heights of two caves in splitlayout.

        For example, "10%,20%" in "vertical" splitlayout means that the first cave should not be smaller than 10% height and the second cave 20% when moving the splitter.

        Note: If the sum of minHeights larger than the height of splitlayout, the splitter would be fixed.

        Another example, ",30%" in "vertical" splitlayout means the second caves should not be smaller than 30% height, and the first cave has no restrictions. Of course, the real height depend on the interpretation of the browser.

        Throws:
        org.zkoss.zk.ui.WrongValueException
      • beforeChildAdded

        public void beforeChildAdded​(org.zkoss.zk.ui.Component child,
                                     org.zkoss.zk.ui.Component refChild)
        Specified by:
        beforeChildAdded in interface org.zkoss.zk.ui.sys.ComponentCtrl
        Overrides:
        beforeChildAdded in class org.zkoss.zk.ui.AbstractComponent
      • isVertical

        public boolean isVertical()
        Returns whether it is a vertical splitlayout.
      • renderProperties

        protected void renderProperties​(org.zkoss.zk.ui.sys.ContentRenderer renderer)
                                 throws java.io.IOException
        Overrides:
        renderProperties in class org.zkoss.zul.impl.XulElement
        Throws:
        java.io.IOException
      • service

        public void service​(org.zkoss.zk.au.AuRequest request,
                            boolean everError)
        Specified by:
        service in interface org.zkoss.zk.ui.sys.ComponentCtrl
        Overrides:
        service in class org.zkoss.zk.ui.HtmlBasedComponent
      • getZclass

        public java.lang.String getZclass()
        The default zclass is "z-splitlayout"
        Overrides:
        getZclass in class org.zkoss.zk.ui.HtmlBasedComponent