public class EditableModelImpl extends javax.faces.model.DataModel implements EditableModel, Serializable
Only accepts lists or arrays of Serializable objects for now.
| Modifier and Type | Field and Description | 
|---|---|
protected List | 
data  | 
protected int | 
index  | 
protected Map<Integer,Integer> | 
keyMap  | 
protected ListDiff | 
listDiff  | 
protected Object | 
originalData  | 
static String | 
SKIP_MISSING_ROW
Allows to have an alternative management of missing rows. 
 | 
protected boolean | 
skipMissingRow  | 
protected Object | 
template  | 
| Constructor and Description | 
|---|
EditableModelImpl(Object value,
                 Object template)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addTemplateValue()  | 
boolean | 
addValue(Object value)
Adds new value at the end of the model. 
 | 
ListDiff | 
getListDiff()
Returns the list diff, ignoring all data that has not changed. 
 | 
protected int | 
getNewRowKey()
Returns a new row key that is not already used. 
 | 
Object | 
getOriginalData()
Returns original data used for data model creation. 
 | 
protected Object | 
getOriginalRowDataForKey(int key)
Returns the initial data for the given key. 
 | 
int | 
getRowCount()  | 
Object | 
getRowData()  | 
int | 
getRowIndex()  | 
Integer | 
getRowKey()
Gets unique key identifier for this row. 
 | 
Object | 
getUnreferencedTemplate()  | 
Object | 
getWrappedData()
Gets wrapped data. 
 | 
protected void | 
initializeData(Object originalData)  | 
void | 
insertTemplateValue(int index)  | 
void | 
insertValue(int index,
           Object value)
Inserts value at given index on the model. 
 | 
boolean | 
isDirty()
Returns true if any changes occurred on the model. 
 | 
boolean | 
isRowAvailable()  | 
boolean | 
isRowModified()
Returns true if row data has changed from its original value. 
 | 
boolean | 
isRowNew()
Returns true if row data is not in the original list. 
 | 
Object | 
moveValue(int fromIndex,
         int toIndex)
Modifies value at given index on the model. 
 | 
void | 
recordValueModified(int index,
                   Object newValue)
Records a value has been modified at given index. 
 | 
Object | 
removeValue(int index)
Removes value at given index. 
 | 
void | 
setListDiff(ListDiff listDiff)
Sets list diff. 
 | 
void | 
setRowData(Object rowData)
Sets row data using given value. 
 | 
void | 
setRowIndex(int rowIndex)  | 
void | 
setRowKey(Integer key)
Sets unique key identifier for this row. 
 | 
void | 
setWrappedData(Object data)
Sets wrapped data. 
 | 
int | 
size()
Returns the model size. 
 | 
String | 
toString()  | 
addDataModelListener, getDataModelListeners, iterator, removeDataModelListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected final Object originalData
protected int index
public static final String SKIP_MISSING_ROW
Default value is to keep the current behavior.
protected boolean skipMissingRow
public EditableModelImpl(Object value, Object template)
protected void initializeData(Object originalData)
public Object getUnreferencedTemplate()
getUnreferencedTemplate in interface EditableModelpublic Object getOriginalData()
EditableModelgetOriginalData in interface EditableModelpublic Object getWrappedData()
EditableModelThis data may be different from the original one if any changes occured on the model.
getWrappedData in interface EditableModelgetWrappedData in class javax.faces.model.DataModelpublic void setWrappedData(Object data)
EditableModelsetWrappedData in interface EditableModelsetWrappedData in class javax.faces.model.DataModelprotected Object getOriginalRowDataForKey(int key)
Returns null marker if key is invalid or data did not exist for given key in the original data.
protected int getNewRowKey()
public boolean isRowAvailable()
isRowAvailable in interface EditableModelisRowAvailable in class javax.faces.model.DataModelDataModel.isRowAvailable()public boolean isRowModified()
EditableModelisRowModified in interface EditableModelpublic boolean isRowNew()
EditableModelisRowNew in interface EditableModelpublic void recordValueModified(int index, Object newValue)
EditableModelrecordValueModified in interface EditableModelpublic int getRowCount()
getRowCount in interface EditableModelgetRowCount in class javax.faces.model.DataModelDataModel.getRowCount()public Object getRowData()
getRowData in interface EditableModelgetRowData in class javax.faces.model.DataModelDataModel.getRowData()public void setRowData(Object rowData)
EditableModelsetRowData in interface EditableModelpublic int getRowIndex()
getRowIndex in interface EditableModelgetRowIndex in class javax.faces.model.DataModelDataModel.getRowIndex()public void setRowIndex(int rowIndex)
setRowIndex in interface EditableModelsetRowIndex in class javax.faces.model.DataModelDataModel.setRowIndex(int)public Integer getRowKey()
EditableModelgetRowKey in interface EditableModelpublic void setRowKey(Integer key)
EditableModelsetRowKey in interface EditableModelpublic ListDiff getListDiff()
EditableModelThe list diff tracks chronologically all changes that were made to the original (and changing) model.
getListDiff in interface EditableModelpublic void setListDiff(ListDiff listDiff)
EditableModelsetListDiff in interface EditableModelpublic boolean isDirty()
EditableModelisDirty in interface EditableModelpublic void addTemplateValue()
addTemplateValue in interface EditableModelpublic boolean addValue(Object value)
EditableModeladdValue in interface EditableModelpublic void insertTemplateValue(int index)
insertTemplateValue in interface EditableModelpublic void insertValue(int index, Object value)
EditableModelinsertValue in interface EditableModelpublic Object moveValue(int fromIndex, int toIndex)
EditableModelmoveValue in interface EditableModelpublic Object removeValue(int index)
EditableModelremoveValue in interface EditableModelpublic int size()
EditableModelsize in interface EditableModelCopyright © 2019 Nuxeo. All rights reserved.