Class MultiValueSelectView.MultiValueSelectContext<E>
java.lang.Object
io.jmix.flowui.component.ComponentGenerationContext
io.jmix.flowui.app.multivaluepicker.MultiValueSelectView.MultiValueSelectContext<E>
- Type Parameters:
E
- the type of elements to be included in the multi-value select component
- Enclosing interface:
- MultiValueSelectView<E>
public static class MultiValueSelectView.MultiValueSelectContext<E>
extends ComponentGenerationContext
Context class providing parameters required for generating multi-value select components.
Extends
ComponentGenerationContext
to include additional features specific
to multi-value selection scenarios.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected Consumer<ActionPerformedEvent>
protected Collection<E>
protected com.vaadin.flow.component.ItemLabelGenerator<E>
protected Class<?>
protected String
protected boolean
protected TimeZone
protected boolean
Fields inherited from class io.jmix.flowui.component.ComponentGenerationContext
collectionItems, enumItems, items, metaClass, property, targetClass, valueSource, xmlDescriptor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addValidator
(Validator<E> validator) Adds a validator to the list of validators.Returns the handler that adds items to the layout.Returns the handler that adds values internally.Returns the entity name used in this context.Returns the handler for entity picker action performed events.Returns the enum class used in this context.Returns an unmodifiable collection of initial values.com.vaadin.flow.component.ItemLabelGenerator<E>
Returns the item label generator used for generating labels.Class<?>
Returns the value type class used in this context.Returns the lookup view identifier.Returns the time zone used in this context.Returns an unmodifiable list of validators.Returns the handler that checks if a value exists.boolean
Returns whether this context is read-only.boolean
Returns whether to use combo box for selection.void
setAddItemToLayoutHandler
(Consumer<E> addItemToLayoutHandler) Sets the handler that adds items to the layout.void
setAddValueInternalHandler
(Consumer<com.vaadin.flow.component.HasValue<?, E>> addValueInternalHandler) Sets the handler that adds values internally.void
setEntityName
(String entityName) Sets the entity name for this context.void
setEntityPickerActionPerformedEventHandler
(Consumer<ActionPerformedEvent> entityPickerActionPerformedEventHandler) Sets the handler for entity picker action performed events.void
setEnumClass
(Class<? extends Enum<?>> enumClass) Sets the enum class for this context.void
setInitialValues
(Collection<E> initialValues) Sets the initial values for this context.void
setItemLabelGenerator
(com.vaadin.flow.component.ItemLabelGenerator<E> itemLabelGenerator) Sets the item label generator for this context.void
setJavaClass
(Class<?> javaClass) Sets the value type class for this context.void
setLookupViewId
(String lookupViewId) Sets the lookup view identifier.void
setReadOnly
(boolean readOnly) Sets the read-only state of this context.void
setTimeZone
(TimeZone timeZone) Sets the time zone for this context.void
setUseComboBox
(boolean useComboBox) Sets whether to use combo box for selection.void
setValidators
(List<Validator<E>> validators) Sets the list of validators for this context.void
setValueExistsHandler
(Predicate<E> valueExistsHandler) Sets the handler that checks if a value exists.Methods inherited from class io.jmix.flowui.component.ComponentGenerationContext
getCollectionItems, getEnumItems, getItems, getMetaClass, getProperty, getTargetClass, getValueSource, getXmlDescriptor, setCollectionItems, setEnumItems, setItems, setTargetClass, setValueSource, setXmlDescriptor
-
Field Details
-
entityName
-
enumClass
-
javaClass
-
readOnly
protected boolean readOnly -
initialValues
-
lookupViewId
-
useComboBox
protected boolean useComboBox -
valueExistsHandler
-
addItemToLayoutHandler
-
entityPickerActionPerformedEventHandler
-
addValueInternalHandler
-
itemLabelGenerator
-
validators
-
timeZone
-
-
Constructor Details
-
MultiValueSelectContext
public MultiValueSelectContext()
-
-
Method Details
-
getEntityName
Returns the entity name used in this context.- Returns:
- the entity name or null if not set
-
setEntityName
Sets the entity name for this context.- Parameters:
entityName
- the entity name to set
-
getEnumClass
Returns the enum class used in this context.- Returns:
- the enum class or null if not set
-
setEnumClass
Sets the enum class for this context.- Parameters:
enumClass
- the enum class to set
-
getJavaClass
Returns the value type class used in this context.- Returns:
- the class or
null
if not set
-
setJavaClass
Sets the value type class for this context.- Parameters:
javaClass
- the class to set
-
isReadOnly
public boolean isReadOnly()Returns whether this context is read-only.- Returns:
- true if the context is read-only, false otherwise
-
setReadOnly
public void setReadOnly(boolean readOnly) Sets the read-only state of this context.- Parameters:
readOnly
- true to make the context read-only, false otherwise
-
getInitialValues
Returns an unmodifiable collection of initial values.- Returns:
- unmodifiable collection of initial values or empty list if no values are set
-
setInitialValues
Sets the initial values for this context.- Parameters:
initialValues
- the collection of initial values to set
-
getLookupViewId
Returns the lookup view identifier.- Returns:
- the lookup view identifier
-
setLookupViewId
Sets the lookup view identifier.- Parameters:
lookupViewId
- the lookup view identifier to set
-
isUseComboBox
public boolean isUseComboBox()Returns whether to use combo box for selection.- Returns:
- true if combo box should be used, false otherwise
-
setUseComboBox
public void setUseComboBox(boolean useComboBox) Sets whether to use combo box for selection.- Parameters:
useComboBox
- true to use combo box, false otherwise
-
getItemLabelGenerator
Returns the item label generator used for generating labels.- Returns:
- the item label generator or null if not set
-
setItemLabelGenerator
public void setItemLabelGenerator(@Nullable com.vaadin.flow.component.ItemLabelGenerator<E> itemLabelGenerator) Sets the item label generator for this context.- Parameters:
itemLabelGenerator
- the item label generator to set
-
getValidators
Returns an unmodifiable list of validators.- Returns:
- unmodifiable list of validators or empty list if no validators are set
-
setValidators
Sets the list of validators for this context.- Parameters:
validators
- the list of validators to set
-
addValidator
Adds a validator to the list of validators.- Parameters:
validator
- the validator to add
-
getTimeZone
Returns the time zone used in this context.- Returns:
- the time zone or null if not set
-
setTimeZone
Sets the time zone for this context.- Parameters:
timeZone
- the time zone to set
-
getValueExistsHandler
Returns the handler that checks if a value exists.- Returns:
- the value exists handler
-
setValueExistsHandler
Sets the handler that checks if a value exists.- Parameters:
valueExistsHandler
- the value exists handler to set
-
getAddItemToLayoutHandler
Returns the handler that adds items to the layout.- Returns:
- the add item to layout handler
-
setAddItemToLayoutHandler
Sets the handler that adds items to the layout.- Parameters:
addItemToLayoutHandler
- the add item to layout handler to set
-
getEntityPickerActionPerformedEventHandler
Returns the handler for entity picker action performed events.- Returns:
- the entity picker action performed event handler
-
setEntityPickerActionPerformedEventHandler
public void setEntityPickerActionPerformedEventHandler(Consumer<ActionPerformedEvent> entityPickerActionPerformedEventHandler) Sets the handler for entity picker action performed events.- Parameters:
entityPickerActionPerformedEventHandler
- the entity picker action performed event handler to set
-
getAddValueInternalHandler
Returns the handler that adds values internally.- Returns:
- the add value internal handler
-
setAddValueInternalHandler
public void setAddValueInternalHandler(Consumer<com.vaadin.flow.component.HasValue<?, E>> addValueInternalHandler) Sets the handler that adds values internally.- Parameters:
addValueInternalHandler
- the add value internal handler to set
-