org.apache.myfaces.trinidad.model

## Class MenuModel

- java.lang.Object
- - javax.faces.model.DataModel
  - - org.apache.myfaces.trinidad.model.CollectionModel
    - - org.apache.myfaces.trinidad.model.TreeModel
      - - org.apache.myfaces.trinidad.model.MenuModel

- All Implemented Interfaces:
    Iterable, LocalRowKeyIndex, RowKeyIndex, TreeLocalRowKeyIndex
  Direct Known Subclasses:
    BaseMenuModel, ChildPropertyMenuModel

      public abstract class MenuModel
      extends TreeModel

  A MenuModel objects represents the menu structure of a page or application. The menu model should know how to go from the current viewId to a focus rowKey.

  MenuModel extends TreeModel and adds a single method, getFocusRowKey(), which returns the rowKey of the focus page for the current view id.

  Work on modeling menus continues and it is very possible that this class will change in a future release.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex

      `LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy`

  - ### Field Summary

    - ### Fields inherited from class org.apache.myfaces.trinidad.model.CollectionModel

      `UNKNOWN_ROW_LIMIT, UNLIMITED_ROW`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MenuModel()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract Object` | `getFocusRowKey()` Gets the focus rowKey for the current viewId.

    - ### Methods inherited from class org.apache.myfaces.trinidad.model.TreeModel

      `areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, enterContainer, exitContainer, getAllAncestorContainerRowKeys, getContainerRowKey, getContainerRowKey, getDepth, getDepth, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isContainer, isContainerEmpty`

    - ### Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel

      `addRowKeyChangeListener, areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, ensureRowsAvailable, fireRowKeyChange, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowData, getRowData, getRowKey, getRowLimit, getSortCriteria, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, isSortable, removeRowKeyChangeListener, setRowKey, setSortCriteria`

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

      `addDataModelListener, getDataModelListeners, getRowCount, getRowData, getRowIndex, getWrappedData, isRowAvailable, iterator, removeDataModelListener, setRowIndex, setWrappedData`

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

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

    - ### Methods inherited from interface org.apache.myfaces.trinidad.model.RowKeyIndex

      `getRowCount, getRowData, getRowIndex, isRowAvailable, setRowIndex`

- - ### Constructor Detail

    - #### MenuModel

          public MenuModel()

  - ### Method Detail

    - #### getFocusRowKey

          public abstract Object getFocusRowKey()

      Gets the focus rowKey for the current viewId. If there is no item in focus, getFocusRowKey should return null.

      The value returned from calling `CollectionModel.getRowKey()` should remain the same before and after calling getFocusRowKey(). Meaning initialPath and currPath should always be equal in the following example

             Object initialPath = model.getRowKey();
             Object focusPath   = model.getFocusRowKey();
             Object currPath    = model.getRowKey();

      Returns:
        the focus rowKey for the current viewId

Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.