Interface ISplitlayout<I extends IAnyGroup>

All Superinterfaces:
IAnyGroup<ISplitlayout<I>>, IChildable<ISplitlayout<I>,I>, IComponent<ISplitlayout<I>>, IHtmlBasedComponent<ISplitlayout<I>>, IXulElement<ISplitlayout<I>>

public interface ISplitlayout<I extends IAnyGroup> extends IXulElement<ISplitlayout<I>>, IChildable<ISplitlayout<I>,I>, IAnyGroup<ISplitlayout<I>>
Immutable Splitlayout component

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.

Support @Action

Name Action Type
onOpen ActionData: OpenData
When a splitter is collapsed or opened by a user, the onOpen action is sent to the application.
onDivisionSize ActionData: DivisionSizeData
Represents an event that indicates two inner size of splitlayout.
Author:
katherine
See Also:
  • Splitlayout
  • Field Details

    • DEFAULT

      static final ISplitlayout<IAnyGroup> DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zkmax.layout.Splitlayout"

      Specified by:
      getWidgetClass in interface IComponent<I extends IAnyGroup>
    • getWidths

      default String getWidths()
      Returns the widths.

      Default: "" (empty)

    • withWidths

      ISplitlayout<I> withWidths(String widths)
      Returns a copy of this immutable component with the specified widths.

      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.

      Parameters:
      widths - The widths

      Default: "" (empty).

      Returns:
      A modified copy of the this object
    • getHeights

      default String getHeights()
      Returns the heights.

      Default: "" (empty)

    • withHeights

      ISplitlayout<I> withHeights(String heights)
      Returns a copy of this immutable component with the specified heights.

      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.

      Parameters:
      heights - The heights

      Default: "" (empty).

      Returns:
      A modified copy of the this object
    • getMinWidths

      default String getMinWidths()
      Returns the minimum widths.

      Default: "" (empty).

    • withMinWidths

      ISplitlayout<I> withMinWidths(String minWidths)
      Returns a copy of this immutable component with the specified minWidths.

      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.

      Parameters:
      minWidths - The minimum widths

      Default: "" (empty).

      Returns:
      A modified copy of the this object
    • getMinHeights

      default String getMinHeights()
      Returns the minimum heights.

      Default: "" (empty).

    • withMinHeights

      ISplitlayout<I> withMinHeights(String minHeights)
      Returns a copy of this immutable component with the specified minHeights.

      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.

      Parameters:
      minHeights - The minimum widths

      Default: "" (empty).

      Returns:
      A modified copy of the this object
    • getOrient

      default String getOrient()
      Returns the orient.

      Default: vertical

    • withOrient

      ISplitlayout<I> withOrient(String orient)
      Returns a copy of this immutable component with the specified orient.

      Sets the orient of component

      Parameters:
      orient - Either "horizontal" or "vertical"

      Default: "vertical".

      Returns:
      A modified copy of the this object
    • withOrient

      default ISplitlayout<I> withOrient(ISplitlayout.Orient orient)
      Returns a copy of this immutable component with the specified orient.

      Sets the orient of component

      Parameters:
      orient - Either "horizontal" or "vertical"

      Default: "vertical".

      Returns:
      A modified copy of the this object
    • getCollapse

      default 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.
    • withCollapse

      ISplitlayout<I> withCollapse(String collapse)
      Returns a copy of this immutable component with the specified collapse.

      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.

      The valid values:

      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.
      Parameters:
      collapse - Valid values are "none", "before", and "after"

      Default: "none".

      Returns:
      A modified copy of the this object
    • withCollapse

      default ISplitlayout<I> withCollapse(ISplitlayout.Collapse collapse)
      Returns a copy of this immutable component with the specified collapse.

      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.

      The valid values:

      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.
      Parameters:
      collapse - Valid values are "none", "before", and "after"

      Default: "none".

      Returns:
      A modified copy of the this object
    • isOpen

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

      ISplitlayout<I> withOpen(boolean open)
      Returns a copy of this immutable component with the specified open.

      Opens or collapses the splitter.

      Parameters:
      open - Opens or collapses the splitter.

      Default: true.

      Returns:
      A modified copy of the this object
    • isResizable

      default boolean isResizable()
      Returns resizable of the splitter
    • withResizable

      ISplitlayout<I> withResizable(boolean resizable)
      Returns a copy of this immutable component with the specified resizable.

      Sets resizable of the splitter

      Parameters:
      resizable - Whether to enable resizable of the splitter

      Default: true.

      Returns:
      A modified copy of the this object
    • of

      static <I extends IAnyGroup> ISplitlayout<I> of(Iterable<? extends I> children)
      Returns the instance with the given any group children.
      Parameters:
      children - The children belong to any group
      See Also:
    • of

      static <I extends IAnyGroup> ISplitlayout<I> of(I... children)
      Returns the instance with the given any group children.
      Parameters:
      children - The children belong to any group
      See Also:
    • ofFlex

      static <I extends IAnyGroup> ISplitlayout<I> ofFlex(String hflex, String vflex)
      Returns the instance with the given vflex and hflex
      Parameters:
      hflex - The horizontal flex hint
      vflex - The vertical flex hint
    • ofId

      static <I extends IAnyGroup> ISplitlayout<I> ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component