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.EnabledRule
Nested classes/interfaces inherited from interface io.jmix.flowui.action.ViewOpeningAction
ViewOpeningAction.QueryParametersProvider, ViewOpeningAction.RouteParametersProvider
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected DialogWindows
static final String
protected Messages
protected MultiValueSelectView.MultiValueSelectContext<E>
protected boolean
protected UiComponentProperties
protected ActionViewInitializer
Fields inherited from class io.jmix.flowui.action.valuepicker.PickerAction
target
Fields inherited from class io.jmix.flowui.action.SecuredBaseAction
enabledByUiPermissions, enabledRules, visibleByUiPermissions
Fields inherited from class io.jmix.flowui.kit.action.BaseAction
enabledExplicitly, visibleExplicitly
Fields inherited from class io.jmix.flowui.kit.action.AbstractAction
description, enabled, eventBus, icon, id, shortcutCombination, text, variant, visible
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addValidator
(Validator<E> validator) void
void
execute()
Executes theAction
<V extends View<?>>
Consumer<DialogWindow.AfterCloseEvent<V>>com.vaadin.flow.component.ItemLabelGenerator<E>
com.vaadin.flow.data.provider.DataProvider<?,
?> getItems()
Class<?>
Returns the view open mode if it was set byViewOpeningAction.setOpenMode(OpenMode)
or in the view XML, otherwise returnsnull
.Returns the view class if it was set byViewOpeningAction.setViewClass(Class)
or in the view XML, otherwise returnsnull
.Returns the view id if it was set byViewOpeningAction.setViewId(String)
or in the view XML, otherwise returnsnull
.protected void
protected void
initMultiValuePickerComponentValueType
(EntityValueSource<?, ?> valueSource) boolean
boolean
<V extends View<?>>
voidsetAfterCloseHandler
(Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) Sets the handler to be invoked when the detail view closes.void
setDialogWindows
(DialogWindows dialogWindows) void
setEntityName
(String entityName) void
setEnumClass
(Class<? extends Enum<?>> enumClass) void
setItemLabelGenerator
(com.vaadin.flow.component.ItemLabelGenerator<E> itemLabelGenerator) void
setItems
(com.vaadin.flow.data.provider.DataProvider<?, ?> items) void
setJavaClass
(Class<?> javaClass) void
setLookupViewId
(String lookupViewId) protected void
setMessages
(Messages messages) void
setOpenMode
(OpenMode openMode) Sets the view open mode.void
Sets query parameters provider that returns query parameters that should be used in the URL.protected void
setReadOnly
(boolean readOnly) void
Sets route parameters provider that returns route parameters that should be used in the route template.void
setTimeZone
(TimeZone timeZone) protected void
setUiComponentProperties
(UiComponentProperties uiComponentProperties) void
setUseComboBox
(boolean useComboBox) void
setValidators
(List<Validator<E>> validators) void
setViewClass
(Class<? extends View> viewClass) Sets the view class.<V extends View<?>>
voidsetViewConfigurer
(Consumer<V> viewConfigurer) Sets the view configurer.void
Sets the view id.<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, withVisibleByUiPermissions
Methods inherited from class io.jmix.flowui.action.SecuredBaseAction
addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabledByUiPermissions, setVisibleByUiPermissions
Methods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, setEnabled, setEnabledInternal, setVisible, setVisibleInternal
Methods 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, setVariant
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.flowui.kit.action.Action
actionPerform, addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setText, setVariant, setVisible
Methods 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:
initAction
in classPickerAction<MultiValueSelectAction<E>,
PickerComponent<Collection<E>>, Collection<E>>
-
setUiComponentProperties
-
setMessages
-
setDialogWindows
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
isReadOnly
public boolean isReadOnly() -
setReadOnly
protected void setReadOnly(boolean readOnly) -
getOpenMode
Description copied from interface:ViewOpeningAction
Returns the view open mode if it was set byViewOpeningAction.setOpenMode(OpenMode)
or in the view XML, otherwise returnsnull
.- Specified by:
getOpenMode
in interfaceViewOpeningAction
-
setOpenMode
Description copied from interface:ViewOpeningAction
Sets the view open mode.- Specified by:
setOpenMode
in interfaceViewOpeningAction
- Parameters:
openMode
- the open mode to set
-
getViewId
Description copied from interface:ViewOpeningAction
Returns the view id if it was set byViewOpeningAction.setViewId(String)
or in the view XML, otherwise returnsnull
.- Specified by:
getViewId
in interfaceViewOpeningAction
-
setViewId
Description copied from interface:ViewOpeningAction
Sets the view id.- Specified by:
setViewId
in interfaceViewOpeningAction
- Parameters:
viewId
- the view id to set
-
getViewClass
Description copied from interface:ViewOpeningAction
Returns the view class if it was set byViewOpeningAction.setViewClass(Class)
or in the view XML, otherwise returnsnull
.- Specified by:
getViewClass
in interfaceViewOpeningAction
-
setViewClass
Description copied from interface:ViewOpeningAction
Sets the view class.- Specified by:
setViewClass
in interfaceViewOpeningAction
- Parameters:
viewClass
- the view class to set
-
getRouteParametersProvider
- Specified by:
getRouteParametersProvider
in interfaceViewOpeningAction
- Returns:
- route parameters or
null
if not set
-
setRouteParametersProvider
public void setRouteParametersProvider(@Nullable ViewOpeningAction.RouteParametersProvider provider) Description copied from interface:ViewOpeningAction
Sets 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:
setRouteParametersProvider
in interfaceViewOpeningAction
- Parameters:
provider
- route parameters provider to set- See Also:
-
Route
-
getQueryParametersProvider
- Specified by:
getQueryParametersProvider
in interfaceViewOpeningAction
- Returns:
- query parameters provider or
null
if not set
-
setQueryParametersProvider
public void setQueryParametersProvider(@Nullable ViewOpeningAction.QueryParametersProvider provider) Description copied from interface:ViewOpeningAction
Sets 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:
setQueryParametersProvider
in 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:ViewOpeningAction
Sets the handler to be invoked when the detail view closes.Note that handler is invoked if the detail is opened in
OpenMode.DIALOG
mode.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:
setAfterCloseHandler
in interfaceViewOpeningAction
- Type Parameters:
V
- view type- Parameters:
afterCloseHandler
- handler to set
-
getAfterCloseHandler
- Specified by:
getAfterCloseHandler
in interfaceViewOpeningAction
-
setViewConfigurer
Description copied from interface:ViewOpeningAction
Sets 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:
setViewConfigurer
in interfaceViewOpeningAction
-
getViewConfigurer
- Specified by:
getViewConfigurer
in interfaceViewOpeningAction
-
getLookupViewId
-
setLookupViewId
-
getEntityName
-
setEntityName
-
getJavaClass
-
setJavaClass
-
getEnumClass
-
setEnumClass
-
isUseComboBox
public boolean isUseComboBox() -
setUseComboBox
public void setUseComboBox(boolean useComboBox) -
getItems
@Nullable public com.vaadin.flow.data.provider.DataProvider<?,?> getItems() -
setItems
public void setItems(com.vaadin.flow.data.provider.DataProvider<?, ?> items) -
getTimeZone
-
setTimeZone
-
getItemLabelGenerator
-
setItemLabelGenerator
public void setItemLabelGenerator(@Nullable com.vaadin.flow.component.ItemLabelGenerator<E> itemLabelGenerator) -
getValidators
-
setValidators
-
addValidator
-
execute
public void execute()Description copied from interface:ExecutableAction
Executes theAction
- Specified by:
execute
in 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
-