Package org.zkoss.zul

## Class AbstractTreeModel<E>

- java.lang.Object
- - org.zkoss.zul.AbstractTreeModel<E>

- All Implemented Interfaces:
    `java.io.Serializable`, `Openable<E>`, `Pageable`, `Selectable<E>`, `TreeOpenableModel`, `TreeSelectableModel`, `PageableModel`, `TreeModel<E>`
  Direct Known Subclasses:
    `DefaultTreeModel`

      public abstract class AbstractTreeModel<E>
      extends java.lang.Object
      implements TreeModel<E>, TreeSelectableModel, TreeOpenableModel, Selectable<E>, Openable<E>, java.io.Serializable, PageableModel

  A skeletal implementation for `TreeModel`.

  `AbstractTreeModel` implements both `TreeSelectableModel` and `TreeOpenableModel`. In other words, it stores the selection and open states, such that `Tree` and other UI can interact with.

  In additions, `AbstractTreeModel` also implements `Selectable` and `Openable` to simplify the access (and provides backward compatibility to ZK 5 and earlier). However, these two interfaces are optional and designed for application. `Tree` and all ZK core don't access it at all.

  For introduction, please refer to ZK Developer's Reference: Tree Model.

  Since:
    3.0.0
  Author:
    jumperchen, tomyeh
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `AbstractTreeModel.DefaultSelectionControl<E>` | A default selection control implementation for `AbstractTreeModel`, by default it assumes all elements are selectable.
    `protected static class` | `AbstractTreeModel.Path` | Represents a tree path.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.util.Set<AbstractTreeModel.Path>` | `_opens` | The open information.
    `protected java.util.Set<AbstractTreeModel.Path>` | `_selection` | The selection.

    - ### Fields inherited from interface org.zkoss.zul.PageableModel

      `INTERNAL_EVENT`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractTreeModel​(E root)` | Creates a `AbstractTreeModel`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `addOpenObject​(E child)` | Add the specified object into the collection of opened objects.
    `boolean` | `addOpenPath​(int[] path)` | Adds path to the current open.
    `boolean` | `addOpenPaths​(int[][] paths)` | Adds paths to the current Open.
    `void` | `addPagingEventListener​(PagingListener listener)` | Adds a listener to the list of listeners to be notified when a PagingEvent happens outside of standard Paging component
    `boolean` | `addSelectionPath​(int[] path)` | Adds path to the current selection.
    `boolean` | `addSelectionPaths​(int[][] paths)` | Adds paths to the current selection.
    `boolean` | `addToSelection​(E child)` | Add the specified object into selection.
    `void` | `addTreeDataListener​(TreeDataListener l)` | Add a listener to the tree that's notified each time a change to the data model occurs
    `protected void` | `afterSort​(java.lang.Object ctx)` | A utility that the deriving class can call to restore the states saved by `beforeSort()`
    `protected java.lang.Object` | `beforeSort()` | A utility that the deriving class can call to save the states before sorting the model.
    `void` | `clearOpen()` | Empties the current open path.
    `void` | `clearSelection()` | Empties the current selection.
    `java.lang.Object` | `clone()` |
    `void` | `fireEvent​(int evtType, int[] path, int indexFrom, int indexTo)` | Fires a `TreeDataEvent` for all registered listener
    `void` | `fireEvent​(int evtType, int[] path, int indexFrom, int indexTo, int[] affectedPath)` | Has the same functionality with `fireEvent(int, int[], int, int)`, while this is used for node removal only
    `void` | `fireEvent​(int evtType, int[] path, int indexFrom, int indexTo, int[][] affectedPaths)` | Has the same functionality with `fireEvent(int, int[], int, int)`, while this is used for node removal only
    `protected void` | `fireOpenChanged​(int[] path)` | Fires a `TreeDataEvent` for all registered listener when open status has changed.
    `protected void` | `fireSelectionChanged​(int[] path)` | Fires a `TreeDataEvent` for all registered listener when selection status has changed.
    `int` | `getActivePage()` | Returns the active page (starting from 0).
    `E` | `getChild​(int[] path)` | Returns the child at the given path where the path indicates the child is placed in the whole tree.
    `int` | `getIndexOfChild​(E parent, E child)` | Returns the index of child in parent.
    `int` | `getOpenCount()` | Returns the number of paths that are opened.
    `java.util.Set<E>` | `getOpenObjects()` | Returns the objects that are opened.
    `int[]` | `getOpenPath()` | Returns the first path in the open.
    `int[][]` | `getOpenPaths()` | Returns the paths in the open.
    `int` | `getPageCount()` | Returns the number of pages.
    `int` | `getPageSize()` | Returns the number of items per page.
    `int[]` | `getPath​(E child)` | Returns the path from the specified child.
    `E` | `getRoot()` | Return the root of the tree model.
    `java.util.Set<E>` | `getSelection()` | Returns the current selection.
    `SelectionControl` | `getSelectionControl()` | Returns the selection control for the selection model, if any.
    `int` | `getSelectionCount()` | Returns the number of paths that are selected.
    `int[]` | `getSelectionPath()` | Returns the first path in the selection.
    `int[][]` | `getSelectionPaths()` | Returns the paths in the selection.
    `int` | `getTotalSize()` | Returns the total number of items.
    `java.util.List<TreeDataListener>` | `getTreeDataListeners()` | Returns all listeners.
    `boolean` | `isMultiple()` | Returns whether the current selection mode is multiple.
    `boolean` | `isObjectOpened​(java.lang.Object child)` | Returns whether the specified object be opened.
    `boolean` | `isOpenEmpty()` | Returns true if the open is currently empty.
    `boolean` | `isPathOpened​(int[] path)` | Returns true if the path, `path`, is in the current open.
    `boolean` | `isPathSelected​(int[] path)` | Returns true if the path, `path`, is in the current selection.
    `boolean` | `isSelected​(java.lang.Object child)` | Returns whether an object is selected.
    `boolean` | `isSelectionEmpty()` | Returns true if the selection is currently empty.
    `boolean` | `removeFromSelection​(java.lang.Object child)` | Remove the specified object from selection.
    `boolean` | `removeOpenObject​(java.lang.Object child)` | Remove the specified object from selection.
    `boolean` | `removeOpenPath​(int[] path)` | Removes path from the open.
    `boolean` | `removeOpenPaths​(int[][] paths)` | Removes paths from the open.
    `void` | `removePagingEventListener​(PagingListener listener)` | Removes a listener from the list of listeners to be notified when a PagingEvent happens outside of standard Paging component
    `boolean` | `removeSelectionPath​(int[] path)` | Removes path from the selection.
    `boolean` | `removeSelectionPaths​(int[][] paths)` | Removes paths from the selection.
    `void` | `removeTreeDataListener​(TreeDataListener l)` | Remove a listener to the tree that's notified each time a change to the data model occurs
    `void` | `setActivePage​(int pg)` | Sets the active page (starting from 0).
    `void` | `setMultiple​(boolean multiple)` | Sets the selection mode to be multiple.
    `void` | `setOpenObjects​(java.util.Collection<? extends E> opened)` | Replace the current set of opened objects with the given set.
    `void` | `setPageSize​(int size)` | Sets the number of items per page.
    `void` | `setSelection​(java.util.Collection<? extends E> selection)` | Replace the current selection with the given set.
    `void` | `setSelectionControl​(SelectionControl ctrl)` | Sets the selection control for the selection model

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.zkoss.zul.TreeModel

      `getChild, getChildCount, isLeaf`

