org.richfaces.model

## Class TreeSequenceKeyModel<V>

- java.lang.Object
- - javax.faces.model.DataModel<E>
  - - org.ajax4jsf.model.ExtendedDataModel<V>
    - - org.richfaces.model.TreeSequenceKeyModel<V>

- All Implemented Interfaces:
    Iterable<V>, TreeDataModel<V>
  Direct Known Subclasses:
    DeclarativeTreeDataModelImpl, NodesTreeSequenceKeyModel

      public abstract class TreeSequenceKeyModel<V>
      extends ExtendedDataModel<V>
      implements TreeDataModel<V>

  Author:
    Nick Belaevski

- - ### Field Summary

    - ### Fields inherited from interface org.richfaces.model.TreeDataModel

      `SEPARATOR_CHAR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TreeSequenceKeyModel()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `getData()`
    `Object` | `getParentRowKey(Object rowKey)`
    `int` | `getRowCount()`
    `V` | `getRowData()`
    `int` | `getRowIndex()`
    `SequenceRowKey` | `getRowKey()`
    `boolean` | `isDataAvailable()`
    `boolean` | `isRowAvailable()`
    `protected void` | `setData(V data)`
    `void` | `setRowIndex(int rowIndex)`
    `void` | `setRowKey(Object rowKey)` Instead of simple `int` for current state selection, this model can use any object for select current data.
    `protected void` | `setRowKeyAndData(SequenceRowKey key, V data)`
    `protected abstract void` | `setupKey(SequenceRowKey key)`
    `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

      `addDataModelListener, getDataModelListeners, getWrappedData, iterator, removeDataModelListener, setWrappedData`

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

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

    - ### Methods inherited from interface org.richfaces.model.TreeDataModel

      `children, createSnapshot, getRowKeyConverter, getWrappedData, isLeaf, restoreFromSnapshot, setWrappedData`

- - ### Constructor Detail

    - #### TreeSequenceKeyModel

          public TreeSequenceKeyModel()

  - ### Method Detail

    - #### getRowKey

          public SequenceRowKey getRowKey()

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

    - #### setRowKey

          public void setRowKey(Object rowKey)

      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 interface `TreeDataModel<V>`
      Specified by:
        `setRowKey` in class `ExtendedDataModel<V>`
      Parameters:
        `rowKey` - key for select current data, or null for clear selection.

    - #### setData

          protected void setData(V data)

    - #### setRowKeyAndData

          protected void setRowKeyAndData(SequenceRowKey key,
                              V data)

    - #### isDataAvailable

          public boolean isDataAvailable()

      Specified by:
        `isDataAvailable` in interface `TreeDataModel<V>`

    - #### getData

          public V getData()

      Specified by:
        `getData` in interface `TreeDataModel<V>`

    - #### setupKey

          protected abstract void setupKey(SequenceRowKey key)

    - #### 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<V>`
      Parameters:
        `context` - current JSF context.
        `visitor` - instance of `DataVisitor`, for process each row.
        `range` - Implementation-specific range of data keys.
        `argument` - Implementation-specific argument

    - #### isRowAvailable

          public boolean isRowAvailable()

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

    - #### getRowCount

          public int getRowCount()

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

    - #### getRowData

          public V getRowData()

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

    - #### getRowIndex

          public int getRowIndex()

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

    - #### setRowIndex

          public void setRowIndex(int rowIndex)

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

    - #### getParentRowKey

          public Object getParentRowKey(Object rowKey)

      Specified by:
        `getParentRowKey` in interface `TreeDataModel<V>`

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