Package org.zkoss.stateless.sul

## Interface IPanel

- All Superinterfaces:
    `IAnyGroup<IPanel>`, `IComponent<IPanel>`, `IComposite<IPanel,​IChildrenOfPanel>`, `IHtmlBasedComponent<IPanel>`, `IXulElement<IPanel>`

      public interface IPanel
      extends IXulElement<IPanel>, IAnyGroup<IPanel>, IComposite<IPanel,​IChildrenOfPanel>

  Immutable `Panel` component

  Panel is a container that has specific functionality and structural components that make it the perfect building block for application-oriented user interfaces. The Panel contains bottom, top, and foot toolbars, along with separate header, footer and body sections. It also provides built-in collapsible, closable, maximizable, and minimizable behavior, along with a variety of pre-built tool buttons that can be wired up to provide other customized behavior. Panels can be easily embedded into any kind of `IComponent` component that is allowed to have children or layout component. Panels also provide specific features like float and move. Unlike `IWindow`, Panels can only be floated and moved inside its parent node, which is not using `zk.setVParent()` function at client side. In other words, if Panel's parent node is an relative position, the floated panel is only inside its parent, not the whole page.

  ### Support @Action

  Name | Action Type
  --- | ---
  onMove | ActionData: `MoveData` Denotes the position of the window is moved by a user.
  onOpen | ActionData: `OpenData` Denotes user has opened or closed a component.
  onMaximize | ActionData: `MaximizeData` Denotes user has maximize a component.
  onMinimize | ActionData: `MinimizeData` Denotes user has minimize a component.
  onClose | ActionData: `OpenData` Denotes the close button is pressed by a user, and the component shall detach itself.
  onSize | ActionData: `SizeData` Denotes the panel's size is updated by a user.
  onZIndex | ActionData: `ZIndexData` Denotes the panel's zindex is updated by a user.

  ### Support Application Library Properties

  - To set to use Browser's scrollbar or not, you have to specify `withNativeScrollbar(boolean)`.

    Or configure it from zk.xml by setting library properties. For example,

          <library-property/>
             <name>org.zkoss.zul.nativebar</name/>
             <value>false</value/>
         </library-property/>

  Author:
    katherine
  See Also:
    `Panel`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IPanel.Border` | Specifies the border to `IPanel` component.
    `static class` | `IPanel.Builder` | Builds instances of type `IPanel`.
    `static class` | `IPanel.Updater` | Builds an updater of type `IPanel` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IPanel` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default java.lang.String` | `getBorder()` | Returns the border.
    `IToolbar` | `getBottomToolbar()` | Returns the bottom toolbar of this component.
    `ICaption` | `getCaption()` | Returns the caption of this panel.
    `IToolbar` | `getFootToolbar()` | Returns the foot toolbar of this component.
    `default int` | `getMinheight()` | Returns the minimum height.
    `default int` | `getMinwidth()` | Returns the minimum width.
    `IPanelchildren<? extends IAnyGroup>` | `getPanelchildren()` | Returns the panelchildren of this component.
    `default java.lang.String` | `getTitle()` | Returns the title.
    `IToolbar` | `getTopToolbar()` | Returns the top toolbar of this component.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isClosable()` | Returns whether to show a close button on the title bar.
    `default boolean` | `isCollapsible()` | Returns whether to show a toggle button on the title bar.
    `default boolean` | `isFloatable()` | Returns whether to float the panel to display it inline where it is rendered.
    `default boolean` | `isMaximizable()` | Returns whether to display the maximizing button and allow the user to maximize the panel.
    `default boolean` | `isMaximized()` | Returns whether the panel is maximized.
    `default boolean` | `isMinimizable()` | Returns whether to display the minimizing button and allow the user to minimize the panel.
    `default boolean` | `isMinimized()` | Returns whether the panel is minimized.
    `default boolean` | `isMovable()` | Returns whether to move the panel to display it inline where it is rendered.
    `default boolean` | `isNativeScrollbar()` | Returns whether to use Browser's scrollbar or a floating scrollbar (if with `false`).
    `default boolean` | `isOpen()` | Returns whether this Panel is open.
    `default boolean` | `isSizable()` | Returns whether the panel is sizable.
    `static IPanel` | `of​(IPanelchildren panelchildren)` | Returns the instance with the given `IPanelchildren` child.
    `static IPanel` | `ofBorder​(IPanel.Border border)` | Returns the instance with the given `IPanel.Border` border.
    `static IPanel` | `ofBottomToolbar​(IToolbar bottomToolbar)` | Returns the instance with the given bottom `IToolbar` child.
    `static IPanel` | `ofCaption​(ICaption caption)` | Returns the instance with the given caption.
    `static IPanel` | `ofFootToolbar​(IToolbar footToolbar)` | Returns the instance with the given foot `IToolbar` child.
    `static IPanel` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static IPanel` | `ofSize​(java.lang.String width, java.lang.String height)` | Returns the instance with the given size, width and height
    `static IPanel` | `ofTitle​(java.lang.String title)` | Returns the instance with the given title.
    `static IPanel` | `ofTopToolbar​(IToolbar topToolbar)` | Returns the instance with the given top `IToolbar` child.
    `static IPanel` | `ofVflex​(java.lang.String vflex)` | Returns the instance with the given vflex.
    `default IPanel` | `withAllComponents​(java.lang.Iterable<? extends IChildrenOfPanel> elements)` | Copy the current immutable object with elements that replace the content of `children`.
    `IPanel` | `withBorder​(java.lang.String border)` | Returns a copy of `this` immutable component with the specified `border`.
    `default IPanel` | `withBorder​(IPanel.Border border)` | Returns a copy of `this` immutable component with the specified `border`.
    `IPanel` | `withBottomToolbar​(IToolbar bottomToolbar)` | Returns a copy of `this` immutable component with the specified `bottomToolbar`.
    `IPanel` | `withCaption​(ICaption caption)` | Returns a copy of `this` immutable component with the specified `caption`.
    `IPanel` | `withClosable​(boolean closable)` | Returns a copy of `this` immutable component with the specified `closable`.
    `IPanel` | `withCollapsible​(boolean collapsible)` | Returns a copy of `this` immutable component with the specified `collapsible`.
    `IPanel` | `withFloatable​(boolean floatable)` | Returns a copy of `this` immutable component with the specified `floatable`.
    `IPanel` | `withFootToolbar​(IToolbar footToolbar)` | Returns a copy of `this` immutable component with the specified `footToolbar`.
    `IPanel` | `withMaximizable​(boolean maximizable)` | Returns a copy of `this` immutable component with the specified `maximizable`.
    `IPanel` | `withMaximized​(boolean maximized)` | Returns a copy of `this` immutable component with the specified `maximized`.
    `IPanel` | `withMinheight​(int minheight)` | Returns a copy of `this` immutable component with the specified `minheight`.
    `IPanel` | `withMinimizable​(boolean minimizable)` | Returns a copy of `this` immutable component with the specified `minimizable`.
    `IPanel` | `withMinimized​(boolean minimized)` | Returns a copy of `this` immutable component with the specified `minimized`.
    `IPanel` | `withMinwidth​(int minwidth)` | Returns a copy of `this` immutable component with the specified `minwidth`.
    `IPanel` | `withMovable​(boolean movable)` | Returns a copy of `this` immutable component with the specified `movable`.
    `IPanel` | `withNativeScrollbar​(boolean nativeScrollbar)` | Returns a copy of `this` immutable component with the specified `nativeScrollbar`.
    `IPanel` | `withOpen​(boolean open)` | Returns a copy of `this` immutable component with the specified `open`.
    `IPanel` | `withPanelchildren​(IPanelchildren<? extends IAnyGroup> panelchildren)` | Returns a copy of `this` immutable component with the specified `panelchildren`.
    `IPanel` | `withSizable​(boolean sizable)` | Returns a copy of `this` immutable component with the specified `sizable`.
    `IPanel` | `withTitle​(java.lang.String title)` | Returns a copy of `this` immutable component with the specified `title`.
    `IPanel` | `withTopToolbar​(IToolbar topToolbar)` | Returns a copy of `this` immutable component with the specified `topToolbar`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IXulElement

      `getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip`

- - ### Field Detail

    - #### DEFAULT

          static final IPanel DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zul.wnd.Panel"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IPanel>`

    - #### getCaption

          @Nullable
          ICaption getCaption()

      Returns the caption of this panel.

      Default: `null`

    - #### withCaption

          IPanel withCaption​(@Nullable
                             ICaption caption)

      Returns a copy of `this` immutable component with the specified `caption`.

      Sets the caption child of this component.

      Parameters:
        `caption` - The caption child of the component.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getTopToolbar

          @Nullable
          IToolbar getTopToolbar()

      Returns the top toolbar of this component.

      Default: `null`

    - #### withTopToolbar

          IPanel withTopToolbar​(@Nullable
                                IToolbar topToolbar)

      Returns a copy of `this` immutable component with the specified `topToolbar`.

      Sets the top toolbar of this component.

      Parameters:
        `topToolbar` - The top toolbar of this component.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getBottomToolbar

          @Nullable
          IToolbar getBottomToolbar()

      Returns the bottom toolbar of this component.

      Default: `null`

    - #### withBottomToolbar

          IPanel withBottomToolbar​(@Nullable
                                   IToolbar bottomToolbar)

      Returns a copy of `this` immutable component with the specified `bottomToolbar`.

      Sets the bottom toolbar of this component.

      Parameters:
        `bottomToolbar` - The bottom toolbar of this component.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getFootToolbar

          @Nullable
          IToolbar getFootToolbar()

      Returns the foot toolbar of this component.

      Default: `null`

    - #### withFootToolbar

          IPanel withFootToolbar​(@Nullable
                                 IToolbar footToolbar)

      Returns a copy of `this` immutable component with the specified `footToolbar`.

      Sets the foot toolbar of this component.

      Parameters:
        `footToolbar` - The foot toolbar of this component.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getPanelchildren

          @Nullable
          IPanelchildren<? extends IAnyGroup> getPanelchildren()

      Returns the panelchildren of this component.

      Default: `null`

    - #### withPanelchildren

          IPanel withPanelchildren​(@Nullable
                                   IPanelchildren<? extends IAnyGroup> panelchildren)

      Returns a copy of `this` immutable component with the specified `panelchildren`.

      Sets the panelchildren of this component to contain more child components.

      Parameters:
        `panelchildren` - The panelchildren of this component.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### withAllComponents

          default IPanel withAllComponents​(java.lang.Iterable<? extends IChildrenOfPanel> elements)

      Description copied from interface: `IComposite`
      Copy the current immutable object with elements that replace the content of `children`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Specified by:
        `withAllComponents` in interface `IComposite<IPanel,​IChildrenOfPanel>`
      Parameters:
        `elements` - An iterable of children elements to set
      Returns:
        A modified copy of `this` object

    - #### getTitle

          default java.lang.String getTitle()

      Returns the title. Besides this attribute, you could use `ICaption` to define a more sophisticated caption (a.k.a., title).

      If a panel has a caption whose label (`ILabelElement.getLabel()`) is not empty, then this attribute is ignored.

      Default: `""` (empty).

    - #### withTitle

          IPanel withTitle​(java.lang.String title)

      Returns a copy of `this` immutable component with the specified `title`.

      Sets the title of this component.

      Parameters:
        `title` - The title of this component.

        Default: `""` (empty).

      Returns:
        A modified copy of the `this` object

    - #### isClosable

          default boolean isClosable()

      Returns whether to show a close button on the title bar.

      Default: `false`

    - #### withClosable

          IPanel withClosable​(boolean closable)

      Returns a copy of `this` immutable component with the specified `closable`.

      Sets whether to show a close button on the title bar.

      Parameters:
        `closable` - Whether to show a close button on the title bar.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isFloatable

          default boolean isFloatable()

      Returns whether to float the panel to display it inline where it is rendered.

      Default: `false`.

    - #### withFloatable

          IPanel withFloatable​(boolean floatable)

      Returns a copy of `this` immutable component with the specified `floatable`.

      Sets whether to float the panel to display it inline where it is rendered.

      Parameters:
        `floatable` - Whether to float the panel to display it inline where it is rendered.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isCollapsible

          default boolean isCollapsible()

      Returns whether to show a toggle button on the title bar.

      Default: `false`.

    - #### withCollapsible

          IPanel withCollapsible​(boolean collapsible)

      Returns a copy of `this` immutable component with the specified `collapsible`.

      Sets whether to show a toggle button on the title bar.

      Parameters:
        `collapsible` - Whether to show a toggle button on the title bar.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isMovable

          default boolean isMovable()

      Returns whether to move the panel to display it inline where it is rendered.

      Default: `false`.

    - #### withMovable

          IPanel withMovable​(boolean movable)

      Returns a copy of `this` immutable component with the specified `movable`.

      Sets whether to move the panel to display it inline where it is rendered.

      Parameters:
        `movable` - Whether to move the panel to display it inline where it is rendered.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isMaximizable

          default boolean isMaximizable()

      Returns whether to display the maximizing button and allow the user to maximize the panel.

      Default: `false`.

    - #### withMaximizable

          IPanel withMaximizable​(boolean maximizable)

      Returns a copy of `this` immutable component with the specified `maximizable`.

      Sets whether to display the maximizing button and allow the user to maximize the panel.

      Parameters:
        `maximizable` - Whether to display the maximizing button and allow the user to maximize the panel.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isMinimizable

          default boolean isMinimizable()

      Returns whether to display the minimizing button and allow the user to minimize the panel.

      Default: `false`.

    - #### withMinimizable

          IPanel withMinimizable​(boolean minimizable)

      Returns a copy of `this` immutable component with the specified `minimizable`.

      Sets whether to display the minimizing button and allow the user to minimize the panel.

      Parameters:
        `minimizable` - Whether to display the minimizing button and allow the user to minimize the panel.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isMaximized

          default boolean isMaximized()

      Returns whether the panel is maximized.

    - #### withMaximized

          IPanel withMaximized​(boolean maximized)

      Returns a copy of `this` immutable component with the specified `maximized`.

      Sets whether the panel is maximized, and then the size of the panel will depend on it to show an appropriate size. In other words, if true, the size of the panel will count on the size of its offset parent node whose position is absolute (by `isFloatable()`) or its parent node. Otherwise, its size will be original size. Note that the maximized effect will run at client's sizing phase not initial phase.

      Parameters:
        `maximized` - Whether the panel is maximized.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isMinimized

          default boolean isMinimized()

      Returns whether the panel is minimized.

      Default: `false`.

    - #### withMinimized

          IPanel withMinimized​(boolean minimized)

      Returns a copy of `this` immutable component with the specified `minimized`.

      Sets whether the panel is minimized.

      Parameters:
        `minimized` - Whether the panel is minimized.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isSizable

          default boolean isSizable()

      Returns whether the panel is sizable.

      Default: `false`

    - #### withSizable

          IPanel withSizable​(boolean sizable)

      Returns a copy of `this` immutable component with the specified `sizable`.

      Sets whether the panel is sizable.

      Parameters:
        `sizable` - Whether the panel is sizable.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### getMinheight

          default int getMinheight()

      Returns the minimum height.

      Default: `100`.

    - #### withMinheight

          IPanel withMinheight​(int minheight)

      Returns a copy of `this` immutable component with the specified `minheight`.

      Sets the minimum height in pixels allowed for this panel. If negative, `100` is assumed.

      Parameters:
        `minheight` - Whether the panel is sizable.

        Default: `100`.

      Returns:
        A modified copy of the `this` object

    - #### getMinwidth

          default int getMinwidth()

      Returns the minimum width.

      Default: `200`.

    - #### withMinwidth

          IPanel withMinwidth​(int minwidth)

      Returns a copy of `this` immutable component with the specified `minwidth`.

      Sets the minimum width in pixels allowed for this panel. If negative, `200` is assumed.

      Parameters:
        `minwidth` - Whether the panel is sizable.

        Default: `200`.

      Returns:
        A modified copy of the `this` object

    - #### isOpen

          default boolean isOpen()

      Returns whether this Panel is open.

      Default: `true`.

    - #### withOpen

          IPanel withOpen​(boolean open)

      Returns a copy of `this` immutable component with the specified `open`.

      Sets whether this Panel is open.

      Parameters:
        `open` - Whether this Panel is open.

        Default: `true`.

      Returns:
        A modified copy of the `this` object

    - #### getBorder

          default java.lang.String getBorder()

      Returns the border.

      Default: `"none"`.

    - #### withBorder

          IPanel withBorder​(java.lang.String border)

      Returns a copy of `this` immutable component with the specified `border`.

      Sets the border. Allowed values include `none` (default), and `normal`. For more information, please refer to ZK Component Reference: Panel.

      Parameters:
        `border` - the border. If null, `"0"` or `"false"`, `"none"` is assumed.
      Returns:
        A modified copy of the `this` object

    - #### withBorder

          default IPanel withBorder​(IPanel.Border border)

      Returns a copy of `this` immutable component with the specified `border`.

      Sets the border with the given `border`.

      Parameters:
        `border` - The border
      Returns:
        A modified copy of the `this` object

    - #### isNativeScrollbar

          default boolean isNativeScrollbar()

      Returns whether to use Browser's scrollbar or a floating scrollbar (if with `false`).

      Default: `true` to use Browser's scrollbar, if the `"org.zkoss.zul.nativebar"` library property is not set in zk.xml.

    - #### withNativeScrollbar

          IPanel withNativeScrollbar​(boolean nativeScrollbar)

      Returns a copy of `this` immutable component with the specified `nativeScrollbar`.

      Sets to use Browser's scrollbar or a floating scrollbar

      Parameters:
        `nativeScrollbar` - `true` to use Browser's scrollbar, or `false` to use a floating scrollbar.

        Default: `true`.

      Returns:
        A modified copy of the `this` object

    - #### of

          static IPanel of​(IPanelchildren panelchildren)

      Returns the instance with the given `IPanelchildren` child.
      Parameters:
        `panelchildren` - The panelchildren

    - #### ofCaption

          static IPanel ofCaption​(ICaption caption)

      Returns the instance with the given caption.
      Parameters:
        `caption` - The caption child

    - #### ofBorder

          static IPanel ofBorder​(IPanel.Border border)

      Returns the instance with the given `IPanel.Border` border.
      Parameters:
        `border` - The border of the component

    - #### ofTopToolbar

          static IPanel ofTopToolbar​(IToolbar topToolbar)

      Returns the instance with the given top `IToolbar` child.
      Parameters:
        `topToolbar` - The top toolbar

    - #### ofBottomToolbar

          static IPanel ofBottomToolbar​(IToolbar bottomToolbar)

      Returns the instance with the given bottom `IToolbar` child.
      Parameters:
        `bottomToolbar` - The bottom toolbar

    - #### ofFootToolbar

          static IPanel ofFootToolbar​(IToolbar footToolbar)

      Returns the instance with the given foot `IToolbar` child.
      Parameters:
        `footToolbar` - The foot toolbar

    - #### ofVflex

          static IPanel ofVflex​(java.lang.String vflex)

      Returns the instance with the given vflex.
      Parameters:
        `vflex` - The vertical flex hint.

    - #### ofTitle

          static IPanel ofTitle​(java.lang.String title)

      Returns the instance with the given title.
      Parameters:
        `title` - The title of the component.

    - #### ofSize

          static IPanel ofSize​(java.lang.String width,
                               java.lang.String height)

      Returns the instance with the given size, width and height
      Parameters:
        `width` - The width of the component
        `height` - The height of the component

    - #### ofId

          static IPanel ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component