Package io.jmix.ui.action.valuespicker
Class ValuesSelectAction<V>
java.lang.Object
io.jmix.ui.action.AbstractAction
io.jmix.ui.action.BaseAction
io.jmix.ui.action.valuespicker.ValuesSelectAction<V>
- All Implemented Interfaces:
Action
,Action.ExecutableAction
,Action.HasPrimaryState
,Action.SecuredAction
,ValuePicker.ValuePickerAction
,org.springframework.beans.factory.InitializingBean
@StudioAction(target="io.jmix.ui.component.ValuesPicker",
description="Sets a value to the values picker using the selection screen")
@ActionType("values_select")
public class ValuesSelectAction<V>
extends BaseAction
implements ValuePicker.ValuePickerAction, org.springframework.beans.factory.InitializingBean, Action.ExecutableAction
Standard values picker action for selection the field value.
Should be defined for ValuesPicker
or its subclass in a screen XML descriptor.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.action.BaseAction
BaseAction.EnabledRule
Nested classes/interfaces inherited from interface io.jmix.ui.action.Action
Action.ActionPerformedEvent, Action.AdjustWhenScreenReadOnly, Action.ExecutableAction, Action.HasPrimaryState, Action.HasSecurityConstraint, Action.HasTarget, Action.MainTabSheetAction, Action.ScreenOpeningAction, Action.SecuredAction, Action.Status
-
Field Summary
Modifier and TypeFieldDescriptionprotected UiComponentProperties
static final String
protected boolean
protected Icons
static final String
protected Messages
protected ScreenBuilders
protected ActionScreenInitializer
protected SelectValueController.SelectValueContext<V>
protected ValuesPicker<V>
Fields inherited from class io.jmix.ui.action.AbstractAction
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visible
Fields inherited from interface io.jmix.ui.action.Action
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE
Fields inherited from interface io.jmix.ui.component.ValuePicker.ValuePickerAction
PROP_EDITABLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerform
(Component component) Invoked by owning component to execute the action.void
addValidator
(Validator<V> validator) Adds validator which is used inSelectValueController
screen to validate component values.void
void
editableChanged
(boolean editable) Called byValuePicker
to inform about its editable state.void
execute()
Executes the action.Class<?>
Returns the class ofSelectValueController
screen if it was set bysetSelectValueScreenId(String)
or in the screen XML.Returns the id ofSelectValueController
screen if it was set bysetSelectValueScreenId(String)
or in the screen XML.protected void
initSelectValueComponentValueType
(EntityValueSource<?, ?> valueSource) boolean
boolean
protected void
setEditable
(boolean editable) void
setEntityName
(String entityName) Sets the entity name which is used as the component value type inSelectValueController
screen.void
setEnumClass
(Class<? extends Enum> enumClass) Sets the enumeration class which is used as the component value type inSelectValueController
screen.protected void
void
setJavaClass
(Class<?> javaClass) Sets the java class which is used as the component value type inSelectValueController
screen.void
setLookupScreenId
(String lookupScreenId) Sets the lookup screen id to be passed intoSelectValueController
screen.protected void
setMessages
(Messages messages) void
setOptionCaptionProvider
(Function<V, String> optionCaptionProvider) Sets function that provides caption for option items.void
setOptions
(Options<V> options) Sets options which are used inSelectValueController
screen.void
setPicker
(ValuePicker valuePicker) Sets aValuePicker
instance associated with this action.void
setResolution
(DateField.Resolution resolution) Sets the resolution ofDateField
component.void
setScreenBuilders
(ScreenBuilders screenBuilders) void
setSelectValueScreenClass
(Class selectValueScreenClass) Sets the class ofSelectValueController
screen.void
setSelectValueScreenId
(String selectValueScreenId) Sets the id ofSelectValueController
screen.void
setTimeZone
(TimeZone timeZone) Sets the time zone ofDateField
component.protected void
setUiComponentProperties
(UiComponentProperties componentProperties) void
setUseComboBox
(boolean useComboBox) Sets whether theComboBox
should be used inSelectValueController
screen.void
setValidators
(List<Validator<V>> validators) Sets the collection ofValidator
's which are used inSelectValueController
screen to validate component values.Methods inherited from class io.jmix.ui.action.BaseAction
addActionPerformedListener, addEnabledRule, isApplicable, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternal, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcut
Methods inherited from class io.jmix.ui.action.AbstractAction
addOwner, addPropertyChangeListener, firePropertyChange, getCaption, getDescription, getEventHub, getIcon, getId, getOwner, getOwners, getShortcutCombination, hasSubscriptions, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setPrimary, setShortcut, setShortcutCombination
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.ui.action.Action
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, refreshState, removeOwner, removePropertyChangeListener, setCaption, setDescription, setEnabled, setIcon, setShortcut, setShortcutCombination, setVisible
-
Field Details
-
ID
- See Also:
-
DEFAULT_SELECT_VALUE_SCREEN
- See Also:
-
valuesPicker
-
icons
-
messages
-
componentProperties
-
screenBuilders
-
editable
protected boolean editable -
screenInitializer
-
selectValueContext
-
-
Constructor Details
-
ValuesSelectAction
public ValuesSelectAction() -
ValuesSelectAction
-
-
Method Details
-
setUiComponentProperties
-
setMessages
-
setScreenBuilders
-
setIcons
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
setPicker
Description copied from interface:ValuePicker.ValuePickerAction
Sets aValuePicker
instance associated with this action.- Specified by:
setPicker
in interfaceValuePicker.ValuePickerAction
- Parameters:
valuePicker
- aValuePicker
instance to set
-
editableChanged
public void editableChanged(boolean editable) Description copied from interface:ValuePicker.ValuePickerAction
Called byValuePicker
to inform about its editable state.- Specified by:
editableChanged
in interfaceValuePicker.ValuePickerAction
- Parameters:
editable
- aValuePicker
editable state
-
isEditable
public boolean isEditable()- Specified by:
isEditable
in interfaceValuePicker.ValuePickerAction
- Returns:
- whether this action is editable
-
setEditable
protected void setEditable(boolean editable) -
getSelectValueScreenId
Returns the id ofSelectValueController
screen if it was set bysetSelectValueScreenId(String)
or in the screen XML.- Returns:
- the id of
SelectValueController
screen
-
setSelectValueScreenId
@StudioPropertiesItem(type=SCREEN_ID, defaultValue="selectValueDialog", options="io.jmix.ui.app.valuespicker.selectvalue.SelectValueController") public void setSelectValueScreenId(String selectValueScreenId) Sets the id ofSelectValueController
screen.- Parameters:
selectValueScreenId
- the id ofSelectValueController
screen
-
getSelectValueScreenClass
Returns the class ofSelectValueController
screen if it was set bysetSelectValueScreenId(String)
or in the screen XML. Otherwise returnsnull
.- Returns:
- the class of
SelectValueController
screen
-
setSelectValueScreenClass
Sets the class ofSelectValueController
screen.- Parameters:
selectValueScreenClass
- the class ofSelectValueController
screen
-
getLookupScreenId
- Returns:
- the lookup screen id
-
setLookupScreenId
@StudioPropertiesItem(type=SCREEN_ID, options="io.jmix.ui.screen.LookupScreen") public void setLookupScreenId(@Nullable String lookupScreenId) Sets the lookup screen id to be passed intoSelectValueController
screen.- Parameters:
lookupScreenId
- the lookup screen id
-
getEntityName
- Returns:
- the entity name which is used as the component value type
-
setEntityName
Sets the entity name which is used as the component value type inSelectValueController
screen.- Parameters:
entityName
- the entity name which is used as the component value type
-
getJavaClass
- Returns:
- the java class which is used as the component value type
-
setJavaClass
Sets the java class which is used as the component value type inSelectValueController
screen.- Parameters:
javaClass
- the java class which is used as the component value type
-
getEnumClass
- Returns:
- the enumeration class which is used as the component value type
-
setEnumClass
@StudioPropertiesItem(type=JAVA_CLASS_NAME) public void setEnumClass(@Nullable Class<? extends Enum> enumClass) Sets the enumeration class which is used as the component value type inSelectValueController
screen.- Parameters:
enumClass
- the enumeration class which is used as the component value type
-
isUseComboBox
public boolean isUseComboBox()- Returns:
- whether or not the
ComboBox
should be used inSelectValueController
screen
-
setUseComboBox
@StudioPropertiesItem(type=BOOLEAN, defaultValue="false") public void setUseComboBox(boolean useComboBox) Sets whether theComboBox
should be used inSelectValueController
screen.- Parameters:
useComboBox
- whether theComboBox
should be used inSelectValueController
screen
-
getResolution
- Returns:
- the resolution of
DateField
-
setResolution
@StudioPropertiesItem(type=ENUMERATION) public void setResolution(@Nullable DateField.Resolution resolution) Sets the resolution ofDateField
component. TheDateField
component is used to select values which have date value type. The component is used inSelectValueController
screen.- Parameters:
resolution
- the resolution ofDateField
-
getTimeZone
- Returns:
- the time zone of
DateField
-
setTimeZone
Sets the time zone ofDateField
component. TheDateField
component is used to select values which have date value type. The component is used inSelectValueController
screen.- Parameters:
timeZone
- the time zone ofDateField
-
getOptions
- Returns:
- options
-
setOptions
Sets options which are used inSelectValueController
screen.- Parameters:
options
- options
-
getOptionCaptionProvider
- Returns:
- caption provider for options
-
setOptionCaptionProvider
Sets function that provides caption for option items.- Parameters:
optionCaptionProvider
- caption provider for options
-
getValidators
- Returns:
- the collection of validators
-
setValidators
Sets the collection ofValidator
's which are used inSelectValueController
screen to validate component values.- Parameters:
validators
- the collection of validators
-
addValidator
Adds validator which is used inSelectValueController
screen to validate component values.- Parameters:
validator
- validator
-
actionPerform
Description copied from interface:Action
Invoked by owning component to execute the action.- Specified by:
actionPerform
in interfaceAction
- Overrides:
actionPerform
in classBaseAction
- Parameters:
component
- invoking component
-
execute
public void execute()Executes the action.- Specified by:
execute
in interfaceAction.ExecutableAction
-
initSelectValueComponentValueType
-