public interface EntityComboBoxModel extends FilteredComboBoxModel<Entity>, EntityDataProvider
Entity
instances.Modifier and Type | Method and Description |
---|---|
void |
addRefreshListener(EventListener listener) |
EntityComboBoxModel |
createForeignKeyFilterComboBoxModel(java.lang.String foreignKeyPropertyId)
Returns a combo box model for selecting a foreign key value for filtering this model
|
void |
forceRefresh()
Forces a refresh of this model, disregarding the staticData directive
|
Entity |
getEntity(Entity.Key primaryKey) |
FilterCondition<Entity> |
getForeignKeyFilterCondition()
Use this method to retrieve the default foreign key filter condition model if you
want to add a custom
FilterCondition to this model via FilteredModel.setFilterCondition(FilterCondition) . |
java.util.Collection<Entity> |
getForeignKeyFilterEntities(java.lang.String foreignKeyPropertyId) |
Condition.Provider |
getSelectConditionProvider() |
boolean |
isStaticData() |
boolean |
isStrictForeignKeyFiltering() |
void |
linkForeignKeyComboBoxModel(java.lang.String foreignKeyPropertyId,
EntityComboBoxModel foreignKeyModel)
Links the given combo box model representing master entities to this combo box model
so that selection in the master model filters this model according to the selected master entity
|
void |
removeRefreshListener(EventListener listener) |
void |
setForeignKeyFilterEntities(java.lang.String foreignKeyPropertyId,
java.util.Collection<Entity> entities)
Filters this combo box model so that only entities referencing the given foreign key entities
via the given foreign key property are shown.
|
void |
setSelectConditionProvider(Condition.Provider selectConditionProvider)
Sets the condition provider to use when querying data
|
void |
setSelectedEntityByKey(Entity.Key primaryKey)
Selects the entity with the given primary key, if the entity is not available
in the model this method returns silently without changing the selection
|
EntityComboBoxModel |
setStaticData(boolean staticData)
Specifies whether or not this models data should be considered static, that is, only fetched once.
|
void |
setStrictForeignKeyFiltering(boolean strictForeignKeyFiltering)
Specifies whether foreign key filtering should be strict or not.
|
addItem, addSelectionListener, getElementAt, getNullValue, getSelectedItem, getSelectedValue, getSize, getSortComparator, isCleared, isFilterSelectedItem, isNullValueSelected, isSelectionEmpty, removeItem, removeSelectionListener, setContents, setFilterSelectedItem, setNullValue, setSelectedItem, setSortComparator
addFilteringListener, contains, filterContents, getAllItems, getFilterCondition, getFilteredItemCount, getFilteredItems, getVisibleItemCount, getVisibleItems, isFiltered, isVisible, removeFilteringListener, setFilterCondition
clear, refresh
getConnectionProvider, getEntityId
Entity getEntity(Entity.Key primaryKey)
primaryKey
- the primary key of the entity to fetch from this modelFilterCondition<Entity> getForeignKeyFilterCondition()
FilterCondition
to this model via FilteredModel.setFilterCondition(FilterCondition)
.
FilterCondition fkCondition = model.getForeignKeyFilterCondition(); model.setFilterCondition(new FilterCondition() { public boolean include(Entity item) { return fkCondition.include(item) && ...; } });
FilterCondition
based on the foreign key filter entitiessetForeignKeyFilterEntities(String, Collection)
java.util.Collection<Entity> getForeignKeyFilterEntities(java.lang.String foreignKeyPropertyId)
foreignKeyPropertyId
- the ID of the foreign key propertyvoid setForeignKeyFilterEntities(java.lang.String foreignKeyPropertyId, java.util.Collection<Entity> entities)
foreignKeyPropertyId
- the property IDentities
- the entitiesvoid setStrictForeignKeyFiltering(boolean strictForeignKeyFiltering)
strictForeignKeyFiltering
- the valuesetForeignKeyFilterEntities(String, Collection)
boolean isStrictForeignKeyFiltering()
EntityComboBoxModel createForeignKeyFilterComboBoxModel(java.lang.String foreignKeyPropertyId)
foreignKeyPropertyId
- the ID of the property with which values to create the combo box modellinkForeignKeyComboBoxModel(String, EntityComboBoxModel)
void linkForeignKeyComboBoxModel(java.lang.String foreignKeyPropertyId, EntityComboBoxModel foreignKeyModel)
foreignKeyPropertyId
- the ID of the foreign key propertyforeignKeyModel
- the combo box model to linkvoid setSelectedEntityByKey(Entity.Key primaryKey)
primaryKey
- the primary key of the entity to selectvoid forceRefresh()
setStaticData(boolean)
EntityComboBoxModel setStaticData(boolean staticData)
forceRefresh()
disregards this directive.staticData
- the valueboolean isStaticData()
forceRefresh()
void setSelectConditionProvider(Condition.Provider selectConditionProvider)
selectConditionProvider
- the condition providerCondition.Provider getSelectConditionProvider()
void addRefreshListener(EventListener listener)
listener
- a listener to be notified each time this model is refreshedvoid removeRefreshListener(EventListener listener)
listener
- the listener to remove