Class Splitlayout

All Implemented Interfaces:
Serializable, Cloneable, Component, Scope, ComponentCtrl

public class Splitlayout extends 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:
  • Constructor Details

    • Splitlayout

      public Splitlayout()
  • Method Details

    • setOrient

      public void setOrient(String orient) throws WrongValueException
      Sets the orient.
      Parameters:
      orient - either "horizontal" or "vertical".
      Throws:
      WrongValueException
    • getOrient

      public String getOrient()
      Returns the orient.

      Default: vertical

    • getCollapse

      public 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(String collapse) throws 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:
      WrongValueException
      See Also:
    • 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 String getWidths()
      Returns the widths.
    • setWidths

      public void setWidths(String widthsStr) throws 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:
      WrongValueException
    • getHeights

      public String getHeights()
      Returns the heights.
    • setHeights

      public void setHeights(String heightsStr) throws 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:
      WrongValueException
    • getMinWidths

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

      public void setMinWidths(String minWidthsStr) throws 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:
      WrongValueException
    • getMinHeights

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

      public void setMinHeights(String minHeightsStr) throws 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:
      WrongValueException
    • beforeChildAdded

      public void beforeChildAdded(Component child, Component refChild)
      Description copied from class: AbstractComponent
      Default: does nothing.
      Specified by:
      beforeChildAdded in interface ComponentCtrl
      Overrides:
      beforeChildAdded in class AbstractComponent
      Parameters:
      child - the child to be added (never null).
      refChild - another child component that the new child will be inserted before it. If null, the new child will be the last child.
      See Also:
    • isVertical

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

      protected void renderProperties(ContentRenderer renderer) throws IOException
      Description copied from class: HtmlBasedComponent
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
      renderProperties in class XulElement
      Throws:
      IOException
    • service

      public void service(AuRequest request, boolean everError)
      Description copied from class: HtmlBasedComponent
      Processes an AU request.

      Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.

      Specified by:
      service in interface ComponentCtrl
      Overrides:
      service in class HtmlBasedComponent
      everError - whether any error ever occurred before processing this request.
      See Also:
    • getZclass

      public String getZclass()
      The default zclass is "z-splitlayout"
      Overrides:
      getZclass in class HtmlBasedComponent
      See Also: