public class DefaultEntityLookupModel extends java.lang.Object implements EntityLookupModel
EntityLookupModel.LookupSettings
Constructor and Description |
---|
DefaultEntityLookupModel(java.lang.String entityId,
EntityConnectionProvider connectionProvider)
Instantiates a new EntityLookupModel, using the search properties for the given entity type
|
DefaultEntityLookupModel(java.lang.String entityId,
EntityConnectionProvider connectionProvider,
java.util.Collection<ColumnProperty> lookupProperties)
Instantiates a new EntityLookupModel
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectedEntitiesListener(EventDataListener<java.util.Collection<Entity>> listener) |
EntityConnectionProvider |
getConnectionProvider() |
java.lang.String |
getDescription() |
java.lang.String |
getEntityId() |
java.util.Collection<ColumnProperty> |
getLookupProperties() |
Value<java.lang.String> |
getMultipleItemSeparatorValue() |
Value<java.lang.Boolean> |
getMultipleSelectionAllowedValue() |
java.util.Map<ColumnProperty,EntityLookupModel.LookupSettings> |
getPropertyLookupSettings() |
java.lang.String |
getSearchString() |
StateObserver |
getSearchStringRepresentsSelectedObserver() |
Value<java.lang.String> |
getSearchStringValue() |
java.util.Collection<Entity> |
getSelectedEntities() |
Entity.ToString |
getToStringProvider() |
java.lang.String |
getWildcard() |
java.util.List<Entity> |
performQuery()
Performs a query based on the select condition
|
void |
refreshSearchText()
Refreshes the search text so that is represents the selected entities
|
boolean |
searchStringRepresentsSelected() |
EntityLookupModel |
setAdditionalConditionProvider(Condition.Provider additionalConditionProvider)
Sets the additional lookup condition provider to use when performing the next lookup.
|
void |
setDescription(java.lang.String description) |
void |
setResultSorter(java.util.Comparator<Entity> resultSorter) |
void |
setSearchString(java.lang.String searchString)
Sets the search string to use when performing the next lookup
|
void |
setSelectedEntities(java.util.Collection<Entity> entities)
Sets the selected entities
|
void |
setSelectedEntity(Entity entity)
Sets the given entity as the selected entity
|
EntityLookupModel |
setToStringProvider(Entity.ToString toStringProvider)
Override the default toString() for lookup elements when displayed
in a field based on this model
|
EntityLookupModel |
setWildcard(java.lang.String wildcard)
Sets the wildcard to use
|
public DefaultEntityLookupModel(java.lang.String entityId, EntityConnectionProvider connectionProvider)
entityId
- the ID of the entity to lookupconnectionProvider
- the EntityConnectionProvider to use when performing the lookupEntity.Definition#getSearchProperties()
public DefaultEntityLookupModel(java.lang.String entityId, EntityConnectionProvider connectionProvider, java.util.Collection<ColumnProperty> lookupProperties)
entityId
- the ID of the entity to lookupconnectionProvider
- the EntityConnectionProvider to use when performing the lookuplookupProperties
- the properties to search by, these must be string basedpublic final java.lang.String getEntityId()
getEntityId
in interface EntityDataProvider
public final EntityConnectionProvider getConnectionProvider()
getConnectionProvider
in interface EntityDataProvider
public final java.util.Collection<ColumnProperty> getLookupProperties()
getLookupProperties
in interface EntityLookupModel
public final void setResultSorter(java.util.Comparator<Entity> resultSorter)
setResultSorter
in interface EntityLookupModel
resultSorter
- the comparator used to sort the lookup result, null if the result should not be sortedpublic final java.lang.String getDescription()
getDescription
in interface EntityLookupModel
public final void setDescription(java.lang.String description)
setDescription
in interface EntityLookupModel
description
- a string describing this lookup modelpublic final void setSelectedEntity(Entity entity)
setSelectedEntity
in interface EntityLookupModel
entity
- the entity to set as the selected entitypublic final void setSelectedEntities(java.util.Collection<Entity> entities)
setSelectedEntities
in interface EntityLookupModel
entities
- the entities to set as selectedpublic final java.util.Collection<Entity> getSelectedEntities()
getSelectedEntities
in interface EntityLookupModel
public final java.util.Map<ColumnProperty,EntityLookupModel.LookupSettings> getPropertyLookupSettings()
getPropertyLookupSettings
in interface EntityLookupModel
public final java.lang.String getWildcard()
getWildcard
in interface EntityLookupModel
public final EntityLookupModel setWildcard(java.lang.String wildcard)
setWildcard
in interface EntityLookupModel
wildcard
- the wildcardpublic final EntityLookupModel setAdditionalConditionProvider(Condition.Provider additionalConditionProvider)
setAdditionalConditionProvider
in interface EntityLookupModel
additionalConditionProvider
- the additional lookup condition providerpublic final Entity.ToString getToStringProvider()
getToStringProvider
in interface EntityLookupModel
public final EntityLookupModel setToStringProvider(Entity.ToString toStringProvider)
setToStringProvider
in interface EntityLookupModel
toStringProvider
- provides string representationspublic final void refreshSearchText()
refreshSearchText
in interface EntityLookupModel
public final void setSearchString(java.lang.String searchString)
setSearchString
in interface EntityLookupModel
searchString
- the search stringpublic final java.lang.String getSearchString()
getSearchString
in interface EntityLookupModel
public final boolean searchStringRepresentsSelected()
searchStringRepresentsSelected
in interface EntityLookupModel
public final java.util.List<Entity> performQuery()
performQuery
in interface EntityLookupModel
public final Value<java.lang.String> getSearchStringValue()
getSearchStringValue
in interface EntityLookupModel
public final Value<java.lang.String> getMultipleItemSeparatorValue()
getMultipleItemSeparatorValue
in interface EntityLookupModel
public final Value<java.lang.Boolean> getMultipleSelectionAllowedValue()
getMultipleSelectionAllowedValue
in interface EntityLookupModel
public final void addSelectedEntitiesListener(EventDataListener<java.util.Collection<Entity>> listener)
addSelectedEntitiesListener
in interface EntityLookupModel
listener
- a listener to be notified each time the selected entities are changedpublic final StateObserver getSearchStringRepresentsSelectedObserver()
getSearchStringRepresentsSelectedObserver
in interface EntityLookupModel