org.jminor.framework.client.model
Interface EntityLookupModel

All Superinterfaces:
EntityDataProvider
All Known Implementing Classes:
DefaultEntityLookupModel

public interface EntityLookupModel
extends EntityDataProvider

A interface responsible for doing entity lookups based on a set of criteria properties.


Method Summary
 void addSearchStringListener(ActionListener listener)
           
 void addSelectedEntitiesListener(ActionListener listener)
           
 String getDescription()
           
 List<Property.ColumnProperty> getLookupProperties()
           
 String getMultipleValueSeparator()
           
 String getSearchString()
           
 List<Entity> getSelectedEntities()
           
 String getWildcard()
           
 boolean isCaseSensitive()
           
 boolean isMultipleSelectionAllowed()
           
 boolean isWildcardPostfix()
           
 boolean isWildcardPrefix()
           
 List<Entity> performQuery()
          Performs a query based on the select criteria
 void refreshSearchText()
          Refreshes the search text so that is represents the selected entities
 void removeSearchStringListener(ActionListener listener)
           
 void removeSelectedEntitiesListener(ActionListener listener)
           
 EventObserver searchStringObserver()
           
 boolean searchStringRepresentsSelected()
           
 EntityLookupModel setAdditionalLookupCriteria(Criteria additionalLookupCriteria)
          Sets the additional lookup criteria to use when performing the lookup.
 EntityLookupModel setCaseSensitive(boolean caseSensitive)
          Specifies whether or not this lookup model should be case sensitive
 void setDescription(String description)
           
 void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
          Specifies whether or not this lookup model should allow selection of multiple entities
 EntityLookupModel setMultipleValueSeparator(String multipleValueSeparator)
          Sets the string to use to separate multiple values when shown as a string
 void setSearchString(String searchString)
          Sets the search string to use when performing the next lookup
 void setSelectedEntities(List<Entity> entities)
          Sets the selected entities
 void setSelectedEntity(Entity entity)
          Sets the given entity as the selected entity
 EntityLookupModel setWildcard(String wildcard)
          Sets the wildcard to use
 EntityLookupModel setWildcardPostfix(boolean wildcardPostfix)
          Specifies whether or not to automatically append a wildcard to the search string
 EntityLookupModel setWildcardPrefix(boolean wildcardPrefix)
          Specifies whether or not to automatically prefix the search string with a wildcard
 
Methods inherited from interface org.jminor.framework.client.model.EntityDataProvider
getConnectionProvider, getEntityID
 

Method Detail

getSelectedEntities

List<Entity> getSelectedEntities()
Returns:
an unmodifiable view of the selected entities

setSelectedEntity

void setSelectedEntity(Entity entity)
Sets the given entity as the selected entity

Parameters:
entity - the entity to set as the selected entity

setSelectedEntities

void setSelectedEntities(List<Entity> entities)
Sets the selected entities

Parameters:
entities - the entities to set as selected
Throws:
IllegalArgumentException - if this lookup model does not allow multiple selections and entities.size() > 1

getDescription

String getDescription()
Returns:
a string describing this lookup model, by default a comma separated list of search property names

setDescription

void setDescription(String description)
Parameters:
description - a string describing this lookup model

getLookupProperties

List<Property.ColumnProperty> getLookupProperties()
Returns:
a list containing the properties used when performing a lookup

isMultipleSelectionAllowed

boolean isMultipleSelectionAllowed()
Returns:
true if this lookup model allows selection of multiple entities

setMultipleSelectionAllowed

void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
Specifies whether or not this lookup model should allow selection of multiple entities

Parameters:
multipleSelectionAllowed - if true then selection of multiple entities is allowed

refreshSearchText

void refreshSearchText()
Refreshes the search text so that is represents the selected entities


setSearchString

void setSearchString(String searchString)
Sets the search string to use when performing the next lookup

Parameters:
searchString - the search string

getSearchString

String getSearchString()
Returns:
the current search string value

setWildcard

EntityLookupModel setWildcard(String wildcard)
Sets the wildcard to use

Parameters:
wildcard - the wildcard
Returns:
this EntityLookupModel instance

getWildcard

String getWildcard()
Returns:
the wildcard being used by this model

searchStringRepresentsSelected

boolean searchStringRepresentsSelected()
Returns:
true if the current search string represents the selected entities

performQuery

List<Entity> performQuery()
Performs a query based on the select criteria

Returns:
a list containing the entities fulfilling the current criteria

isCaseSensitive

boolean isCaseSensitive()
Returns:
true if this lookup model is case sensitive

setCaseSensitive

EntityLookupModel setCaseSensitive(boolean caseSensitive)
Specifies whether or not this lookup model should be case sensitive

Parameters:
caseSensitive - if true then this lookup model is case sensitive
Returns:
this EntityLookupModel instance

isWildcardPrefix

boolean isWildcardPrefix()
Returns:
whether or not to automatically prefix the the search string with a wildcard

setWildcardPrefix

EntityLookupModel setWildcardPrefix(boolean wildcardPrefix)
Specifies whether or not to automatically prefix the search string with a wildcard

Parameters:
wildcardPrefix - if true then a wildcard is automatically prefixed to the search string
Returns:
this EntityLookupModel instance

isWildcardPostfix

boolean isWildcardPostfix()
Returns:
whether or not to automatically append a wildcard to the search string

setWildcardPostfix

EntityLookupModel setWildcardPostfix(boolean wildcardPostfix)
Specifies whether or not to automatically append a wildcard to the search string

Parameters:
wildcardPostfix - if true then a wildcard is automatically appended to the search string
Returns:
this EntityLookupModel instance

setMultipleValueSeparator

EntityLookupModel setMultipleValueSeparator(String multipleValueSeparator)
Sets the string to use to separate multiple values when shown as a string

Parameters:
multipleValueSeparator - the separator string
Returns:
this EntityLookupModel instance

getMultipleValueSeparator

String getMultipleValueSeparator()
Returns:
the string used to separate multiple values when shown as a string

setAdditionalLookupCriteria

EntityLookupModel setAdditionalLookupCriteria(Criteria additionalLookupCriteria)
Sets the additional lookup criteria to use when performing the lookup. This criteria is AND'ed to the actual lookup criteria.

Parameters:
additionalLookupCriteria - the additional lookup criteria
Returns:
this EntityLookupModel instance

addSelectedEntitiesListener

void addSelectedEntitiesListener(ActionListener listener)
Parameters:
listener - a listener to be notified each time the selected entities are changed

removeSelectedEntitiesListener

void removeSelectedEntitiesListener(ActionListener listener)
Parameters:
listener - the listener to remove

searchStringObserver

EventObserver searchStringObserver()
Returns:
an Event fired each time the search string changes

addSearchStringListener

void addSearchStringListener(ActionListener listener)
Parameters:
listener - a listener to be notified each time the search string changes

removeSearchStringListener

void removeSearchStringListener(ActionListener listener)
Parameters:
listener - the listener to remove