Class MultiValueSelectAction<E>
java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
io.jmix.flowui.kit.action.BaseAction
io.jmix.flowui.action.SecuredBaseAction
io.jmix.flowui.action.valuepicker.PickerAction<MultiValueSelectAction<E>,PickerComponent<Collection<E>>,Collection<E>>
io.jmix.flowui.action.multivaluepicker.MultiValueSelectAction<E>
- All Implemented Interfaces:
ExecutableAction,SecuredAction,TargetAction<PickerComponent<Collection<E>>>,ViewOpeningAction,Action,HasShortcutCombination,org.springframework.beans.factory.InitializingBean
@ActionType("multi_value_select")
public class MultiValueSelectAction<E>
extends PickerAction<MultiValueSelectAction<E>,PickerComponent<Collection<E>>,Collection<E>>
implements org.springframework.beans.factory.InitializingBean, ViewOpeningAction
Standard multi value select action for selection the field value.
Should be defined for JmixMultiValuePicker or its subclass
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.action.SecuredBaseAction
SecuredBaseAction.EnabledRuleNested classes/interfaces inherited from interface io.jmix.flowui.action.ViewOpeningAction
ViewOpeningAction.QueryParametersProvider, ViewOpeningAction.RouteParametersProvider -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected DialogWindowsstatic final Stringprotected Messagesprotected MultiValueSelectView.MultiValueSelectContext<E>protected booleanprotected UiComponentPropertiesprotected ActionViewInitializerFields inherited from class io.jmix.flowui.action.valuepicker.PickerAction
targetFields inherited from class io.jmix.flowui.action.SecuredBaseAction
enabledByUiPermissions, enabledRules, visibleByUiPermissionsFields inherited from class io.jmix.flowui.kit.action.BaseAction
enabledExplicitly, visibleExplicitlyFields inherited from class io.jmix.flowui.kit.action.AbstractAction
description, enabled, eventBus, icon, id, shortcutCombination, text, variant, visibleFields inherited from interface io.jmix.flowui.kit.action.Action
PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT_COMBINATION, PROP_TEXT, PROP_VARIANT, PROP_VISIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValidator(Validator<E> validator) Adds a validator to @link MultiValueSelectContext}.voidvoidexecute()Executes theAction<V extends View<?>>
Consumer<DialogWindow.AfterCloseEvent<V>>Returns the name of the entity associated with this action.Returns the enumeration class associated with the currentMultiValueSelectView.MultiValueSelectContext.com.vaadin.flow.component.ItemLabelGenerator<E>Returns the currentItemLabelGeneratorassociated with the multi-value select context.com.vaadin.flow.data.provider.DataProvider<?,?> getItems()Returns the data provider associated with theMultiValueSelectView.MultiValueSelectContext.Class<?>Returns the Java class associated with the current instance ofMultiValueSelectView.MultiValueSelectContext.Returns the identifier for the lookup view.Returns the view open mode if it was set byViewOpeningAction.setOpenMode(OpenMode)or in the view XML, otherwise returnsnull.Returns the current time zone associated withMultiValueSelectView.MultiValueSelectContext.Returns the list of validators associated with theMultiValueSelectView.MultiValueSelectContext.Returns the class of the view to be opened.Returns the identifier of the view to be opened.protected voidprotected voidinitMultiValuePickerComponentValueType(EntityValueSource<?, ?> valueSource) booleanDetermines whether the current state ofMultiValueSelectView.MultiValueSelectContextpassed to the view opened by this action is read-only.booleanDetermines whether theMultiValueSelectView.MultiValueSelectContextis configured to use aComboBoxas its primary selection component.<V extends View<?>>
voidsetAfterCloseHandler(Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) Sets the handler to be invoked when the detail view closes.voidsetDialogWindows(DialogWindows dialogWindows) voidsetEntityName(String entityName) Sets the name of the entity associated with theMultiValueSelectView.MultiValueSelectContext.voidsetEnumClass(Class<? extends Enum<?>> enumClass) Sets the enumeration class associated with the currentMultiValueSelectView.MultiValueSelectContext.voidsetItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<E> itemLabelGenerator) Sets the item label generator for the component.voidsetItems(com.vaadin.flow.data.provider.DataProvider<?, ?> items) Sets the items to be used by theMultiValueSelectView.MultiValueSelectContext.voidsetJavaClass(Class<?> javaClass) Sets the Java class associated with the current instance ofMultiValueSelectView.MultiValueSelectContext.voidsetLookupViewId(String lookupViewId) Sets the identifier for the lookup view to be opened.protected voidsetMessages(Messages messages) voidsetOpenMode(OpenMode openMode) Sets the view open mode.voidSets query parameters provider that returns query parameters that should be used in the URL.protected voidsetReadOnly(boolean readOnly) Sets the read-only state ofMultiValueSelectView.MultiValueSelectContextpassed to the view opened by this action.voidSets route parameters provider that returns route parameters that should be used in the route template.voidsetTimeZone(TimeZone timeZone) Sets the time zone to be associated with the currentMultiValueSelectView.MultiValueSelectContext.protected voidsetUiComponentProperties(UiComponentProperties uiComponentProperties) voidsetUseComboBox(boolean useComboBox) Configures whether to use aComboBoxas the selection component in the associatedMultiValueSelectView.MultiValueSelectContext.voidsetValidators(List<Validator<E>> validators) Sets the list of validators forMultiValueSelectView.MultiValueSelectContext.voidsetViewClass(Class<? extends View> viewClass) Sets the class of the view to be opened by this action.<V extends View<?>>
voidsetViewConfigurer(Consumer<V> viewConfigurer) Sets the view configurer.voidSets the identifier for the view to be opened.<V extends View<?>>
MultiValueSelectAction<E>withAfterCloseHandler(Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) withEntityName(String entityName) withEnumClass(Class<? extends Enum<?>> enumClass) withItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<E> itemLabelGenerator) withItems(com.vaadin.flow.data.provider.DataProvider<?, ?> items) withJavaClass(Class<?> javaClass) withLookupViewId(String lookupViewId) withReadOnly(boolean readOnly) withTimeZone(TimeZone timeZone) withUseComboBox(boolean useComboBox) withValidators(List<Validator<E>> validators) withViewClass(Class<? extends View> viewClass) <V extends View<?>>
MultiValueSelectAction<E>withViewConfigurer(Consumer<V> viewConfigurer) withViewId(String viewId) Methods inherited from class io.jmix.flowui.action.valuepicker.PickerAction
actionPerform, checkTarget, getTarget, isApplicable, setTarget, withEnabled, withEnabledByUiPermissions, withHandler, withIcon, withIcon, withShortcutCombination, withTarget, withText, withTitle, withVariant, withVisible, withVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.action.SecuredBaseAction
addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabledByUiPermissions, setVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, setEnabled, setEnabledInternal, setVisible, setVisibleInternal, withDescriptionMethods inherited from class io.jmix.flowui.kit.action.AbstractAction
addPropertyChangeListener, firePropertyChange, getDescription, getEventBus, getIcon, getId, getShortcutCombination, getText, getVariant, hasListener, isEnabled, isVisible, setDescription, setIcon, setShortcutCombination, setText, setVariantMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.flowui.kit.action.Action
actionPerform, addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setText, setVariant, setVisibleMethods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombination
getShortcutCombination, setShortcutCombination
-
Field Details
-
ID
- See Also:
-
DEFAULT_MULTI_VALUE_SELECT_VIEW
- See Also:
-
messages
-
uiComponentProperties
-
dialogWindows
-
readOnly
protected boolean readOnly -
viewInitializer
-
multiValueSelectContext
-
-
Constructor Details
-
MultiValueSelectAction
public MultiValueSelectAction() -
MultiValueSelectAction
-
-
Method Details
-
initAction
protected void initAction()- Overrides:
initActionin classPickerAction<MultiValueSelectAction<E>,PickerComponent<Collection<E>>, Collection<E>>
-
setUiComponentProperties
-
setMessages
-
setDialogWindows
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
isReadOnly
public boolean isReadOnly()Determines whether the current state ofMultiValueSelectView.MultiValueSelectContextpassed to the view opened by this action is read-only.- Returns:
trueif the action is in a read-only state,falseotherwise
-
setReadOnly
protected void setReadOnly(boolean readOnly) Sets the read-only state ofMultiValueSelectView.MultiValueSelectContextpassed to the view opened by this action.- Parameters:
readOnly- a boolean value indicating the desired read-only state.
-
getOpenMode
Description copied from interface:ViewOpeningActionReturns the view open mode if it was set byViewOpeningAction.setOpenMode(OpenMode)or in the view XML, otherwise returnsnull.- Specified by:
getOpenModein interfaceViewOpeningAction
-
setOpenMode
Description copied from interface:ViewOpeningActionSets the view open mode.- Specified by:
setOpenModein interfaceViewOpeningAction- Parameters:
openMode- the open mode to set
-
getViewId
Returns the identifier of the view to be opened. If the view identifier is not explicitly set via the view initializer, a default identifier is returned.- Specified by:
getViewIdin interfaceViewOpeningAction- Returns:
- the view identifier, or a default identifier if no specific identifier is set.
-
setViewId
Sets the identifier for the view to be opened.- Specified by:
setViewIdin interfaceViewOpeningAction- Parameters:
viewId- the unique identifier of the view
-
getViewClass
Returns the class of the view to be opened.- Specified by:
getViewClassin interfaceViewOpeningAction- Returns:
- the class of the view if defined, or
nullif no class is set.
-
setViewClass
Sets the class of the view to be opened by this action.- Specified by:
setViewClassin interfaceViewOpeningAction- Parameters:
viewClass- the class of the view to be opened; can benullif no specific class is set
-
getRouteParametersProvider
- Specified by:
getRouteParametersProviderin interfaceViewOpeningAction- Returns:
- route parameters or
nullif not set
-
setRouteParametersProvider
public void setRouteParametersProvider(@Nullable ViewOpeningAction.RouteParametersProvider provider) Description copied from interface:ViewOpeningActionSets route parameters provider that returns route parameters that should be used in the route template.Note that route parameters provider is set if the detail is opened in
OpenMode.NAVIGATION.- Specified by:
setRouteParametersProviderin interfaceViewOpeningAction- Parameters:
provider- route parameters provider to set- See Also:
-
Route
-
getQueryParametersProvider
- Specified by:
getQueryParametersProviderin interfaceViewOpeningAction- Returns:
- query parameters provider or
nullif not set
-
setQueryParametersProvider
public void setQueryParametersProvider(@Nullable ViewOpeningAction.QueryParametersProvider provider) Description copied from interface:ViewOpeningActionSets query parameters provider that returns query parameters that should be used in the URL.Note that query parameters provider is set if the detail is opened in
OpenMode.NAVIGATION.- Specified by:
setQueryParametersProviderin interfaceViewOpeningAction- Parameters:
provider- query parameters provider to set
-
setAfterCloseHandler
public <V extends View<?>> void setAfterCloseHandler(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) Description copied from interface:ViewOpeningActionSets the handler to be invoked when the detail view closes.Note that handler is invoked if the detail is opened in
OpenMode.DIALOGmode.The preferred way to set the handler is using a controller method annotated with
Install, e.g.:@Install(to = "petsTable.view", subject = "afterCloseHandler") protected void petsTableViewAfterCloseHandler(AfterCloseEvent event) { if (event.closedWith(StandardOutcome.SAVE)) { System.out.println("Saved"); } }- Specified by:
setAfterCloseHandlerin interfaceViewOpeningAction- Type Parameters:
V- view type- Parameters:
afterCloseHandler- handler to set
-
getAfterCloseHandler
- Specified by:
getAfterCloseHandlerin interfaceViewOpeningAction
-
setViewConfigurer
Description copied from interface:ViewOpeningActionSets the view configurer. Use the configurer if you need to provide parameters to the opened view through setters.The preferred way to set the configurer is using a controller method annotated with
Install, e.g.:@Install(to = "petsTable.view", subject = "viewConfigurer") protected void petsTableViewConfigurer(View<?> view) { view.setSomeParameter(someValue); }- Specified by:
setViewConfigurerin interfaceViewOpeningAction
-
getViewConfigurer
- Specified by:
getViewConfigurerin interfaceViewOpeningAction
-
getLookupViewId
Returns the identifier for the lookup view. This identifier is obtained from theMultiValueSelectView.MultiValueSelectContextassociated with this action. May returnnullif no lookup view identifier is set.- Returns:
- the lookup view identifier, or
nullif not set
-
setLookupViewId
Sets the identifier for the lookup view to be opened. The identifier is passed to theMultiValueSelectView.MultiValueSelectContextassociated with this action.- Parameters:
lookupViewId- the unique identifier of the lookup view; can benullif no specific lookup view is set
-
getEntityName
Returns the name of the entity associated with this action.- Returns:
- the entity name as a
String, ornullif no entity name is set.
-
setEntityName
Sets the name of the entity associated with theMultiValueSelectView.MultiValueSelectContext. This name is used to identify and configure the entity for the current action.- Parameters:
entityName- the name of the entity as aString; may benullif no specific entity is being set
-
getJavaClass
Returns the Java class associated with the current instance ofMultiValueSelectView.MultiValueSelectContext. This is used for defining the type of data handled by the component.- Returns:
- the Java class if it is defined, or
nullif no class is set
-
setJavaClass
Sets the Java class associated with the current instance ofMultiValueSelectView.MultiValueSelectContext. This is used for defining the type of data handled by the component.- Parameters:
javaClass- the Java class to be associated with the current context; may benullif no specific class is set
-
getEnumClass
Returns the enumeration class associated with the currentMultiValueSelectView.MultiValueSelectContext. This class defines the type of enums that can be selected or processed by the component.- Returns:
- the class of the enumeration if defined, or
nullif no enumeration class is set
-
setEnumClass
Sets the enumeration class associated with the currentMultiValueSelectView.MultiValueSelectContext. This class specifies the type of enumeration usable within the multi-value select action.- Parameters:
enumClass- the class of the enumeration to be set; it may benullif no specific enumeration class is desired
-
isUseComboBox
public boolean isUseComboBox()Determines whether theMultiValueSelectView.MultiValueSelectContextis configured to use aComboBoxas its primary selection component.- Returns:
trueif aComboBoxis used for selection,falseotherwise
-
setUseComboBox
public void setUseComboBox(boolean useComboBox) Configures whether to use aComboBoxas the selection component in the associatedMultiValueSelectView.MultiValueSelectContext.- Parameters:
useComboBox- a boolean indicating whether aComboBoxshould be used for selection (true) or another component (false)
-
getItems
@Nullable public com.vaadin.flow.data.provider.DataProvider<?,?> getItems()Returns the data provider associated with theMultiValueSelectView.MultiValueSelectContext.- Returns:
- the data provider instance if available; otherwise, null
-
setItems
public void setItems(com.vaadin.flow.data.provider.DataProvider<?, ?> items) Sets the items to be used by theMultiValueSelectView.MultiValueSelectContext.- Parameters:
items- the data provider supplying the items to be set
-
getTimeZone
Returns the current time zone associated withMultiValueSelectView.MultiValueSelectContext.- Returns:
- the
TimeZoneobject if defined, ornullif no time zone is set
-
setTimeZone
Sets the time zone to be associated with the currentMultiValueSelectView.MultiValueSelectContext.- Parameters:
timeZone- theTimeZoneobject to be set; may benullif no specific time zone is to be associated
-
getItemLabelGenerator
Returns the currentItemLabelGeneratorassociated with the multi-value select context. TheItemLabelGeneratoris used to generate display labels for items in the component.- Returns:
- the
ItemLabelGeneratorinstance if set, ornullif no generator is defined
-
setItemLabelGenerator
public void setItemLabelGenerator(@Nullable com.vaadin.flow.component.ItemLabelGenerator<E> itemLabelGenerator) Sets the item label generator for the component. The item label generator is used to define how the items are represented as strings in the user interface.- Parameters:
itemLabelGenerator- the item label generator to set, ornullto unset and use the default item label generator
-
getValidators
Returns the list of validators associated with theMultiValueSelectView.MultiValueSelectContext.- Returns:
- a list of Validator objects used for validation
-
setValidators
Sets the list of validators forMultiValueSelectView.MultiValueSelectContext.- Parameters:
validators- the list of validators to be set. Can be null to indicate no validators.
-
addValidator
Adds a validator to @link MultiValueSelectContext}.- Parameters:
validator- the validator to be added for validating the values
-
execute
public void execute()Description copied from interface:ExecutableActionExecutes theAction- Specified by:
executein interfaceExecutableAction
-
withViewId
-
withViewClass
-
withAfterCloseHandler
public <V extends View<?>> MultiValueSelectAction<E> withAfterCloseHandler(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) -
withViewConfigurer
public <V extends View<?>> MultiValueSelectAction<E> withViewConfigurer(@Nullable Consumer<V> viewConfigurer) - See Also:
-
withValidators
-
withEntityName
-
withEnumClass
-
withJavaClass
-
withReadOnly
-
withLookupViewId
-
withUseComboBox
-
withItems
-
withItemLabelGenerator
public MultiValueSelectAction<E> withItemLabelGenerator(@Nullable com.vaadin.flow.component.ItemLabelGenerator<E> itemLabelGenerator) -
withTimeZone
-
initMultiValuePickerComponentValueType
-