Package is.codion.swing.framework.model
Class SwingForeignKeyConditionModel
java.lang.Object
is.codion.swing.framework.model.SwingForeignKeyConditionModel
- All Implemented Interfaces:
ColumnConditionModel<Attribute<?>,
Entity>
public final class SwingForeignKeyConditionModel
extends Object
implements ColumnConditionModel<Attribute<?>,Entity>
A condition model using a
EntityComboBoxModel
for the equalValue()
and a EntitySearchModel
for the inValues()
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.common.model.table.ColumnConditionModel
ColumnConditionModel.AutomaticWildcard, ColumnConditionModel.Factory<C>
-
Field Summary
Fields inherited from interface is.codion.common.model.table.ColumnConditionModel
AUTOMATIC_WILDCARD, CASE_SENSITIVE
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(Comparable<Entity> columnValue) Returns true if the given value is accepted by this models condition.Note that this is only applicable to string based condition models and only used for operatorsOperator.EQUAL
andOperator.NOT_EQUAL
builder
(ForeignKey foreignKey) void
clear()
Clears this condition model, that is, sets all bounds to null and the operator to the first of the ones available.Attribute<?>
enabled()
format()
inValues()
locked()
operator()
void
setEqualValue
(Entity value) Sets the values used when theOperator.EQUAL
is enabled.void
setInValues
(Collection<Entity> values) void
setLowerBound
(Entity value) void
setUpperBound
(Entity upper) char
wildcard()
-
Method Details
-
equalComboBoxModel
- Returns:
- the combo box model controlling the equal value
- Throws:
IllegalStateException
- in case no such model is available
-
inSearchModel
- Returns:
- the search model controlling the in values
- Throws:
IllegalStateException
- in case no such model is available
-
columnIdentifier
- Specified by:
columnIdentifier
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the column identifier
-
caseSensitive
- Specified by:
caseSensitive
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the State controlling whether this model is case-sensitive, when working with strings
-
format
- Specified by:
format
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the Format object to use when formatting input, an empty Optional in case none is available
-
dateTimePattern
- Specified by:
dateTimePattern
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the date/time format pattern, if any
-
automaticWildcard
Description copied from interface:ColumnConditionModel
Note that this is only applicable to string based condition models and only used for operatorsOperator.EQUAL
andOperator.NOT_EQUAL
- Specified by:
automaticWildcard
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the Value controlling whether automatic wildcards are enabled when working with strings
-
autoEnable
- Specified by:
autoEnable
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the
State
controlling whether this model is enabled automatically when a condition value is specified
-
locked
- Specified by:
locked
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the state controlling the locked status
-
columnClass
- Specified by:
columnClass
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the column class this condition model is based on
-
setEqualValue
Description copied from interface:ColumnConditionModel
Sets the values used when theOperator.EQUAL
is enabled.- Specified by:
setEqualValue
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Parameters:
value
- the value to use as condition
-
getEqualValue
- Specified by:
getEqualValue
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the equal value, possibly null
-
setInValues
- Specified by:
setInValues
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Parameters:
values
- the values to set, an empty Collection for none
-
getInValues
- Specified by:
getInValues
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the in values, never null
-
setUpperBound
- Specified by:
setUpperBound
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Parameters:
upper
- the new upper bound
-
getUpperBound
- Specified by:
getUpperBound
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the upper bound
-
setLowerBound
- Specified by:
setLowerBound
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Parameters:
value
- the lower bound
-
getLowerBound
- Specified by:
getLowerBound
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the lower bound
-
operators
- Specified by:
operators
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the operators available in this condition model
-
wildcard
public char wildcard()- Specified by:
wildcard
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- the character used as a wildcard when working with strings
-
enabled
- Specified by:
enabled
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- a state controlling the enabled status
-
clear
public void clear()Description copied from interface:ColumnConditionModel
Clears this condition model, that is, sets all bounds to null and the operator to the first of the ones available.- Specified by:
clear
in interfaceColumnConditionModel<Attribute<?>,
Entity> - See Also:
-
equalValue
- Specified by:
equalValue
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- a Value based on the equal value of this condition model
-
inValues
- Specified by:
inValues
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- a ValueSet based on the in values of this condition model
-
upperBoundValue
- Specified by:
upperBoundValue
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- a Value based on the upper bound value of this condition model
-
lowerBoundValue
- Specified by:
lowerBoundValue
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- a Value based on the lower bound value of this condition model
-
operator
- Specified by:
operator
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- a Value based on the operator
-
accepts
Description copied from interface:ColumnConditionModel
Returns true if the given value is accepted by this models condition.- Specified by:
accepts
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Parameters:
columnValue
- the column value- Returns:
- true if the given value is accepted by this models condition
-
conditionChangedEvent
- Specified by:
conditionChangedEvent
in interfaceColumnConditionModel<Attribute<?>,
Entity> - Returns:
- an observer notified each time the condition state changes
-
builder
- Parameters:
foreignKey
- the foreign key- Returns:
- a new
SwingForeignKeyConditionModel.Builder
-