Package org.zkoss.stateless.sul

## Interface IPaging

- All Superinterfaces:
    `IAnyGroup<IPaging>`, `IComponent<IPaging>`, `IDisable<IPaging>`, `IHtmlBasedComponent<IPaging>`, `IMeshComposite<IPaging>`, `IXulElement<IPaging>`

      public interface IPaging
      extends IXulElement<IPaging>, IDisable<IPaging>, IMeshComposite<IPaging>, IAnyGroup<IPaging>

  Immutable `Paging` component

  A paging component is used with another component to separate long content into multiple pages. If a component has long content to display, you could separate them into pages, and then use a paging component as a controller to allow the user decide which page to display.

  The `listbox`, `grid` and `tree` components support the `paging` intrinsically, so you don't need to specify a `paging` component explicitly. In other words, they will instantiate and manage a `paging` component automatically if the `paging` mold is specified. Of course, you could specify an external paging component, if you want to have different visual layout, or to control multiple `listboxes`, `grids` and/or `trees` with one single `paging` component.

  ### Support @Action

  Name | Action Type
  --- | ---
  onPaging | ActionData: `PagingData` Represents an action triggered by the user navigates a new page.

  ### Support Molds

  Name | Snapshot
  --- | ---
  `"default"` |
  `"os"` |

  For example, suppose you have 100 items and prefer to show 20 items at a time, then you can use the paging components as follows.

       @RichletMapping("")
       public IComponent index() {
           return IVlayout.of(IPaging.ofTotalSize(100));
       }

  Author:
    jumperchen
  See Also:
    `Paging`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IPaging.Builder` | Builds instances of type `IPaging`.
    `static class` | `IPaging.Updater` | Builds an updater of type `IPaging` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IPaging` | `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 int` | `getActivePage()` | Returns the active page (starting from 0).
    `default int` | `getPageCount()` | Returns the number of pages.
    `default int` | `getPageIncrement()` | Returns the number of page anchors shall appear at the client.
    `default int` | `getPageSize()` | Returns the number of items per page.
    `default int` | `getTotalSize()` | Returns the total number of items.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isAutohide()` | Returns whether to automatically hide the paging if there is only one page available.
    `default boolean` | `isDetailed()` | Returns whether to show the detailed info, such as `getTotalSize()`
    `static IPaging` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static IPaging` | `ofTotalSize​(int totalSize)` | Returns the instance with the given total size.
    `IPaging` | `withActivePage​(int activePage)` | Returns a copy of `this` immutable component with the specified `activePage`.
    `IPaging` | `withAutohide​(boolean autohide)` | Returns a copy of `this` immutable component with the specified `autohide`.
    `IPaging` | `withDetailed​(boolean detailed)` | Returns a copy of `this` immutable component with the specified `detailed`.
    `IPaging` | `withPageCount​(int pageCount)` | Returns a copy of `this` immutable component with the specified `pageCount`.
    `IPaging` | `withPageIncrement​(int pageIncrement)` | Returns a copy of `this` immutable component with the specified `pageIncrement`.
    `IPaging` | `withPageSize​(int pageSize)` | Returns a copy of `this` immutable component with the specified `pageSize`.
    `IPaging` | `withTotalSize​(int totalSize)` | Returns a copy of `this` immutable component with the specified `totalSize`.

    - ### 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.IDisable

      `isDisabled, withDisabled`

    - ### 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 IPaging DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zul.mess.Paging"`

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

    - #### getPageSize

          default int getPageSize()

      Returns the number of items per page.

      Default: `20`.

    - #### withPageSize

          IPaging withPageSize​(int pageSize)

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

      Sets the items to show in each page

      Parameters:
        `pageSize` - The number of items per page. (positive only)

        Default: `20`.

      Returns:
        A modified copy of the `this` object

    - #### getTotalSize

          default int getTotalSize()

      Returns the total number of items.

      Default: `0`

    - #### withTotalSize

          IPaging withTotalSize​(int totalSize)

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

      To specify the total size of the `paging` component

      Parameters:
        `totalSize` - The total size of the `paging` component. (non-negative only)

        Default: `0`

      Returns:
        A modified copy of the `this` object

    - #### getPageCount

          default int getPageCount()

      Returns the number of pages.

      Note: there is at least one page even no item at all.

      Default: `1`

    - #### withPageCount

          IPaging withPageCount​(int pageCount)

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

      Sets the number of pages

      Note: there is at least one page even no item at all.

      Parameters:
        `pageCount` - The number of pages.

        Default: `1`

      Returns:
        A modified copy of the `this` object

    - #### isDetailed

          default boolean isDetailed()

      Returns whether to show the detailed info, such as `getTotalSize()`

      Default: `false`

    - #### withDetailed

          IPaging withDetailed​(boolean detailed)

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

      Sets whether to show total size and index of items in current page

      Parameters:
        `detailed` - `true` if enables the detail information.

        Default: `false`

      Returns:
        A modified copy of the `this` object

    - #### isAutohide

          default boolean isAutohide()

      Returns whether to automatically hide the paging if there is only one page available.

      Default: `false`

    - #### withAutohide

          IPaging withAutohide​(boolean autohide)

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

      Sets whether to automatically hide the `paging` component at client if there is only one page available.

      Parameters:
        `autohide` - `true` if enables the auto-hide feature.

        Default: `false`

      Returns:
        A modified copy of the `this` object

    - #### getActivePage

          default int getActivePage()

      Returns the active page (starting from 0).

      Default: `0`

    - #### withActivePage

          IPaging withActivePage​(int activePage)

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

      Sets the active page (starting from 0)

      Note: In server side, the active page starts from `0`. But in browser UI, it starts from `1` for human to see.

      Parameters:
        `activePage` - The active page to display at client.

        Default: `0`

      Returns:
        A modified copy of the `this` object

    - #### getPageIncrement

          default int getPageIncrement()

      Returns the number of page anchors shall appear at the client.

      Default: `10`.

    - #### withPageIncrement

          IPaging withPageIncrement​(int pageIncrement)

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

      Sets the number of page list icon when the `mold` is `"os"`

      Parameters:
        `pageIncrement` - The number of page list icon when the `mold` is `"os"` (Non-positive only)

        Default: `10`.

      Returns:
        A modified copy of the `this` object

    - #### ofTotalSize

          static IPaging ofTotalSize​(int totalSize)

      Returns the instance with the given total size.
      Parameters:
        `totalSize` - The total size of this paging component.

    - #### ofId

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

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