Package io.jmix.ui.component
Interface ValuePicker<V>
- All Superinterfaces:
ActionsHolder,Buffered,Component,Component.BelongToFrame,Component.Editable,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,Field<V>,HasContextHelp,HasFormatter<V>,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,HasInputPrompt,HasSubParts,HasValidator<V>,HasValue<V>,HasValueSource<V>,Requirable,SupportsUserAction<V>,Validatable
- All Known Subinterfaces:
EntityComboBox<V>,EntityPicker<V>,EntitySuggestionField<V>,TagPicker<V>,ValuesPicker<V>
- All Known Implementing Classes:
EntityComboBoxImpl,EntityPickerImpl,EntitySuggestionFieldImpl,SearchFieldImpl,TagPickerImpl,ValuePickerImpl,ValuesPickerImpl
@StudioComponent(caption="ValuePicker",
category="Components",
xmlElement="valuePicker",
icon="io/jmix/ui/icon/component/valuePicker.svg",
canvasBehaviour=VALUE_PICKER,
documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/value-picker.html")
public interface ValuePicker<V>
extends Field<V>, HasFormatter<V>, ActionsHolder, Buffered, Component.Focusable, SupportsUserAction<V>, HasInputPrompt
Generic UI component designed to select and display a value of any type.
Consists of the text field and the set of buttons defined by actions.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe event that is fired when a user inputs value manually.static interfaceInterface to be implemented by actions intended to be used by ValuePicker.Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final org.springframework.core.ParameterizedTypeReference<ValuePicker<String>>Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Method Summary
Modifier and TypeMethodDescriptionAdds a listener that will be fired in case field is editable.booleanstatic <T> org.springframework.core.ParameterizedTypeReference<ValuePicker<T>>voidsetFieldEditable(boolean editable) Sets whether a user can input the value manually.voidsetFieldIconProvider(Function<? super V, String> iconProvider) Sets a function that provides an icon for the field.Methods inherited from interface io.jmix.ui.component.ActionsHolder
addAction, addAction, getAction, getActionNN, getActions, getSubPart, removeAction, removeAction, removeAllActionsMethods inherited from interface io.jmix.ui.component.Buffered
commit, discard, isBuffered, isModified, setBufferedMethods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditableMethods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndexMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledMethods inherited from interface io.jmix.ui.component.HasFormatter
getFormatter, setFormatterMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabledMethods inherited from interface io.jmix.ui.component.HasInputPrompt
getInputPrompt, setInputPromptMethods inherited from interface io.jmix.ui.component.HasValidator
addValidator, addValidators, getValidators, removeValidatorMethods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValueMethods inherited from interface io.jmix.ui.component.data.HasValueSource
getValueSource, setValueSourceMethods inherited from interface io.jmix.ui.component.Requirable
getRequiredMessage, isRequired, setRequired, setRequiredMessageMethods inherited from interface io.jmix.ui.component.SupportsUserAction
setValueFromUserMethods inherited from interface io.jmix.ui.component.Validatable
isValid, isValidateOnCommit, validate
-
Field Details
-
NAME
- See Also:
-
TYPE_STRING
-
-
Method Details
-
of
static <T> org.springframework.core.ParameterizedTypeReference<ValuePicker<T>> of(Class<T> valueClass) -
getFieldIconProvider
- Returns:
- an icon provider or {code null} if not set
-
setFieldIconProvider
Sets a function that provides an icon for the field.- Parameters:
iconProvider- icon provider to set
-
isFieldEditable
boolean isFieldEditable()- Returns:
- whether a user can input the value manually
-
setFieldEditable
Sets whether a user can input the value manually.falseby default. Doesn't set entered value to the model. To handle user input, theValuePicker.FieldValueChangeEventlistener must be used.- Parameters:
editable-trueto enable manual input,falseotherwise- See Also:
-
addFieldValueChangeListener
Adds a listener that will be fired in case field is editable.- Parameters:
listener- a listener to add- Returns:
- a
Subscriptionobject - See Also:
-