public class EntityList<E extends Entity,I extends InteractionFragment & EntityList.EntityListItem<E>> extends InteractionFragment
Modifier and Type | Class and Description |
---|---|
static interface |
EntityList.EntityListItem<E extends Entity>
The interface that needs to be implemented by item fragments in an
EntityList . |
static interface |
EntityList.EntitySelectionListener<E extends Entity>
A listener interface that will be notified of entity selection.
|
MESSAGE_BOX_ERROR_ICON, MESSAGE_BOX_INFO_ICON, MESSAGE_BOX_QUESTION_ICON, MESSAGE_BOX_WARNING_ICON
MSG_PARAM_NOT_SET
Constructor and Description |
---|
EntityList(java.lang.Class<E> rEntityType,
java.lang.Class<I> rItemType)
Creates a new instance without criteria that doesn't perform an initial
query.
|
EntityList(java.lang.Class<E> rEntityType,
java.lang.Class<I> rItemType,
de.esoco.lib.expression.Predicate<? super E> pDefaultCriteria,
de.esoco.storage.StoragePredicates.SortPredicate<? super E> pSortColumn,
boolean bInitialQuery)
Creates a new instance that displays entities that fulfill the given
criteria (if not NULL).
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(EntityList.EntitySelectionListener<E> rListener)
Register an entity selection listener.
|
void |
clear()
Clears this list by removing all entities and updating the display.
|
protected I |
createListItem()
Creates a new instance of the list item type.
|
de.esoco.lib.expression.Predicate<? super E> |
getDefaultCriteria()
Returns the current default criteria of this instance.
|
java.lang.Class<E> |
getEntityType()
Returns the type of the entities displayed in this list.
|
de.esoco.lib.expression.Predicate<? super E> |
getExtraCriteria()
Returns the current extra criteria of this instance.
|
java.lang.String |
getGlobalFilter()
Returns the global filter string.
|
java.util.List<I> |
getItems()
Returns the list of items for this entity list.
|
de.esoco.lib.property.ListLayoutStyle |
getListLayoutStyle()
Returns the list layout style.
|
int |
getPageSize()
Returns the current number of entities that are displayed in a list page.
|
E |
getSelectedEntity()
Returns the currently selected entity.
|
I |
getSelectedItem()
Returns the currently selected item.
|
de.esoco.storage.StoragePredicates.SortPredicate<? super E> |
getSortColumn()
Returns the sort predicate for the current sort column.
|
void |
init()
Must be implemented to initialize the interaction parameters of this
fragment.
|
void |
initComplete()
This method will be invoked after the initialization of a fragment and
it's hierarchy of sub-fragments has been completed.
|
protected void |
initHeaderPanel(InteractionFragment rHeaderPanel)
Initializes the header panel of this list if a header has been set with
setListHeader(EntityListHeader) . |
void |
removeSelectionListener(EntityList.EntitySelectionListener<?> rListener)
Removes an entity selection listener.
|
void |
setDefaultCriteria(de.esoco.lib.expression.Predicate<? super E> pDefaultCriteria)
Sets the default criteria for this instance.
|
void |
setExtraCriteria(de.esoco.lib.expression.Predicate<? super E> pCriteria)
Sets a filter predicate for this list.
|
void |
setGlobalFilter(java.lang.String sFilter)
Sets a global filter string for this list.
|
void |
setGlobalFilterAttributes(org.obrel.core.RelationType<java.lang.String>... rFilterAttributes)
Sets the attributes to be considered by the global filter.
|
void |
setListHeader(EntityListHeader<E> rHeader)
Sets the header for to be displayed at the top of the list.
|
void |
setListLayoutStyle(de.esoco.lib.property.ListLayoutStyle eListLayoutStyle)
Sets the list layout style.
|
void |
setPageSize(int rPageSize)
Sets the number of entities to be displayed in a list page.
|
void |
setSelection(EntityList.EntityListItem<?> rItem)
Sets the currently selected list item.
|
void |
setSortColumn(de.esoco.storage.StoragePredicates.SortPredicate<? super E> pSortColumn)
Sets the sort predicate for the column to sort by.
|
void |
update()
Updates this list to display the entities for the current criteria.
|
abort, abortFragment, addDisplayParameters, addInputParameters, addInputParameters, addPanelParameters, addParameterUpdateListener, addSubFragment, addSubFragment, addSubFragment, addSubFragment, addViewFragment, afterInteraction, applyAllCoupledParameters, attach, button, buttons, buttons, canRollback, chart, checkBox, checkBox, checkBoxes, cleanup, clearInteractionParameters, clearSelection, comboBox, dateParam, deleteRelation, display, dropDown, dropDown, enableEdit, entityParam, entityParam, enumParam, executeCleanupActions, finish, finishFragment, flagParam, fragmentParam, get, getFragmentParameter, getInputParameters, getInteractionParameters, getParameterInteractionHandler, getParameterValidations, getParent, getProcess, getProcessStep, getRelation, getRelations, getRoot, getTemporaryParameterId, getValueDatatype, handleInteraction, hasInteraction, icon, iconButtons, iconButtons, image, imageButtons, initProcessStep, initQueryParameter, input, input, input, inputAttr, inputAttr, inputDate, inputTags, inputText, inputTextLines, insertInputParameters, insertInputParameters, intParam, isAttached, isInitialized, label, label, layout, listParam, lockEntityForProcess, lockEntityForStep, markFragmentInputParams, markInputParams, markParameterHierarchyAsModified, notifyParameterUpdateListeners, panel, panel, panel, panel, panel, panel, param, param, param, paramLike, prepareInteraction, prepareUpload, prepareUpload, radioButtons, reloadEntity, removeInteractionParameters, removeSubFragment, removeViewFragment, rollback, set, setContinueOnInteraction, setParam, setParameterInteractionHandler, setParameterValuesFromEntity, setParameterValuesFromEntity, setParent, setup, showConfirmationMessage, showDialog, showDialog, showDialog, showErrorMessage, showInfoMessage, showMessageBox, showMessageBox, showModalDialog, showView, showWarningMessage, structureModified, textParam, title, updateAllCoupledParameters, updateEntityFromParameterValues, updateUserInterface, validateFragmentParameters, validateParameters, validationError
addCleanupAction, addLayoutFiller, addPanel, addPanel, addProcessStepMessage, addSelectionDependency, addSelectionDependency, addStackPanel, addTabPanel, annotateForEntityQuery, annotateForEntityQuery, annotateParameter, applyDerivedParameter, applyDerivedParameters, applyExtraAttribute, changeDate, checkParameter, clearUIFlag, clearUIFlag, collectDerivedParameter, collectDerivedParameters, deleteParameters, disableElements, disableElements, disableElements, disableMultiSelectionElements, displayHistoryValue, enableAllElements, getAbsoluteFilePath, getAllowedElements, getAllowedValues, getCurrentQuery, getDerivedParameterValue, getFragmentId, getInputMode, getInteractiveInputParameter, getNamedTmpListType, getNamedTmpParameterType, getParameter, getParameterAnnotation, getParameterRelation, getProcessUser, getSelectionIndex, getSubFragment, getSubFragments, getTemporaryListType, getTemporaryListType, getTemporaryParameterName, getTemporaryParameterPackage, getTemporaryParameterType, getTemporaryParameterType, getTemporaryParameterType, getTemporarySetType, getUIProperties, getUIProperties, getUIProperty, getUserSetting, getUserSettings, hasFlagParameter, hasParameter, hasUIFlag, hasUserSetting, initChartParameter, initCountChartParameter, initProgressParameter, isInteractiveInput, isPanelParameter, lockEntity, markParameterAsModified, performParameterValidations, prepareDateInput, prepareDownload, prepareDownload, removeAllSubFragments, removeAllUIProperties, removeAllUIProperties, removeCleanupAction, removePanel, removeParameterAnnotation, removeSubFragment, removeTemporaryParameterType, removeUIProperties, setAllowedElements, setAllowedValues, setAllowedValues, setDatePeriod, setEnabled, setEnabled, setHtmlSize, setImmediateAction, setImmediateAction, setImmediateAction, setInteractive, setInteractive, setInteractive, setInteractive, setInteractive, setLayout, setParameter, setParameter, setParameterBounds, setProcessStepInfo, setProcessStepMessage, setProgressIndicator, setSelectionDependency, setSelectionDependency, setUIFlag, setUIFlag, setUIProperty, setUIProperty, setUIProperty, setUIProperty, setVisible, setVisible, spawnProcess, storeEntity, throwMissingParameterException, unlockEntity
addDisplayParameters, continueOnInteraction, hasInteractionParameter, markInputParams, params, removeAllParameterValidations, removeInteractionParameters, removeParameterValidations, removeParameterValidations, setMandatory, setParameterNotEmptyValidations, setParameterNotEmptyValidations, setParameterNotNullValidations, setParameterNotNullValidations, setParameterValidation, setParameterValidation, staticParams
notifyRelationListeners, readRelations, relationsEqual, relationsHashCode, relationsString, set, toString, transform, writeRelations
public EntityList(java.lang.Class<E> rEntityType, java.lang.Class<I> rItemType)
setDefaultCriteria(Predicate)
or update()
to perform the first query.rEntityType
- The entity type to be displayed in this listrItemType
- The type of the list itemspublic EntityList(java.lang.Class<E> rEntityType, java.lang.Class<I> rItemType, de.esoco.lib.expression.Predicate<? super E> pDefaultCriteria, de.esoco.storage.StoragePredicates.SortPredicate<? super E> pSortColumn, boolean bInitialQuery)
update()
.rEntityType
- The entity type to be displayed in this listrItemType
- The type of the list itemspDefaultCriteria
- The optional default criteria or NULL to query
all entitiespSortColumn
- The sort predicate for the initial sort column or
NULL for nonebInitialQuery
- TRUE if a initial query should be performed
automaticallypublic void addSelectionListener(EntityList.EntitySelectionListener<E> rListener)
rListener
- The listener to registerpublic void clear()
public final de.esoco.lib.expression.Predicate<? super E> getDefaultCriteria()
public final java.lang.Class<E> getEntityType()
public final de.esoco.lib.expression.Predicate<? super E> getExtraCriteria()
public final java.lang.String getGlobalFilter()
public final java.util.List<I> getItems()
public final de.esoco.lib.property.ListLayoutStyle getListLayoutStyle()
public final int getPageSize()
public final E getSelectedEntity()
public final I getSelectedItem()
public final de.esoco.storage.StoragePredicates.SortPredicate<? super E> getSortColumn()
public void init()
init
in interface de.esoco.lib.manage.Initializable
init
in class InteractionFragment
public void initComplete() throws java.lang.Exception
InteractionFragment.initComplete()
method hasn't been invoked
yet.
The purpose of this method is for subclasses to execute code that depends on a full initialization. The default implementation does nothing.
initComplete
in class InteractionFragment
java.lang.Exception
- If the post-initialization code failspublic void removeSelectionListener(EntityList.EntitySelectionListener<?> rListener)
rListener
- The listener to removepublic void setDefaultCriteria(de.esoco.lib.expression.Predicate<? super E> pDefaultCriteria)
pDefaultCriteria
- The new default criteriade.esoco.storage.StorageException
- If updating the list failspublic void setExtraCriteria(de.esoco.lib.expression.Predicate<? super E> pCriteria)
setGlobalFilter(String)
.pCriteria
- sThe filter predicate or NULL to resetpublic void setGlobalFilter(java.lang.String sFilter)
setGlobalFilterAttributes(RelationType...)
.sFilter
- The filter string or NULL or empty for no filter@SafeVarargs public final void setGlobalFilterAttributes(org.obrel.core.RelationType<java.lang.String>... rFilterAttributes)
rFilterAttributes
- The new filter attributespublic void setListHeader(EntityListHeader<E> rHeader)
rHeader
- The new list headerpublic final void setListLayoutStyle(de.esoco.lib.property.ListLayoutStyle eListLayoutStyle)
eListLayoutStyle
- The stylepublic final void setPageSize(int rPageSize)
rPageSize
- The new page sizepublic void setSelection(EntityList.EntityListItem<?> rItem)
rItem
- The new selectionpublic final void setSortColumn(de.esoco.storage.StoragePredicates.SortPredicate<? super E> pSortColumn)
pSortColumn
- The sort predicate or NULL for nonepublic void update() throws de.esoco.storage.StorageException
de.esoco.storage.StorageException
- If performing the query failsprotected I createListItem()
protected void initHeaderPanel(InteractionFragment rHeaderPanel)
setListHeader(EntityListHeader)
.rHeaderPanel
- The header panel fragment