|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.infordata.ifw2.web.grds.APojoEditableDataGridModel<C>
C - public abstract class APojoEditableDataGridModel<C>
An adapter combining the IEditableGridModel interface with an
PojoGridModel instance.
| Constructor Summary | |
|---|---|
APojoEditableDataGridModel(PojoDataGridModel<C> model,
IPojoForm<C> form)
|
|
APojoEditableDataGridModel(PojoDataGridModel<C> model,
IPojoForm<C> form,
java.util.Comparator<? super C> univocityComparator)
|
|
| Method Summary | |
|---|---|
void |
applyFilters(java.lang.String filteredColumnName,
java.util.Map<java.lang.String,AFilterDefinition<?>> filters)
If IDataGridModel.isFilterable() then this method can be used to change
data filter definitions, otherwise you can assume that it is never used. |
void |
cancel()
Cancel any pending or insert operations, if there are none, nothing happens. |
boolean |
canDoContainsSearch()
|
boolean |
canRemoveCurrentRow()
|
boolean |
canSearchOnSortedColumn()
|
int |
containsSearch(java.lang.String columnName,
java.lang.String value,
boolean forward,
int startFrom)
|
IForm |
edit()
Edit the current row. |
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)
|
C |
getCurrentPojo()
|
int |
getCurrentRow()
|
int |
getCurrentRowCount()
|
java.util.List<C> |
getData()
Any modification maded to the returned collection is reflected into the model. |
int |
getDataVersion()
|
java.util.List<C> |
getDataView()
If an insert or edit operation is pending, the pojo is not contained in the returned collection. |
java.util.Map<java.lang.String,AFilterDefinition<?>> |
getFilters()
|
IPojoForm<C> |
getForm()
|
C |
getPojo(int rowIndex)
|
java.lang.Class<C> |
getPojoType()
|
java.lang.String |
getPropertyName(int columnIndex)
|
int |
getRowCount()
|
java.lang.Boolean |
getSortedAscendingIndicator()
|
java.lang.String |
getSortedColumn()
|
java.lang.Object |
getValue(C pojo,
int columnIndex)
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
|
IForm |
insert(java.lang.Object param,
boolean afterCurrentRow)
|
boolean |
isCurrentRowEditable()
|
boolean |
isCurrentRowFreezed()
|
boolean |
isEditing(C pojo)
|
boolean |
isEditPending()
|
boolean |
isFilterable()
|
boolean |
isInsertAllowed(java.lang.Object param,
boolean afterCurrentRow)
|
boolean |
isInserting(C pojo)
|
boolean |
isInsertPending()
|
boolean |
isSortable()
|
boolean |
post()
If in edit mode, the current record instance is replaced. |
boolean |
remove()
|
IForm |
replaceInsertedPojo(C pojo)
|
int |
rowIndexOf(C pojo)
|
int |
searchOnSortedColumn(java.lang.Object value)
Searches the given value between values of the currently sorted column. |
void |
setCurrentRow(int rowIndex)
|
void |
setSortedColumn(java.lang.String columnName,
boolean ascending)
If IDataGridModel.isSortable() then this method is used to change the sort order
otherwise you can assume that it is never used. |
void |
sync()
Keeps the internal IForm and the internal IGridModel in sync. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public APojoEditableDataGridModel(PojoDataGridModel<C> model,
IPojoForm<C> form,
java.util.Comparator<? super C> univocityComparator)
model - form - univocityComparator - - if specified, when an insert or a change is confirmed,
any pojo matching the new or changed pojo is removed.
public APojoEditableDataGridModel(PojoDataGridModel<C> model,
IPojoForm<C> form)
| Method Detail |
|---|
public boolean canRemoveCurrentRow()
canRemoveCurrentRow in interface IEditableGridModelpublic void cancel()
IEditableGridModel
cancel in interface IEditableGridModelpublic IForm edit()
IEditableGridModel
edit in interface IEditableGridModelIForm, it must be the same returned by IEditableGridModel.getForm()
at least until a IEditableGridModel.cancel()public final IPojoForm<C> getForm()
getForm in interface IEditableGridModelIForm usable to edit current row values.IForm must be returned.
public IForm insert(java.lang.Object param,
boolean afterCurrentRow)
insert in interface IEditableGridModelparam - - a generic parameter, the model can use to determine the
type of row to insert.afterCurrentRow - - false: the object is inserted in place of the current row,
true: it is inserted after the current row.
IForm, it must be the same returned by IEditableGridModel.getForm()
at least until a IEditableGridModel.cancel()public IForm replaceInsertedPojo(C pojo)
replaceInsertedPojo in interface IPojoEditableGridModel<C>pojo - - replaces the inserted pojo, the form is refreshed.
public boolean isCurrentRowEditable()
isCurrentRowEditable in interface IEditableGridModelpublic final boolean isInsertPending()
isInsertPending in interface IEditableGridModelIEditableGridModel.cancel()
to abort the operation.public final boolean isEditPending()
isEditPending in interface IEditableGridModelIEditableGridModel.cancel()
to abort the operation.
public boolean isInsertAllowed(java.lang.Object param,
boolean afterCurrentRow)
isInsertAllowed in interface IEditableGridModelpublic boolean post()
post in interface IEditableGridModelIForm instance and
the model doesn't exit from the pending insert or edit state.
It is possible for the model to open a message dialog in case of errors
(see FlowContext.modalDialog(net.infordata.ifw2.web.ctrl.IFlowAsDialog, net.infordata.ifw2.web.ctrl.IDialogCallback)).public boolean remove()
remove in interface IEditableGridModelFlowContext.modalDialog(net.infordata.ifw2.web.ctrl.IFlowAsDialog, net.infordata.ifw2.web.ctrl.IDialogCallback)).
public int fetchRows(int rowIndex,
int count)
IGridModel
fetchRows in interface IGridModelrowIndex - - starting from this index ...count - - ... we want this number of rows
IGridModel.getRowCount() must return the
real rows counter and a call to IGridModel.getCurrentRow() a valid
row index.public IColumnGroup getColumnGroup(java.lang.String groupId)
getColumnGroup in interface IGridModelpublic IColumn getColumn(int columnIndex)
getColumn in interface IGridModelpublic int getColumnCount()
getColumnCount in interface IGridModelpublic int getColumnIndex(java.lang.String columnName)
getColumnIndex in interface IGridModelpublic java.lang.String getColumnName(int columnIndex)
getColumnName in interface IGridModelpublic int getCurrentRow()
getCurrentRow in interface IGridModelpublic int getCurrentRowCount()
getCurrentRowCount in interface IGridModelIGridModel.getRowCount() but can be less if the model supports paging.public int getRowCount()
getRowCount in interface IGridModelInteger.MAX_VALUE.
public java.lang.Object getValueAt(int rowIndex,
int columnIndex)
getValueAt in interface IGridModelpublic final java.lang.String getPropertyName(int columnIndex)
getPropertyName in interface IPojoGridModel<C>public C getPojo(int rowIndex)
getPojo in interface IPojoGridModel<C>public int rowIndexOf(C pojo)
rowIndexOf in interface IPojoGridModel<C>
public final java.lang.Object getValue(C pojo,
int columnIndex)
getValue in interface IPojoGridModel<C>pojo - - the pojo to extract value from.columnIndex - - the columnIndex which must be mapped to a pojo property
or to a computed value.
public final C getCurrentPojo()
getCurrentPojo in interface IPojoGridModel<C>public boolean isCurrentRowFreezed()
isCurrentRowFreezed in interface IGridModelpublic void setCurrentRow(int rowIndex)
setCurrentRow in interface IGridModelpublic final java.util.List<C> getData()
java.lang.IllegalStateException - if an edit or insert operation is pending.public final java.util.List<C> getDataView()
getDataView in interface IPojoEditableGridModel<C>getDataView in interface IPojoGridModel<C>public final boolean isEditing(C pojo)
isEditing in interface IPojoEditableGridModel<C>public final boolean isInserting(C pojo)
isInserting in interface IPojoEditableGridModel<C>public void sync()
IForm and the internal IGridModel in sync.
sync in interface IGridModelpublic final int getDataVersion()
getDataVersion in interface IPojoGridModel<C>IGridModel.sync().public java.lang.Class<C> getPojoType()
getPojoType in interface IPojoGridModel<C>public boolean isSortable()
isSortable in interface IDataGridModel
public void setSortedColumn(java.lang.String columnName,
boolean ascending)
IDataGridModelIDataGridModel.isSortable() then this method is used to change the sort order
otherwise you can assume that it is never used.
setSortedColumn in interface IDataGridModelpublic java.lang.String getSortedColumn()
getSortedColumn in interface IDataGridModelIDataGridModel.isSortable() == false, because the model can be
sorted but not sortable (ie the sort order is not changeable with the gui).public java.lang.Boolean getSortedAscendingIndicator()
getSortedAscendingIndicator in interface IDataGridModelIDataGridModel.isSortable() == false, because the model can be
sorted but not sortable (ie the sort order is not changeable with the ui).
public int searchOnSortedColumn(java.lang.Object value)
throws java.lang.IllegalStateException
IDataGridModel
searchOnSortedColumn in interface IDataGridModelCollections.binarySearch(java.util.List, Object).
java.lang.IllegalStateException - - if there isn't a sorted column.public boolean canSearchOnSortedColumn()
canSearchOnSortedColumn in interface IDataGridModelIDataGridModel.searchOnSortedColumn(Object) can used.
public int containsSearch(java.lang.String columnName,
java.lang.String value,
boolean forward,
int startFrom)
containsSearch in interface IDataGridModelpublic boolean canDoContainsSearch()
canDoContainsSearch in interface IDataGridModel#containsSearch(int, String, boolean, int) can be used.public boolean isFilterable()
isFilterable in interface IDataGridModel
public void applyFilters(java.lang.String filteredColumnName,
java.util.Map<java.lang.String,AFilterDefinition<?>> filters)
IDataGridModelIDataGridModel.isFilterable() then this method can be used to change
data filter definitions, otherwise you can assume that it is never used.
applyFilters in interface IDataGridModelfilteredColumnName - - used in case a the filter has been applied on a
specific column, otherwise null.filters - - filters to be applied per columnpublic java.util.Map<java.lang.String,AFilterDefinition<?>> getFilters()
getFilters in interface IDataGridModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||