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