org.richfaces.model

## Class ArrangeableModel

- java.lang.Object
- - javax.faces.model.DataModel<E>
  - - org.richfaces.model.ExtendedDataModel<Object>
    - - org.richfaces.model.ArrangeableModel

- All Implemented Interfaces:
    Iterable<Object>, Arrangeable

      public class ArrangeableModel
      extends ExtendedDataModel<Object>
      implements Arrangeable

  Author:
    Konstantin Mishin

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ArrangeableModel(ExtendedDataModel<?> originalModel, String var, String filterVar)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDataModelListener(javax.faces.model.DataModelListener listener)`
    `void` | `arrange(javax.faces.context.FacesContext context, ArrangeableState state)`
    `javax.faces.model.DataModelListener[]` | `getDataModelListeners()`
    `int` | `getRowCount()`
    `Object` | `getRowData()`
    `int` | `getRowIndex()`
    `Object` | `getRowKey()`
    `Object` | `getWrappedData()`
    `boolean` | `isRowAvailable()`
    `void` | `removeDataModelListener(javax.faces.model.DataModelListener listener)`
    `void` | `setRowIndex(int rowIndex)`
    `void` | `setRowKey(Object key)` Instead of simple `int` for current state selection, this model can use any object for select current data.
    `void` | `setWrappedData(Object data)`
    `void` | `walk(javax.faces.context.FacesContext context, DataVisitor visitor, Range range, Object argument)` Iterate over model by "visitor" pattern, for given range

    - ### Methods inherited from class javax.faces.model.DataModel

      `iterator`

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

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

- - ### Constructor Detail

    - #### ArrangeableModel

          public ArrangeableModel(ExtendedDataModel<?> originalModel,
                          String var,
                          String filterVar)

  - ### Method Detail

    - #### addDataModelListener

          public void addDataModelListener(javax.faces.model.DataModelListener listener)

      Overrides:
        `addDataModelListener` in class `javax.faces.model.DataModel<Object>`

    - #### removeDataModelListener

          public void removeDataModelListener(javax.faces.model.DataModelListener listener)

      Overrides:
        `removeDataModelListener` in class `javax.faces.model.DataModel<Object>`

    - #### getDataModelListeners

          public javax.faces.model.DataModelListener[] getDataModelListeners()

      Overrides:
        `getDataModelListeners` in class `javax.faces.model.DataModel<Object>`

    - #### getRowKey

          public Object getRowKey()

      Specified by:
        `getRowKey` in class `ExtendedDataModel<Object>`
      Returns:
        key for selected data or `null`

    - #### setRowKey

          public void setRowKey(Object key)

      Description copied from class: `ExtendedDataModel`

      Instead of simple `int` for current state selection, this model can use any object for select current data. Implementation depend on model, with any restrictions :

      1. key must be `Serializable`.
      2. `Object.toString()` method must return representation compatible with `UIComponent.getClientId(javax.faces.context.FacesContext)`, as far as this string will be appended to clientId of iterator component.
      Specified by:
        `setRowKey` in class `ExtendedDataModel<Object>`
      Parameters:
        `key` - key for select current data, or null for clear selection.

    - #### walk

          public void walk(javax.faces.context.FacesContext context,
                  DataVisitor visitor,
                  Range range,
                  Object argument)

      Description copied from class: `ExtendedDataModel`
      Iterate over model by "visitor" pattern, for given range
      Specified by:
        `walk` in class `ExtendedDataModel<Object>`
      Parameters:
        `context` - current JSF context.
        `visitor` - instance of `DataVisitor`, for process each row.
        `range` - Implementation-specific range of data keys.
        `argument` - Implementation-specific argument

    - #### getRowCount

          public int getRowCount()

      Specified by:
        `getRowCount` in class `javax.faces.model.DataModel<Object>`

    - #### getRowData

          public Object getRowData()

      Specified by:
        `getRowData` in class `javax.faces.model.DataModel<Object>`

    - #### getRowIndex

          public int getRowIndex()

      Specified by:
        `getRowIndex` in class `javax.faces.model.DataModel<Object>`

    - #### getWrappedData

          public Object getWrappedData()

      Specified by:
        `getWrappedData` in class `javax.faces.model.DataModel<Object>`

    - #### isRowAvailable

          public boolean isRowAvailable()

      Specified by:
        `isRowAvailable` in class `javax.faces.model.DataModel<Object>`

    - #### setRowIndex

          public void setRowIndex(int rowIndex)

      Specified by:
        `setRowIndex` in class `javax.faces.model.DataModel<Object>`

    - #### setWrappedData

          public void setWrappedData(Object data)

      Specified by:
        `setWrappedData` in class `javax.faces.model.DataModel<Object>`

    - #### arrange

          public void arrange(javax.faces.context.FacesContext context,
                     ArrangeableState state)

      Specified by:
        `arrange` in interface `Arrangeable`

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.