net.infordata.ifw2.web.grds
Interface IGridModel

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IDataGridModel, IEditableGridModel, IJpaFolderModel<C>, IJpaGridModel<C>, IOrderedGridModel, IPojoEditableGridModel<C>, IPojoGridModel<C>, IReloadableGridModel, ITreeGridModel
All Known Implementing Classes:
AJpaDataGridModel, AJpaEditableDataGridModel, AJpaEditableFolderModel, AJpaEditableGridModel, AJpaFolderModel, AJpaGridModel, APojoCrossModel, APojoEditableDataGridModel, APojoEditableGridModel, APojoGridModel, DataGridModelAdapter, EnumModel, MultiSelectionGridFlow.Model, PojoDataGridModel, PojoGridModel, PojoGroupingModel

public interface IGridModel
extends java.io.Serializable

Author:
valentino.proietti

Method Summary
 int fetchRows(int rowIndex, int count)
          Used by the ui to ensure that the request rows really exist without the need to retrieve any column value.
 IColumn getColumn(int columnIndex)
           
 int getColumnCount()
           
 IColumnGroup getColumnGroup(java.lang.String groupId)
           
 int getColumnIndex(java.lang.String columnName)
           
 java.lang.String getColumnName(int columnIndex)
           
 int getCurrentRow()
           
 int getCurrentRowCount()
           
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCurrentRowFreezed()
           
 void setCurrentRow(int rowIndex)
           
 void sync()
          Called by the framework just before displaying the AGridFlow.
 

Method Detail

getColumnCount

int getColumnCount()

getColumnIndex

int getColumnIndex(java.lang.String columnName)
Parameters:
columnName -
Returns:
less than 0 if not found.

getColumn

IColumn getColumn(int columnIndex)
Parameters:
columnIndex -
Returns:
always not null otherwise an exception is thrown if the column doesn't exist.

getColumnName

java.lang.String getColumnName(int columnIndex)

getColumnGroup

IColumnGroup getColumnGroup(java.lang.String groupId)
Parameters:
groupId -
Returns:
if null then default behaviors and values are assumed.

getCurrentRowCount

int getCurrentRowCount()
Returns:
the currently loaded rows, generally it is equal to getRowCount() but can be less if the model supports paging.

getRowCount

int getRowCount()
Returns:
the row count, if not known yet Integer.MAX_VALUE.

sync

void sync()
Called by the framework just before displaying the AGridFlow.
Here is where the model can, as an example, ensure that depending sub models are synchronized or to restore data after a serialization.
Keep in mind that after synchronizing the model internal state can be changed.


getValueAt

java.lang.Object getValueAt(int rowIndex,
                            int columnIndex)
                            throws OutOfBoundsException
Parameters:
rowIndex -
columnIndex -
Returns:
the value for the given coordinates.
Throws:
OutOfBoundsException - - used by models providing data pagination.
The contract, for paging models, is:
- for sequential access, when a row is requested, the model must ensure that also the next row is loaded, if it does not exist, getRowCount() must return the "real" value. - if a requested row does not exist (because of random access), the OutOfBoundsException must be thrown, and next getRowCount() requests must return the "real" value and the getCurrentRow() method must return a valid current row.

fetchRows

int fetchRows(int rowIndex,
              int count)
Used by the ui to ensure that the request rows really exist without the need to retrieve any column value.
The ui is simply saying that it wants to get access to the given rows.

Parameters:
rowIndex - - starting from this index ...
count - - ... we want this number of rows
Returns:
the real number of rows founded.
Returning a number less than the requested number of rows means that the last row has been finally reached, in this case a following call to getRowCount() must return the real rows counter and a call to getCurrentRow() a valid row index.

getCurrentRow

int getCurrentRow()
Returns:
the current row, a number less than 0 means none.

setCurrentRow

void setCurrentRow(int rowIndex)

isCurrentRowFreezed

boolean isCurrentRowFreezed()
Returns:
true if some sort of editing is happening on the current row, this freezes the current row.