- - ### Field Detail

    - #### _selection

          protected java.util.Set<AbstractTreeModel.Path> _selection

      The selection.

    - #### _opens

          protected java.util.Set<AbstractTreeModel.Path> _opens

      The open information.

  - ### Constructor Detail

    - #### AbstractTreeModel

          public AbstractTreeModel​(E root)

      Creates a `AbstractTreeModel`.
      Parameters:
        `root` - root of tree

  - ### Method Detail

    - #### setSelectionControl

          public void setSelectionControl​(SelectionControl ctrl)

      Description copied from interface: `Selectable`
      Sets the selection control for the selection model
      Specified by:
        `setSelectionControl` in interface `Selectable<E>`

    - #### getSelectionControl

          public SelectionControl getSelectionControl()

      Description copied from interface: `Selectable`
      Returns the selection control for the selection model, if any.
      Specified by:
        `getSelectionControl` in interface `Selectable<E>`

    - #### getTreeDataListeners

          public java.util.List<TreeDataListener> getTreeDataListeners()

      Description copied from interface: `TreeModel`
      Returns all listeners.
      Specified by:
        `getTreeDataListeners` in interface `TreeModel<E>`

    - #### getRoot

          public E getRoot()

      Return the root of the tree model.
      Specified by:
        `getRoot` in interface `TreeModel<E>`
      Returns:
        the root of Tree.

    - #### fireEvent

          public void fireEvent​(int evtType,
                                int[] path,
                                int indexFrom,
                                int indexTo)

      Fires a `TreeDataEvent` for all registered listener

      Note: you can invoke this method only in an event listener.

      Since:
        6.0.0

    - #### fireEvent

          public void fireEvent​(int evtType,
                                int[] path,
                                int indexFrom,
                                int indexTo,
                                int[] affectedPath)

      Has the same functionality with `fireEvent(int, int[], int, int)`, while this is used for node removal only
      Since:
        7.0.5

    - #### fireEvent

          public void fireEvent​(int evtType,
                                int[] path,
                                int indexFrom,
                                int indexTo,
                                int[][] affectedPaths)

      Has the same functionality with `fireEvent(int, int[], int, int)`, while this is used for node removal only
      Since:
        10.0.0

    - #### fireSelectionChanged

          protected void fireSelectionChanged​(int[] path)

      Fires a `TreeDataEvent` for all registered listener when selection status has changed.
      Since:
        6.0.0

    - #### fireOpenChanged

          protected void fireOpenChanged​(int[] path)

      Fires a `TreeDataEvent` for all registered listener when open status has changed.
      Since:
        6.0.0

    - #### getIndexOfChild

          public int getIndexOfChild​(E parent,
                                     E child)

      Returns the index of child in parent. If either parent or child is null, returns -1. If either parent or child don't belong to this tree model, returns -1.

      The default implementation iterates through all children of `parent` by invoking, and check if `child` is part of them. You could override it if you have a better algorithm. `getChild(int[])`

      Specified by:
        `getIndexOfChild` in interface `TreeModel<E>`
      Parameters:
        `parent` - a node in the tree, obtained from this data source
        `child` - the node we are interested in
      Returns:
        the index of the child in the parent, or -1 if either child or parent are null or don't belong to this tree model
      Since:
        5.0.6

    - #### getChild

          public E getChild​(int[] path)

      Description copied from interface: `TreeModel`
      Returns the child at the given path where the path indicates the child is placed in the whole tree.
      Specified by:
        `getChild` in interface `TreeModel<E>`
      Parameters:
        `path` - the tree path
      Returns:
        the child at path

    - #### getPath

          public int[] getPath​(E child)

      Returns the path from the specified child. This implementation looks for the child by traversing every possible child (deep-first). It is suggested to override this method for better performance, if there is a better algorithm.
      Specified by:
        `getPath` in interface `TreeModel<E>`
      Parameters:
        `child` - the node we are interested in
      Since:
        6.0.0

    - #### addTreeDataListener

          public void addTreeDataListener​(TreeDataListener l)

      Description copied from interface: `TreeModel`
      Add a listener to the tree that's notified each time a change to the data model occurs
      Specified by:
        `addTreeDataListener` in interface `TreeModel<E>`
      Parameters:
        `l` - the listener to add

    - #### removeTreeDataListener

          public void removeTreeDataListener​(TreeDataListener l)

      Description copied from interface: `TreeModel`
      Remove a listener to the tree that's notified each time a change to the data model occurs
      Specified by:
        `removeTreeDataListener` in interface `TreeModel<E>`
      Parameters:
        `l` - the listener to remove

    - #### setMultiple

          public void setMultiple​(boolean multiple)

      Description copied from interface: `TreeSelectableModel`
      Sets the selection mode to be multiple.
      Specified by:
        `setMultiple` in interface `Selectable<E>`
      Specified by:
        `setMultiple` in interface `TreeSelectableModel`

    - #### isMultiple

          public boolean isMultiple()

      Description copied from interface: `TreeSelectableModel`
      Returns whether the current selection mode is multiple.
      Specified by:
        `isMultiple` in interface `Selectable<E>`
      Specified by:
        `isMultiple` in interface `TreeSelectableModel`
      See Also:
        `TreeSelectableModel.setMultiple(boolean)`

    - #### addSelectionPath

          public boolean addSelectionPath​(int[] path)

      Description copied from interface: `TreeSelectableModel`
      Adds path to the current selection. If path is not currently in the selection the TreeDataListeners are notified. This has no effect if `path` is null.
      Specified by:
        `addSelectionPath` in interface `TreeSelectableModel`
      Parameters:
        `path` - the new path to add to the current selection
      Returns:
        whether it is added successfully

    - #### addSelectionPaths

          public boolean addSelectionPaths​(int[][] paths)

      Description copied from interface: `TreeSelectableModel`
      Adds paths to the current selection. If any of the paths in paths are not currently in the selection the TreeDataListeners are notified. This has no effect if `paths` is null.
      Specified by:
        `addSelectionPaths` in interface `TreeSelectableModel`
      Parameters:
        `paths` - the new paths to add to the current selection
      Returns:
        whether it is added successfully

    - #### removeSelectionPath

          public boolean removeSelectionPath​(int[] path)

      Description copied from interface: `TreeSelectableModel`
      Removes path from the selection. If path is in the selection The TreeDataListeners are notified. This has no effect if `path` is null.
      Specified by:
        `removeSelectionPath` in interface `TreeSelectableModel`
      Parameters:
        `path` - the path to remove from the selection
      Returns:
        true if it was unselected successfully

    - #### removeSelectionPaths

          public boolean removeSelectionPaths​(int[][] paths)

      Description copied from interface: `TreeSelectableModel`
      Removes paths from the selection. If any of the paths in `paths` are in the selection, the TreeDataListeners are notified. This method has no effect if `paths` is null.
      Specified by:
        `removeSelectionPaths` in interface `TreeSelectableModel`
      Parameters:
        `paths` - the path to remove from the selection
      Returns:
        true if one of the paths was unselected successfully

    - #### isPathSelected

          public boolean isPathSelected​(int[] path)

      Description copied from interface: `TreeSelectableModel`
      Returns true if the path, `path`, is in the current selection.
      Specified by:
        `isPathSelected` in interface `TreeSelectableModel`

    - #### getSelectionPath

          public int[] getSelectionPath()

      Description copied from interface: `TreeSelectableModel`
      Returns the first path in the selection. How first is defined is up to implementors.
      Specified by:
        `getSelectionPath` in interface `TreeSelectableModel`

    - #### getSelectionPaths

          public int[][] getSelectionPaths()

      Description copied from interface: `TreeSelectableModel`
      Returns the paths in the selection. This will return null (or an empty array) if nothing is currently selected.
      Specified by:
        `getSelectionPaths` in interface `TreeSelectableModel`

    - #### getSelectionCount

          public int getSelectionCount()

      Description copied from interface: `TreeSelectableModel`
      Returns the number of paths that are selected.
      Specified by:
        `getSelectionCount` in interface `TreeSelectableModel`

    - #### isSelectionEmpty

          public boolean isSelectionEmpty()

      Description copied from interface: `TreeSelectableModel`
      Returns true if the selection is currently empty.
      Specified by:
        `isSelectionEmpty` in interface `Selectable<E>`
      Specified by:
        `isSelectionEmpty` in interface `TreeSelectableModel`

    - #### clearSelection

          public void clearSelection()

      Description copied from interface: `TreeSelectableModel`
      Empties the current selection. If this represents a change in the current selection, the selection listeners are notified.
      Specified by:
        `clearSelection` in interface `Selectable<E>`
      Specified by:
        `clearSelection` in interface `TreeSelectableModel`

    - #### addOpenPath

          public boolean addOpenPath​(int[] path)

      Description copied from interface: `TreeOpenableModel`
      Adds path to the current open. If path is not currently in the open the TreeDataListeners are notified. This has no effect if `path` is null.
      Specified by:
        `addOpenPath` in interface `TreeOpenableModel`
      Parameters:
        `path` - the new path to add to the current open
      Returns:
        whether it is added successfully

    - #### addOpenPaths

          public boolean addOpenPaths​(int[][] paths)

      Description copied from interface: `TreeOpenableModel`
      Adds paths to the current Open. If any of the paths in paths are not currently in the Open the TreeDataListeners are notified. This has no effect if `paths` is null.
      Specified by:
        `addOpenPaths` in interface `TreeOpenableModel`
      Parameters:
        `paths` - the new paths to add to the current Open
      Returns:
        whether an of the paths is added successfully

    - #### removeOpenPath

          public boolean removeOpenPath​(int[] path)

      Description copied from interface: `TreeOpenableModel`
      Removes path from the open. If path is in the open The TreeDataListeners are notified. This has no effect if `path` is null.
      Specified by:
        `removeOpenPath` in interface `TreeOpenableModel`
      Parameters:
        `path` - the path to remove from the open
      Returns:
        true if it was closed successfully

    - #### removeOpenPaths

          public boolean removeOpenPaths​(int[][] paths)

      Description copied from interface: `TreeOpenableModel`
      Removes paths from the open. If any of the paths in `paths` are in the open, the TreeDataListeners are notified. This method has no effect if `paths` is null.
      Specified by:
        `removeOpenPaths` in interface `TreeOpenableModel`
      Parameters:
        `paths` - the path to remove from the open
      Returns:
        true if one of the paths was closed successfully

    - #### isPathOpened

          public boolean isPathOpened​(int[] path)

      Description copied from interface: `TreeOpenableModel`
      Returns true if the path, `path`, is in the current open.
      Specified by:
        `isPathOpened` in interface `TreeOpenableModel`

    - #### getOpenPath

          public int[] getOpenPath()

      Description copied from interface: `TreeOpenableModel`
      Returns the first path in the open. How first is defined is up to implementors.
      Specified by:
        `getOpenPath` in interface `TreeOpenableModel`

    - #### getOpenPaths

          public int[][] getOpenPaths()

      Description copied from interface: `TreeOpenableModel`
      Returns the paths in the open. This will return null (or an empty array) if nothing is currently opened.
      Specified by:
        `getOpenPaths` in interface `TreeOpenableModel`

    - #### getOpenCount

          public int getOpenCount()

      Description copied from interface: `TreeOpenableModel`
      Returns the number of paths that are opened.
      Specified by:
        `getOpenCount` in interface `TreeOpenableModel`

    - #### isOpenEmpty

          public boolean isOpenEmpty()

      Description copied from interface: `TreeOpenableModel`
      Returns true if the open is currently empty.
      Specified by:
        `isOpenEmpty` in interface `Openable<E>`
      Specified by:
        `isOpenEmpty` in interface `TreeOpenableModel`

    - #### clearOpen

          public void clearOpen()

      Description copied from interface: `TreeOpenableModel`
      Empties the current open path. If this represents a change in the current open, the `TreeDataListener` listeners are notified.
      Specified by:
        `clearOpen` in interface `Openable<E>`
      Specified by:
        `clearOpen` in interface `TreeOpenableModel`

    - #### beforeSort

          protected java.lang.Object beforeSort()

      A utility that the deriving class can call to save the states before sorting the model.

      Default: saves the selection and open states.

      For example, `DefaultTreeModel.sort(java.util.Comparator<org.zkoss.zul.TreeNode<E>>, boolean)` invokes it to preserve the selection to the same objects (rather than the same paths).

      Since:
        6.0.0

    - #### afterSort

          protected void afterSort​(java.lang.Object ctx)

      A utility that the deriving class can call to restore the states saved by `beforeSort()`
      Since:
        6.0.0

    - #### getSelection

          public java.util.Set<E> getSelection()

      Description copied from interface: `Selectable`
      Returns the current selection. It is readonly. Don't modify it directly
      Specified by:
        `getSelection` in interface `Selectable<E>`
      Returns:
        the current selection.

    - #### setSelection

          public void setSelection​(java.util.Collection<? extends E> selection)

      Description copied from interface: `Selectable`
      Replace the current selection with the given set.

      If this represents a change to the current selection then notify each ListDataListener, including UI.

      Specified by:
        `setSelection` in interface `Selectable<E>`

    - #### isSelected

          public boolean isSelected​(java.lang.Object child)

      Description copied from interface: `Selectable`
      Returns whether an object is selected.
      Specified by:
        `isSelected` in interface `Selectable<E>`

    - #### addToSelection

          public boolean addToSelection​(E child)

      Description copied from interface: `Selectable`
      Add the specified object into selection.

      If this represents a change to the current selection then notify each ListDataListener, including UI.

      Specified by:
        `addToSelection` in interface `Selectable<E>`
      Parameters:
        `child` - the object to be as selection.
      Returns:
        true if it is added successfully; false if `obj` is not part of the data, or was already selected.

    - #### removeFromSelection

          public boolean removeFromSelection​(java.lang.Object child)

      Description copied from interface: `Selectable`
      Remove the specified object from selection.

      If this represents a change to the current selection then notify each ListDataListener, including UI.

      Specified by:
        `removeFromSelection` in interface `Selectable<E>`
      Parameters:
        `child` - the object to be remove from selection.
      Returns:
        whether it is removed successfully

    - #### getOpenObjects

          public java.util.Set<E> getOpenObjects()

      Description copied from interface: `Openable`
      Returns the objects that are opened. It is readonly. Don't modify it directly
      Specified by:
        `getOpenObjects` in interface `Openable<E>`

    - #### setOpenObjects

          public void setOpenObjects​(java.util.Collection<? extends E> opened)

      Description copied from interface: `Openable`
      Replace the current set of opened objects with the given set.
      Specified by:
        `setOpenObjects` in interface `Openable<E>`

    - #### isObjectOpened

          public boolean isObjectOpened​(java.lang.Object child)

      Description copied from interface: `Openable`
      Returns whether the specified object be opened.
      Specified by:
        `isObjectOpened` in interface `Openable<E>`

    - #### addOpenObject

          public boolean addOpenObject​(E child)

      Description copied from interface: `Openable`
      Add the specified object into the collection of opened objects.
      Specified by:
        `addOpenObject` in interface `Openable<E>`
      Parameters:
        `child` - the object to be as selection.
      Returns:
        true if it is added successfully; false if `obj` is not part of the data, or was already opened.

    - #### removeOpenObject

          public boolean removeOpenObject​(java.lang.Object child)

      Description copied from interface: `Openable`
      Remove the specified object from selection.
      Specified by:
        `removeOpenObject` in interface `Openable<E>`
      Parameters:
        `child` - the object to be remove from selection.
      Returns:
        whether it is removed successfully

    - #### clone

          public java.lang.Object clone()

      Overrides:
        `clone` in class `java.lang.Object`

    - #### getPageSize

          public int getPageSize()

      Description copied from interface: `Pageable`
      Returns the number of items per page.

      Default: 20.

      Specified by:
        `getPageSize` in interface `Pageable`

    - #### setPageSize

          public void setPageSize​(int size)
                           throws WrongValueException

      Description copied from interface: `Pageable`
      Sets the number of items per page.
      Specified by:
        `setPageSize` in interface `Pageable`
      Throws:
        `WrongValueException`

    - #### getTotalSize

          public int getTotalSize()

      Returns the total number of items.
      Note: the entire tree will be traversed once to count the number of tree nodes, although the result will be cached until the model has changed (open/add/remove/etc.), it is still a VERY EXPENSIVE operation, please @Override to provide your own implementation for better performance
      Specified by:
        `getTotalSize` in interface `PageableModel`
      Returns:
        number of total size, or 0 if the model is empty
      Since:
        10.0.0

    - #### getPageCount

          public int getPageCount()

      Returns the number of pages. Note: there is at least one page even no item at all.
      Note: the entire tree will be traversed once to count the number of tree nodes, although the result will be cached until the model has changed (open/add/remove/etc.), it is still a VERY EXPENSIVE operation, please @Override to provide your own implementation for better performance
      Specified by:
        `getPageCount` in interface `Pageable`
      Returns:
        number of pages, or 1 if the model is empty
      Since:
        8.0.0

    - #### getActivePage

          public int getActivePage()

      Description copied from interface: `Pageable`
      Returns the active page (starting from 0).
      Specified by:
        `getActivePage` in interface `Pageable`

    - #### setActivePage

          public void setActivePage​(int pg)
                             throws WrongValueException

      Description copied from interface: `Pageable`
      Sets the active page (starting from 0).
      Specified by:
        `setActivePage` in interface `Pageable`
      Throws:
        `WrongValueException`

    - #### addPagingEventListener

          public void addPagingEventListener​(PagingListener listener)

      Description copied from interface: `PageableModel`
      Adds a listener to the list of listeners to be notified when a PagingEvent happens outside of standard Paging component
      Specified by:
        `addPagingEventListener` in interface `PageableModel`

    - #### removePagingEventListener

          public void removePagingEventListener​(PagingListener listener)

      Description copied from interface: `PageableModel`
      Removes a listener from the list of listeners to be notified when a PagingEvent happens outside of standard Paging component
      Specified by:
        `removePagingEventListener` in interface `PageableModel`