Package io.jmix.ui.component.impl
Class CheckBoxGroupImpl<V>
java.lang.Object
io.jmix.ui.component.impl.AbstractComponent<T>
io.jmix.ui.component.impl.AbstractValueComponent<T,P,V>
io.jmix.ui.component.impl.AbstractField<JmixCheckBoxGroup<V>,Set<V>,Collection<V>>
io.jmix.ui.component.impl.CheckBoxGroupImpl<V>
- All Implemented Interfaces:
AttachNotifier
,CheckBoxGroup<V>
,Component
,Component.BelongToFrame
,Component.Editable
,Component.Focusable
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,Component.HasXmlDescriptor
,Component.Wrapper
,HasValueSource<Collection<V>>
,Field<Collection<V>>
,HasContextHelp
,HasDebugId
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,HasOptionCaptionProvider<V>
,HasOptionDescriptionProvider<V>
,HasOptionIconProvider<V>
,HasOrientation
,HasValidator<Collection<V>>
,HasValue<Collection<V>>
,OptionsField<Collection<V>,
,V> Requirable
,Validatable
,org.springframework.beans.factory.InitializingBean
public class CheckBoxGroupImpl<V>
extends AbstractField<JmixCheckBoxGroup<V>,Set<V>,Collection<V>>
implements CheckBoxGroup<V>, org.springframework.beans.factory.InitializingBean
-
Nested Class Summary
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.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasOrientation
HasOrientation.Orientation
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected IconResolver
protected MetadataTools
static final com.vaadin.ui.DescriptionGenerator
protected OptionsBinding<V>
Fields inherited from class io.jmix.ui.component.impl.AbstractField
editable, parentEditableChangeListener, validators, VALIDATORS_LIST_INITIAL_CAPACITY
Fields inherited from class io.jmix.ui.component.impl.AbstractValueComponent
internalValue, uiTestIdsSupport, valueBinding
Fields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
Fields inherited from interface io.jmix.ui.component.CheckBoxGroup
NAME
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected Collection<V>
convertToModel
(Set<V> componentRawValue) convertToPresentation
(Collection<V> modelValue) void
focus()
Sets focus to this componentprotected String
generateDefaultItemCaption
(V item) protected String
generateItemCaption
(V item) protected com.vaadin.server.Resource
generateOptionIcon
(V item) int
Gets the tabulator index of theHasTabIndex
component.protected void
initComponent
(JmixCheckBoxGroup<V> component) boolean
isEmpty()
protected void
setIconResolver
(IconResolver iconResolver) protected void
setItemsToPresentation
(Stream<V> options) protected void
setMetadataTools
(MetadataTools metadataTools) void
setOptionCaptionProvider
(Function<? super V, String> optionCaptionProvider) Sets function that provides caption for option items.void
setOptionDescriptionProvider
(Function<? super V, String> optionDescriptionProvider) Sets the option description provider.void
setOptionIconProvider
(Function<? super V, String> optionIconProvider) Sets a function that provides an icon for options.void
setOptions
(Options<V> options) Sets options for UI component.void
setOrientation
(HasOrientation.Orientation orientation) void
setTabIndex
(int tabIndex) Sets the tabulator index of theFocusable
component.protected void
valueBindingConnected
(ValueSource<Collection<V>> valueSource) Methods inherited from class io.jmix.ui.component.impl.AbstractField
addValidator, attachValueChangeListener, getDatatypeConversionErrorMsg, getDefaultRequiredMessage, getErrorMessage, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeValidator, setEditable, setEditableToComponent, setParent, setRequired, setRequiredMessage, setupComponentErrorProvider, triggerValidators, validate
Methods inherited from class io.jmix.ui.component.impl.AbstractValueComponent
addValueChangeListener, commit, componentValueChanged, discard, fieldValueEquals, getValue, getValueSource, isBuffered, isModified, setBuffered, setUiTestId, setUiTestIdsSupport, setValue, setValueSource, setValueToPresentation, valueBindingActivated
Methods inherited from class io.jmix.ui.component.impl.AbstractComponent
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
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.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, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditable
Methods inherited from interface io.jmix.ui.component.Component.Focusable
isFocusable, setFocusable
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
Methods inherited from interface io.jmix.ui.component.HasValidator
addValidator, addValidators, getValidators, removeValidator
Methods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, getValue, setValue
Methods inherited from interface io.jmix.ui.component.data.HasValueSource
getValueSource, setValueSource
Methods inherited from interface io.jmix.ui.component.OptionsField
setOptionsEnum, setOptionsList, setOptionsMap
Methods inherited from interface io.jmix.ui.component.Requirable
getRequiredMessage, isRequired, setRequired, setRequiredMessage
Methods inherited from interface io.jmix.ui.component.Validatable
isValid, isValidateOnCommit, validate
-
Field Details
-
NULL_ITEM_DESCRIPTION_GENERATOR
public static final com.vaadin.ui.DescriptionGenerator NULL_ITEM_DESCRIPTION_GENERATOR -
metadataTools
-
iconResolver
-
optionsBinding
-
optionDescriptionProvider
-
optionCaptionProvider
-
optionIconProvider
-
-
Constructor Details
-
CheckBoxGroupImpl
public CheckBoxGroupImpl()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
initComponent
-
setMetadataTools
-
setIconResolver
-
generateItemCaption
-
generateDefaultItemCaption
-
focus
public void focus()Description copied from interface:Component.Focusable
Sets focus to this component- Specified by:
focus
in interfaceComponent.Focusable
-
getTabIndex
public int getTabIndex()Description copied from interface:Component.Focusable
Gets the tabulator index of theHasTabIndex
component.- Specified by:
getTabIndex
in interfaceComponent.Focusable
- Returns:
- tab index set for the
HasTabIndex
component
-
setTabIndex
public void setTabIndex(int tabIndex) Description copied from interface:Component.Focusable
Sets the tabulator index of theFocusable
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.- Specified by:
setTabIndex
in interfaceComponent.Focusable
- Parameters:
tabIndex
- tab index
-
getOrientation
- Specified by:
getOrientation
in interfaceHasOrientation
-
setOrientation
- Specified by:
setOrientation
in interfaceHasOrientation
-
convertToPresentation
protected Set<V> convertToPresentation(@Nullable Collection<V> modelValue) throws ConversionException - Overrides:
convertToPresentation
in classAbstractValueComponent<JmixCheckBoxGroup<V>,
Set<V>, Collection<V>> - Throws:
ConversionException
-
convertToModel
protected Collection<V> convertToModel(@Nullable Set<V> componentRawValue) throws ConversionException - Overrides:
convertToModel
in classAbstractValueComponent<JmixCheckBoxGroup<V>,
Set<V>, Collection<V>> - Throws:
ConversionException
-
getOptions
- Specified by:
getOptions
in interfaceOptionsField<Collection<V>,
V> - Returns:
- options object
-
setOptions
Description copied from interface:OptionsField
Sets options for UI component.- Specified by:
setOptions
in interfaceOptionsField<Collection<V>,
V> - Parameters:
options
- options- See Also:
-
valueBindingConnected
- Overrides:
valueBindingConnected
in classAbstractValueComponent<JmixCheckBoxGroup<V>,
Set<V>, Collection<V>>
-
setItemsToPresentation
-
setOptionDescriptionProvider
public void setOptionDescriptionProvider(@Nullable Function<? super V, String> optionDescriptionProvider) Description copied from interface:HasOptionDescriptionProvider
Sets the option description provider.- Specified by:
setOptionDescriptionProvider
in interfaceHasOptionDescriptionProvider<V>
- Parameters:
optionDescriptionProvider
- provider which provides descriptions for options
-
getOptionDescriptionProvider
- Specified by:
getOptionDescriptionProvider
in interfaceHasOptionDescriptionProvider<V>
- Returns:
- option description provider
-
setOptionCaptionProvider
Description copied from interface:HasOptionCaptionProvider
Sets function that provides caption for option items.- Specified by:
setOptionCaptionProvider
in interfaceHasOptionCaptionProvider<V>
- Parameters:
optionCaptionProvider
- caption provider for options
-
getOptionCaptionProvider
- Specified by:
getOptionCaptionProvider
in interfaceHasOptionCaptionProvider<V>
- Returns:
- caption provider for options
-
setOptionIconProvider
Description copied from interface:HasOptionIconProvider
Sets a function that provides an icon for options.- Specified by:
setOptionIconProvider
in interfaceHasOptionIconProvider<V>
- Parameters:
optionIconProvider
- icon provider for options to set
-
getOptionIconProvider
- Specified by:
getOptionIconProvider
in interfaceHasOptionIconProvider<V>
- Returns:
- options icon provider or
null
if not defined
-
generateOptionIcon
-
isEmpty
public boolean isEmpty()
-