V
- single value type or CollectionI
- item typeT
- Vaadin component typepublic abstract class AbstractSelectList<V,I,T extends JmixAbstractListSelect<I>> extends AbstractField<T,java.util.Set<I>,V> implements SelectList<V,I>, org.springframework.beans.factory.InitializingBean
SelectList.DoubleClickEvent<I>
HasValue.ValueChangeEvent<V>
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
Modifier and Type | Field and Description |
---|---|
protected io.jmix.core.MetadataTools |
metadataTools |
protected java.util.function.Function<? super I,java.lang.String> |
optionCaptionProvider |
protected OptionsBinding<I> |
optionsBinding |
editable, parentEditableChangeListener, validators, VALIDATORS_LIST_INITIAL_CAPACITY
internalValue, uiTestIdsSupport, valueBinding
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
AbstractSelectList() |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addDoubleClickListener(java.util.function.Consumer<SelectList.DoubleClickEvent<I>> listener)
Adds a listener that is fired when user double-clicks on a list item.
|
void |
afterPropertiesSet() |
protected void |
componentValueChanged(java.util.Set<I> prevComponentValue,
java.util.Set<I> newComponentValue,
boolean isUserOriginated) |
protected abstract T |
createComponent() |
void |
focus()
Sets focus to this component
|
protected java.lang.String |
generateDefaultItemCaption(I item) |
protected java.lang.String |
generateItemCaption(I item) |
protected abstract java.util.Collection<I> |
getCollectionValue() |
java.util.function.Function<? super I,java.lang.String> |
getOptionCaptionProvider() |
Options<I> |
getOptions() |
int |
getTabIndex()
Gets the tabulator index of the
HasTabIndex component. |
protected void |
initComponent(T component) |
protected void |
onDoubleClick(I item) |
protected void |
setItemsToPresentation(java.util.stream.Stream<I> options) |
void |
setMetadataTools(io.jmix.core.MetadataTools metadataTools) |
void |
setOptionCaptionProvider(java.util.function.Function<? super I,java.lang.String> optionCaptionProvider)
Sets function that provides caption for option items.
|
void |
setOptions(Options<I> options)
Sets options for UI component.
|
void |
setTabIndex(int tabIndex)
Sets the tabulator index of the
Focusable component. |
protected void |
valueBindingConnected(ValueSource<V> valueSource) |
addValidator, attachValueChangeListener, getDatatypeConversionErrorMsg, getDefaultRequiredMessage, getErrorMessage, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeValidator, setEditable, setEditableToComponent, setParent, setRequired, setRequiredMessage, setupComponentErrorProvider, triggerValidators, validate
addValueChangeListener, commit, convertToModel, convertToPresentation, discard, fieldValueEquals, getValue, getValueSource, isBuffered, isModified, setBuffered, setUiTestId, setUiTestIdsSupport, setValue, setValueSource, setValueToPresentation, valueBindingActivated
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setOptionsEnum, setOptionsList, setOptionsMap
getValueSource, setValueSource
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
isEditable, isEditableWithParent, setEditable
getFrame, setFrame
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, withUnwrappedComposition
isValid, isValidateOnCommit, validate
getIcon, setIcon, setIconFromSet
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
addValidator, addValidators, getValidators, removeValidator
getRequiredMessage, isRequired, setRequired, setRequiredMessage
isFocusable, setFocusable
protected io.jmix.core.MetadataTools metadataTools
protected OptionsBinding<I> optionsBinding
protected java.util.function.Function<? super I,java.lang.String> optionCaptionProvider
@Autowired public void setMetadataTools(io.jmix.core.MetadataTools metadataTools)
protected abstract T createComponent()
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
protected void initComponent(T component)
public void setOptionCaptionProvider(@Nullable java.util.function.Function<? super I,java.lang.String> optionCaptionProvider)
HasOptionCaptionProvider
setOptionCaptionProvider
in interface HasOptionCaptionProvider<I>
optionCaptionProvider
- caption provider for options@Nullable public java.util.function.Function<? super I,java.lang.String> getOptionCaptionProvider()
getOptionCaptionProvider
in interface HasOptionCaptionProvider<I>
public io.jmix.core.common.event.Subscription addDoubleClickListener(java.util.function.Consumer<SelectList.DoubleClickEvent<I>> listener)
SelectList
addDoubleClickListener
in interface SelectList<V,I>
listener
- a listener to addpublic void focus()
Component.Focusable
focus
in interface Component.Focusable
public int getTabIndex()
Component.Focusable
HasTabIndex
component.getTabIndex
in interface Component.Focusable
HasTabIndex
componentpublic void setTabIndex(int tabIndex)
Component.Focusable
Focusable
component.
The tab index property is used to specify the order in which the
fields are focused when the user presses the Tab key. Components with
a defined tab index are focused sequentially first, and then the
components with no tab index.setTabIndex
in interface Component.Focusable
tabIndex
- tab index@Nullable public Options<I> getOptions()
getOptions
in interface OptionsField<V,I>
public void setOptions(@Nullable Options<I> options)
OptionsField
setOptions
in interface OptionsField<V,I>
options
- optionsListOptions
protected void setItemsToPresentation(java.util.stream.Stream<I> options)
protected abstract java.util.Collection<I> getCollectionValue()
protected void componentValueChanged(java.util.Set<I> prevComponentValue, java.util.Set<I> newComponentValue, boolean isUserOriginated)
componentValueChanged
in class AbstractValueComponent<T extends JmixAbstractListSelect<I>,java.util.Set<I>,V>
protected void valueBindingConnected(ValueSource<V> valueSource)
valueBindingConnected
in class AbstractValueComponent<T extends JmixAbstractListSelect<I>,java.util.Set<I>,V>
protected java.lang.String generateDefaultItemCaption(I item)
@Nullable protected java.lang.String generateItemCaption(@Nullable I item)
protected void onDoubleClick(I item)