public class DataModelTableContentProvider<E> extends PageFlowScopeAdapter implements ITableContentProvider
DataModel
adapter for a ITableContentProvider
.
Used internally by table control to adapt DataModel objects to ITableContentProvider.
Modifier and Type | Field and Description |
---|---|
protected DataModel<E> |
m_model |
protected String |
m_var |
fExpireWithPageFlow
Constructor and Description |
---|
DataModelTableContentProvider()
Default constructor.
|
DataModelTableContentProvider(DataModel<E> model)
Construct a new instance and set the data model accordingly.
|
Modifier and Type | Method and Description |
---|---|
Object |
getCurrentRow()
Returns current row.
|
DataModel<E> |
getModel() |
Object[] |
getPropertyKeys()
Returns list of properties supported by this content provider.
|
int |
getRowCount()
Return the number of rows of data objects represented by this DataModel.
|
int |
getRowIndex()
Return the zero-relative index of the currently selected row.
|
String |
getRowVariable()
Returns row variable name.
|
Class<?> |
getType(Object propertyKey)
Returns java type of the given property
|
Object |
getValue(Object propertyKey)
Returns value of the given property
|
boolean |
hasProperty(Object propertyKey)
Checks if the given property is supported by this content provider
|
boolean |
isReadOnly(Object propertyKey) |
boolean |
isRowAvailable()
Return a flag indicating whether there is rowData available at the
current rowIndex.
|
void |
setModel(DataModel<E> model) |
void |
setRowIndex(int rowIndex)
Set the zero-relative index of the currently selected row, or -1 to
indicate that we are not positioned on a row.
|
void |
setRowVariable(String var)
Set row variable name
|
void |
setValue(Object propertyKey,
Object value)
Set value for the property specified for the current row
|
String |
toString()
Returns string representation of content.
|
getExpireWithPageFlow, setExpireWithPageFlow
public DataModelTableContentProvider()
public String toString()
IContentProvider
toString
in interface IContentProvider
toString
in class Object
String
representation of the wrapped contentpublic Object[] getPropertyKeys()
IContentProvider
Object[0]
,
never null.getPropertyKeys
in interface IContentProvider
String
or Integer
public Class<?> getType(Object propertyKey) throws PropertyNotFoundException
IContentProvider
getType
in interface IContentProvider
propertyKey
- the property key of type String
or Integer
Class
PropertyNotFoundException
- if property is not supportedpublic Object getValue(Object propertyKey) throws ELException, PropertyNotFoundException
IContentProvider
getValue
in interface IContentProvider
propertyKey
- the property key of type String
or Integer
null
PropertyNotFoundException
- if property is not supportedELException
public boolean hasProperty(Object propertyKey)
IContentProvider
hasProperty
in interface IContentProvider
propertyKey
- property key of type String
or Integer
true
if property is supportedpublic boolean isReadOnly(Object propertyKey) throws ELException, PropertyNotFoundException
PropertyNotFoundException
- if the current row is nullELException
ContentProviderUtils.isReadOnly(Object, Object)
public void setValue(Object propertyKey, Object value) throws ELException, PropertyNotFoundException
propertyKey
- value
- EvaluationException
PropertyNotFoundException
ELException
ContentProviderUtils.setValue(Object, Object, Object)
public int getRowCount()
ITableContentProvider
Return -1, if the number of rows is unknown, or no wrappedData is available.
getRowCount
in interface ITableContentProvider
DataModel.getRowCount()
public int getRowIndex()
ITableContentProvider
If we are not currently positioned on a row, or no wrappedData is available, return -1.
getRowIndex
in interface ITableContentProvider
DataModel.getRowIndex()
public boolean isRowAvailable()
ITableContentProvider
isRowAvailable
in interface ITableContentProvider
DataModel.isRowAvailable()
public void setRowIndex(int rowIndex)
ITableContentProvider
setRowIndex
in interface ITableContentProvider
DataModel.setRowIndex(int)
public String getRowVariable()
ITableContentProvider
Returns row variable name.
If specified row variable can be used to access current row data for the provider internal needs, like sorting or addressing.
getRowVariable
in interface ITableContentProvider
ITableContentProvider.setRowVariable(String)
public void setRowVariable(String var)
setRowVariable
in interface ITableContentProvider
public Object getCurrentRow()
getCurrentRow
in interface ITableContentProvider
ITableContentProvider.isRowAvailable()