Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.ui.web.model
Interface EditableModel

All Known Implementing Classes:
EditableModelImpl

public interface EditableModel

Interface for editable data model.

Follows data model interface and adds method to deal with edit/add/modify.

Author:
Anahide Tchertchian

Method Summary
 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.
 Object getOriginalData()
          Returns original data used for data model creation.
 int getRowCount()
           
 Object getRowData()
           
 int getRowIndex()
           
 Integer getRowKey()
          Gets unique key identifier for this row.
 Object getWrappedData()
          Gets wrapped data.
 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.
 

Method Detail

getOriginalData

Object getOriginalData()
Returns original data used for data model creation.


getWrappedData

Object getWrappedData()
Gets wrapped data.

This data may be different from the original one if any changes occured on the model.


setWrappedData

void setWrappedData(Object data)
Sets wrapped data.


isRowAvailable

boolean isRowAvailable()
See Also:
DataModel.isRowAvailable()

isRowModified

boolean isRowModified()
Returns true if row data has changed from its original value.


isRowNew

boolean isRowNew()
Returns true if row data is not in the original list.


recordValueModified

void recordValueModified(int index,
                         Object newValue)
Records a value has been modified at given index.


getRowCount

int getRowCount()
See Also:
DataModel.getRowCount()

getRowData

Object getRowData()
See Also:
DataModel.getRowData()

setRowData

void setRowData(Object rowData)
Sets row data using given value.


getRowIndex

int getRowIndex()
See Also:
DataModel.getRowIndex()

setRowIndex

void setRowIndex(int rowIndex)
See Also:
DataModel.setRowIndex(int)

getRowKey

Integer getRowKey()
Gets unique key identifier for this row.


setRowKey

void setRowKey(Integer key)
Sets unique key identifier for this row.


getListDiff

ListDiff getListDiff()
Returns the list diff, ignoring all data that has not changed.

The list diff tracks chronologically all changes that were made to the original (and changing) model.


setListDiff

void setListDiff(ListDiff listDiff)
Sets list diff.


isDirty

boolean isDirty()
Returns true if any changes occurred on the model.


addValue

boolean addValue(Object value)
Adds new value at the end of the model.


insertValue

void insertValue(int index,
                 Object value)
Inserts value at given index on the model.

Throws:
IllegalArgumentException - if model does not handle this index.

moveValue

Object moveValue(int fromIndex,
                 int toIndex)
Modifies value at given index on the model.

Returns:
the old value at that index.
Throws:
IllegalArgumentException - if model does not handle one of given indexes.

removeValue

Object removeValue(int index)
Removes value at given index.

Returns:
the old value at that index.
Throws:
IllegalArgumentException - if model does not handle this index.

size

int size()
Returns the model size.


Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.