com.sun.rave.web.ui.faces
Class TableDataProviderDataModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by com.sun.rave.web.ui.faces.TableDataProviderDataModel

public class TableDataProviderDataModel
extends javax.faces.model.DataModel

DataModel implementation that wraps a specified TableDataProvider with the standard JavaServer Faces API. Note that setting the rowIndex property of this DataModel does NOT cause the cursor of the wrapped TableDataProvider to be repositioned.


Constructor Summary
TableDataProviderDataModel()
          Construct an unitialized TableDataProviderDataModel.
TableDataProviderDataModel(com.sun.data.provider.TableDataProvider tdp)
          Construct an TableDataProviderDataModel that wraps the specified TableDataProvider.
 
Method Summary
 int getRowCount()
          Return the number of rows available in the wrapped TableDataProvider, or -1 if unknown.
 java.lang.Object getRowData()
          Return a Map representing the data elements in the current row, keyed by the canonical identifier for each element.
 int getRowIndex()
          Return the currently selected rowIndex, or -1 for no current position.
 com.sun.data.provider.RowKey getRowKey()
           
 com.sun.data.provider.TableDataProvider getTableDataProvider()
          Return the TableDataProvider we are wrapping.
 java.lang.Object getWrappedData()
          Return the wrapped TableDataProvider instance, if any.
 boolean isRowAvailable()
          Return true if the wrapped TableDataProvider has an available row at the currently specified rowIndex.
 void setRowIndex(int rowIndex)
          Set the currently selected rowIndex.
 void setTableDataProvider(com.sun.data.provider.TableDataProvider tdp)
          Set the TableDataProvider we are wrapping.
 void setWrappedData(java.lang.Object data)
          Set the wrapped TableDataProvider instance (if any).
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDataProviderDataModel

public TableDataProviderDataModel()

Construct an unitialized TableDataProviderDataModel.


TableDataProviderDataModel

public TableDataProviderDataModel(com.sun.data.provider.TableDataProvider tdp)

Construct an TableDataProviderDataModel that wraps the specified TableDataProvider.

Method Detail

getTableDataProvider

public com.sun.data.provider.TableDataProvider getTableDataProvider()

Return the TableDataProvider we are wrapping.


setTableDataProvider

public void setTableDataProvider(com.sun.data.provider.TableDataProvider tdp)

Set the TableDataProvider we are wrapping.

Parameters:
tdp - The TableDataProvider to be wraapped

isRowAvailable

public boolean isRowAvailable()

Return true if the wrapped TableDataProvider has an available row at the currently specified rowIndex.

Specified by:
isRowAvailable in class javax.faces.model.DataModel

getRowCount

public int getRowCount()

Return the number of rows available in the wrapped TableDataProvider, or -1 if unknown.

Specified by:
getRowCount in class javax.faces.model.DataModel

getRowData

public java.lang.Object getRowData()

Return a Map representing the data elements in the current row, keyed by the canonical identifier for each element. Any call to get() or put() operations on this Map will be delegated to corresponding getValue() and setValue() calls on the wrapped TableDataProvider. Operations that attempt to add, delete, or replace keys will be rejected.

Specified by:
getRowData in class javax.faces.model.DataModel

getRowIndex

public int getRowIndex()

Return the currently selected rowIndex, or -1 for no current position.

Specified by:
getRowIndex in class javax.faces.model.DataModel

getRowKey

public com.sun.data.provider.RowKey getRowKey()

setRowIndex

public void setRowIndex(int rowIndex)

Set the currently selected rowIndex. The cursor position of the wrapped TableDataProvider is NOT updated.

Specified by:
setRowIndex in class javax.faces.model.DataModel
Parameters:
rowIndex - The new selected row index, or -1 for no selection

getWrappedData

public java.lang.Object getWrappedData()

Return the wrapped TableDataProvider instance, if any.

Specified by:
getWrappedData in class javax.faces.model.DataModel

setWrappedData

public void setWrappedData(java.lang.Object data)

Set the wrapped TableDataProvider instance (if any).

Specified by:
setWrappedData in class javax.faces.model.DataModel
Parameters:
data - New TableDataProvider instance, or null to disassociate from any instance