Package org.zkoss.zul

Class Splitter

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Component, Scope, ComponentCtrl

    public class Splitter
    extends XulElement
    An element which should appear before or after an element inside a box (Box, Vbox and Hbox).

    When the splitter is dragged, the sibling elements of the splitter are resized. If getCollapse() is true, a grippy is placed inside the splitter, and one sibling element of the splitter is collapsed when the grippy is clicked.

    Events: onOpen

    Default getZclass(): z-splitter.

    Author:
    tomyeh
    See Also:
    Serialized Form
    • Constructor Detail

      • Splitter

        public Splitter()
    • Method Detail

      • isVertical

        public boolean isVertical()
        Returns if the orientation of this splitter is vertical.
        Since:
        5.0.0
      • isHorizontal

        public boolean isHorizontal()
        Returns if the orientation of this splitter is horizontal.
        Since:
        5.0.0
      • getOrient

        public java.lang.String getOrient()
        Returns the orientation of the splitter. It is the same as the parent's orientation (Box.getOrient().
      • 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 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:
        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".