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.EnabledRuleNested 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
FieldsModifier and TypeFieldDescriptionprotected UiComponentPropertiesstatic final Stringprotected booleanprotected Iconsstatic final Stringprotected Messagesprotected ScreenBuildersprotected ActionScreenInitializerprotected SelectValueController.SelectValueContext<V>protected ValuesPicker<V>Fields inherited from class io.jmix.ui.action.AbstractAction
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visibleFields inherited from interface io.jmix.ui.action.Action
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLEFields inherited from interface io.jmix.ui.component.ValuePicker.ValuePickerAction
PROP_EDITABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerform(Component component) Invoked by owning component to execute the action.voidaddValidator(Validator<V> validator) Adds validator which is used inSelectValueControllerscreen to validate component values.voidvoideditableChanged(boolean editable) Called byValuePickerto inform about its editable state.voidexecute()Executes the action.Class<?>Returns the class ofSelectValueControllerscreen if it was set bysetSelectValueScreenId(String)or in the screen XML.Returns the id ofSelectValueControllerscreen if it was set bysetSelectValueScreenId(String)or in the screen XML.protected voidinitSelectValueComponentValueType(EntityValueSource<?, ?> valueSource) booleanbooleanprotected voidsetEditable(boolean editable) voidsetEntityName(String entityName) Sets the entity name which is used as the component value type inSelectValueControllerscreen.voidsetEnumClass(Class<? extends Enum> enumClass) Sets the enumeration class which is used as the component value type inSelectValueControllerscreen.protected voidvoidsetJavaClass(Class<?> javaClass) Sets the java class which is used as the component value type inSelectValueControllerscreen.voidsetLookupScreenId(String lookupScreenId) Sets the lookup screen id to be passed intoSelectValueControllerscreen.protected voidsetMessages(Messages messages) voidsetOptionCaptionProvider(Function<V, String> optionCaptionProvider) Sets function that provides caption for option items.voidsetOptions(Options<V> options) Sets options which are used inSelectValueControllerscreen.voidsetPicker(ValuePicker valuePicker) Sets aValuePickerinstance associated with this action.voidsetResolution(DateField.Resolution resolution) Sets the resolution ofDateFieldcomponent.voidsetScreenBuilders(ScreenBuilders screenBuilders) voidsetSelectValueScreenClass(Class selectValueScreenClass) Sets the class ofSelectValueControllerscreen.voidsetSelectValueScreenId(String selectValueScreenId) Sets the id ofSelectValueControllerscreen.voidsetTimeZone(TimeZone timeZone) Sets the time zone ofDateFieldcomponent.protected voidsetUiComponentProperties(UiComponentProperties componentProperties) voidsetUseComboBox(boolean useComboBox) Sets whether theComboBoxshould be used inSelectValueControllerscreen.voidsetValidators(List<Validator<V>> validators) Sets the collection ofValidator's which are used inSelectValueControllerscreen 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, withShortcutMethods 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, setShortcutCombinationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
setPicker
Description copied from interface:ValuePicker.ValuePickerActionSets aValuePickerinstance associated with this action.- Specified by:
setPickerin interfaceValuePicker.ValuePickerAction- Parameters:
valuePicker- aValuePickerinstance to set
-
editableChanged
public void editableChanged(boolean editable) Description copied from interface:ValuePicker.ValuePickerActionCalled byValuePickerto inform about its editable state.- Specified by:
editableChangedin interfaceValuePicker.ValuePickerAction- Parameters:
editable- aValuePickereditable state
-
isEditable
public boolean isEditable()- Specified by:
isEditablein interfaceValuePicker.ValuePickerAction- Returns:
- whether this action is editable
-
setEditable
protected void setEditable(boolean editable) -
getSelectValueScreenId
Returns the id ofSelectValueControllerscreen if it was set bysetSelectValueScreenId(String)or in the screen XML.- Returns:
- the id of
SelectValueControllerscreen
-
setSelectValueScreenId
@StudioPropertiesItem(type=SCREEN_ID, defaultValue="selectValueDialog", options="io.jmix.ui.app.valuespicker.selectvalue.SelectValueController") public void setSelectValueScreenId(String selectValueScreenId) Sets the id ofSelectValueControllerscreen.- Parameters:
selectValueScreenId- the id ofSelectValueControllerscreen
-
getSelectValueScreenClass
Returns the class ofSelectValueControllerscreen if it was set bysetSelectValueScreenId(String)or in the screen XML. Otherwise returnsnull.- Returns:
- the class of
SelectValueControllerscreen
-
setSelectValueScreenClass
Sets the class ofSelectValueControllerscreen.- Parameters:
selectValueScreenClass- the class ofSelectValueControllerscreen
-
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 intoSelectValueControllerscreen.- 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 inSelectValueControllerscreen.- 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 inSelectValueControllerscreen.- 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 inSelectValueControllerscreen.- Parameters:
enumClass- the enumeration class which is used as the component value type
-
isUseComboBox
public boolean isUseComboBox()- Returns:
- whether or not the
ComboBoxshould be used inSelectValueControllerscreen
-
setUseComboBox
@StudioPropertiesItem(type=BOOLEAN, defaultValue="false") public void setUseComboBox(boolean useComboBox) Sets whether theComboBoxshould be used inSelectValueControllerscreen.- Parameters:
useComboBox- whether theComboBoxshould be used inSelectValueControllerscreen
-
getResolution
- Returns:
- the resolution of
DateField
-
setResolution
@StudioPropertiesItem(type=ENUMERATION) public void setResolution(@Nullable DateField.Resolution resolution) Sets the resolution ofDateFieldcomponent. TheDateFieldcomponent is used to select values which have date value type. The component is used inSelectValueControllerscreen.- Parameters:
resolution- the resolution ofDateField
-
getTimeZone
- Returns:
- the time zone of
DateField
-
setTimeZone
Sets the time zone ofDateFieldcomponent. TheDateFieldcomponent is used to select values which have date value type. The component is used inSelectValueControllerscreen.- Parameters:
timeZone- the time zone ofDateField
-
getOptions
- Returns:
- options
-
setOptions
Sets options which are used inSelectValueControllerscreen.- 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 inSelectValueControllerscreen to validate component values.- Parameters:
validators- the collection of validators
-
addValidator
Adds validator which is used inSelectValueControllerscreen to validate component values.- Parameters:
validator- validator
-
actionPerform
Description copied from interface:ActionInvoked by owning component to execute the action.- Specified by:
actionPerformin interfaceAction- Overrides:
actionPerformin classBaseAction- Parameters:
component- invoking component
-
execute
public void execute()Executes the action.- Specified by:
executein interfaceAction.ExecutableAction
-
initSelectValueComponentValueType
-