|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.infordata.ifw2.web.jpa.AJpaEditableFolderModel<C>
C - public abstract class AJpaEditableFolderModel<C>
An adapter combining the IPojoEditableGridModel interface with an
AJpaFolderModel instance.
| Constructor Summary | |
|---|---|
AJpaEditableFolderModel(AJpaFolderModel<C> model,
IPojoForm<C> form)
|
|
| 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()
|
void |
close()
|
int |
containsSearch(java.lang.String columnName,
java.lang.String value,
boolean forward,
int startFrom)
|
AJpaFolderModel.Builder<C> |
createSyncTask()
|
IPojoForm<C> |
edit()
Edit the current row. |
void |
expandAllChilds(int rowIndex)
|
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. |
void |
forceReload(boolean restoreCurrentRow)
Forces the model to reload data from the external storage at next IGridModel.sync(). |
IJpaColumn |
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()
|
AJpaFolderModel.ATreeNode<C> |
getCurrentTreeNode()
|
int |
getDataVersion()
|
java.util.List<C> |
getDataView()
Depending on the implementation, the returned collection may or may not contain the inserting pending pojo and may or may not contain a clone of the edited object instead of the original one. |
javax.persistence.EntityManager |
getEntityManager()
|
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()
|
AJpaFolderModel.ATreeNode<C> |
getTreeNode(int rowIndex)
|
boolean |
getUseBackgroudSyncIfNeeded()
|
java.lang.Object |
getValue(C pojo,
int columnIndex)
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
|
AJpaFolderModel.ATreeNode<C> |
getZoomedNode()
|
int |
getZoomingLevel()
|
boolean |
goTo(C pojo,
boolean fetchAllFakeNodesChilds)
See AJpaFolderModel.goTo(Object, boolean) |
IPojoForm<C> |
insert(java.lang.Object param,
boolean asChild)
|
boolean |
isCurrentRowEditable()
|
boolean |
isCurrentRowFreezed()
|
boolean |
isEditing(C pojo)
|
boolean |
isEditPending()
|
boolean |
isFilterable()
|
boolean |
isInsertAllowed(java.lang.Object param,
boolean asChild)
|
boolean |
isInserting(C pojo)
|
boolean |
isInsertPending()
|
boolean |
isSortable()
|
boolean |
post()
Use data in IEditableGridModel.getForm() to update the model after an IEditableGridModel.edit() or
IEditableGridModel.insert(Object, boolean) call. |
boolean |
reload(int rowIndex)
Reloads the row from the external storage. |
boolean |
remove()
|
IForm |
replaceInsertedPojo(C newPojo)
|
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 |
setExpanded(int rowIndex,
boolean expanded)
Expands or collapses a node. |
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 |
setUseBackgroudSyncIfNeeded(boolean value)
see AJpaFolderModel.setUseBackgroudSyncIfNeeded(boolean) |
void |
sync()
Keeps the internal IForm and the internal IGridModel in sync. |
void |
zoomIn()
The current node becomes the new root. |
void |
zoomOut(int levels)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AJpaEditableFolderModel(AJpaFolderModel<C> model,
IPojoForm<C> form)
| Method Detail |
|---|
public void forceReload(boolean restoreCurrentRow)
IReloadableGridModelIGridModel.sync().
forceReload in interface IReloadableGridModelrestoreCurrentRow - - If true the model shall try to restore the old current row.IGridModel.sync() the current-row at the moment of the first call must be used.
public boolean reload(int rowIndex)
throws OutOfBoundsException
IReloadableGridModel
reload in interface IReloadableGridModelOutOfBoundsException
public boolean goTo(C pojo,
boolean fetchAllFakeNodesChilds)
AJpaFolderModel.goTo(Object, boolean)
goTo in interface IJpaFolderModel<C>pojo - - uses #getPathTo(EntityManager, Object) to
build a path to the pojo.IGridModel.sync().fetchAllFakeNodesChilds - - true if childs of fake nodes in the path are
all fetched, this ensures that the rest of entities in the path are founded.
public void close()
public void cancel()
IEditableGridModel
cancel in interface IEditableGridModelpublic IPojoForm<C> 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 IPojoForm<C> insert(java.lang.Object param,
boolean asChild)
insert in interface IEditableGridModelasChild - - true means insert a child, false means insert a sibling.param - - a generic parameter, the model can use to determine the
type of row to insert.
IForm, it must be the same returned by IEditableGridModel.getForm()
at least until a IEditableGridModel.cancel()public IForm replaceInsertedPojo(C newPojo)
replaceInsertedPojo in interface IPojoEditableGridModel<C>pojo - - replaces the inserted pojo, the form is refreshed.
public 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 canRemoveCurrentRow()
canRemoveCurrentRow in interface IEditableGridModelpublic boolean isCurrentRowEditable()
isCurrentRowEditable in interface IEditableGridModel
public boolean isInsertAllowed(java.lang.Object param,
boolean asChild)
isInsertAllowed in interface IEditableGridModelasChild - - true to insert a child, false to insert a sibling of the current node
ITreeNode.isLeaf().public boolean post()
IEditableGridModelIEditableGridModel.getForm() to update the model after an IEditableGridModel.edit() or
IEditableGridModel.insert(Object, boolean) call.
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 IJpaColumn getColumn(int columnIndex)
getColumn in interface IGridModelgetColumn in interface IJpaGridModel<C>public 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 final int getCurrentRow()
getCurrentRow in interface IGridModelpublic final int getCurrentRowCount()
getCurrentRowCount in interface IGridModelIGridModel.getRowCount() but can be less if the model supports paging.public final int getRowCount()
getRowCount in interface IGridModelInteger.MAX_VALUE.
public final java.lang.Object getValueAt(int rowIndex,
int columnIndex)
getValueAt in interface IGridModelpublic C getPojo(int rowIndex)
getPojo in interface IPojoGridModel<C>
public AJpaFolderModel.ATreeNode<C> getTreeNode(int rowIndex)
throws OutOfBoundsException
getTreeNode in interface ITreeGridModelgetTreeNode in interface IJpaFolderModel<C>rowIndex -
OutOfBoundsException - - The contract defined in getValueAt(int, int) must be
respected.public AJpaFolderModel.ATreeNode<C> getCurrentTreeNode()
getCurrentTreeNode in interface ITreeGridModelgetCurrentTreeNode in interface IJpaFolderModel<C>
public void setExpanded(int rowIndex,
boolean expanded)
setExpanded in interface ITreeGridModelrowIndex - expanded - - true to expandpublic void expandAllChilds(int rowIndex)
expandAllChilds in interface IJpaFolderModel<C>rowIndex - -1 means all childs of all nodes.public void zoomIn()
IJpaFolderModel
zoomIn in interface IJpaFolderModel<C>public void zoomOut(int levels)
zoomOut in interface IJpaFolderModel<C>levels - - the number of parents to climb up.public final AJpaFolderModel.ATreeNode<C> getZoomedNode()
getZoomedNode in interface IJpaFolderModel<C>public final int getZoomingLevel()
getZoomingLevel in interface IJpaFolderModel<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 java.lang.String getPropertyName(int columnIndex)
getPropertyName in interface IPojoGridModel<C>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> getDataView()
IPojoEditableGridModel
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 final void setUseBackgroudSyncIfNeeded(boolean value)
AJpaFolderModel.setUseBackgroudSyncIfNeeded(boolean)
setUseBackgroudSyncIfNeeded in interface IJpaFolderModel<C>value - public final boolean getUseBackgroudSyncIfNeeded()
getUseBackgroudSyncIfNeeded in interface IJpaFolderModel<C>public final AJpaFolderModel.Builder<C> createSyncTask()
createSyncTask in interface IJpaFolderModel<C>AJpaFolderModel.createSyncTask().
public void sync()
throws OutOfBoundsException
IForm and the internal IGridModel in sync.
sync in interface IGridModelOutOfBoundsExceptionpublic final int getDataVersion()
getDataVersion in interface IPojoGridModel<C>IGridModel.sync().public final java.lang.Class<C> getPojoType()
getPojoType in interface IPojoGridModel<C>public final javax.persistence.EntityManager getEntityManager()
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 IDataGridModelpublic 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 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 boolean isFilterable()
isFilterable in interface IDataGridModelpublic 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 int searchOnSortedColumn(java.lang.Object value)
IDataGridModel
searchOnSortedColumn in interface IDataGridModelCollections.binarySearch(java.util.List, Object).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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||