Package io.jmix.ui.component.impl
Class TwinColumnImpl<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<JmixTwinColSelect<V>,Set<V>,Collection<V>>
io.jmix.ui.component.impl.TwinColumnImpl<V>
- All Implemented Interfaces:
AttachNotifier
,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>
,HasOptionStyleProvider<V>
,HasValidator<Collection<V>>
,HasValue<Collection<V>>
,OptionsField<Collection<V>,
,V> Requirable
,TwinColumn<V>
,Validatable
,org.springframework.beans.factory.InitializingBean
public class TwinColumnImpl<V>
extends AbstractField<JmixTwinColSelect<V>,Set<V>,Collection<V>>
implements TwinColumn<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.HasValue
HasValue.ValueChangeEvent<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected IconResolver
protected MetadataTools
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.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Fields inherited from interface io.jmix.ui.component.TwinColumn
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected Collection<V>
convertToModel
(Set<V> componentRawValue) convertToPresentation
(Collection<V> modelValue) protected JmixTwinColSelect<V>
void
focus()
Sets focus to this componentprotected String
generateDefaultItemCaption
(V item) protected String
generateItemCaption
(V item) protected String
generateItemStylename
(V item) Returns caption of the left column.Returns caption of the right column.int
getRows()
int
Gets the tabulator index of theHasTabIndex
component.protected void
initComponent
(JmixTwinColSelect<V> component) boolean
boolean
isEmpty()
boolean
void
setAddAllBtnEnabled
(boolean enabled) Enables "Add all" and "Remove all" buttons.protected void
setItemsToPresentation
(Stream<V> options) void
setLeftColumnCaption
(String leftColumnCaption) Sets caption for the left column.protected void
setMetadataTools
(MetadataTools metadataTools) void
setOptionCaptionProvider
(Function<? super V, String> captionProvider) Sets function that provides caption for option items.void
setOptions
(Options<V> options) Sets options for UI component.void
setOptionStyleProvider
(Function<? super V, String> optionStyleProvider) Sets the style provider that is used to produce custom class names for option items.void
setReorderable
(boolean reorderable) Allows you to configure whether items should be reordered after selection.void
setRightColumnCaption
(String rightColumnCaption) Sets caption for the right column.void
setRows
(int rows) Sets the number of visible rows.void
setTabIndex
(int tabIndex) Sets the tabulator index of theFocusable
component.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, valueBindingConnected
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
-
optionsBinding
-
optionCaptionProvider
-
optionStyleProvider
-
metadataTools
-
iconResolver
-
-
Constructor Details
-
TwinColumnImpl
public TwinColumnImpl()
-
-
Method Details
-
createComponent
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
initComponent
-
setMetadataTools
-
setOptions
Description copied from interface:OptionsField
Sets options for UI component.- Specified by:
setOptions
in interfaceOptionsField<Collection<V>,
V> - Parameters:
options
- options- See Also:
-
setItemsToPresentation
-
convertToPresentation
protected Set<V> convertToPresentation(@Nullable Collection<V> modelValue) throws ConversionException - Overrides:
convertToPresentation
in classAbstractValueComponent<JmixTwinColSelect<V>,
Set<V>, Collection<V>> - Throws:
ConversionException
-
convertToModel
protected Collection<V> convertToModel(@Nullable Set<V> componentRawValue) throws ConversionException - Overrides:
convertToModel
in classAbstractValueComponent<JmixTwinColSelect<V>,
Set<V>, Collection<V>> - Throws:
ConversionException
-
getOptions
- Specified by:
getOptions
in interfaceOptionsField<Collection<V>,
V> - Returns:
- options object
-
setOptionCaptionProvider
Description copied from interface:HasOptionCaptionProvider
Sets function that provides caption for option items.- Specified by:
setOptionCaptionProvider
in interfaceHasOptionCaptionProvider<V>
- Parameters:
captionProvider
- caption provider for options
-
generateItemCaption
-
generateDefaultItemCaption
-
getOptionCaptionProvider
- Specified by:
getOptionCaptionProvider
in interfaceHasOptionCaptionProvider<V>
- Returns:
- caption provider for options
-
getRows
public int getRows()- Specified by:
getRows
in interfaceTwinColumn<V>
- Returns:
- the number of visible rows
-
setRows
public void setRows(int rows) Description copied from interface:TwinColumn
Sets the number of visible rows.- Specified by:
setRows
in interfaceTwinColumn<V>
- Parameters:
rows
- number of visible rows
-
setOptionStyleProvider
Description copied from interface:HasOptionStyleProvider
Sets the style provider that is used to produce custom class names for option items.- Specified by:
setOptionStyleProvider
in interfaceHasOptionStyleProvider<V>
- Parameters:
optionStyleProvider
- style provider
-
generateItemStylename
-
getOptionStyleProvider
- Specified by:
getOptionStyleProvider
in interfaceHasOptionStyleProvider<V>
- Returns:
- the currently used item style provider
-
setAddAllBtnEnabled
public void setAddAllBtnEnabled(boolean enabled) Description copied from interface:TwinColumn
Enables "Add all" and "Remove all" buttons.- Specified by:
setAddAllBtnEnabled
in interfaceTwinColumn<V>
- Parameters:
enabled
- true if buttons should be enabled
-
isAddAllBtnEnabled
public boolean isAddAllBtnEnabled()- Specified by:
isAddAllBtnEnabled
in interfaceTwinColumn<V>
- Returns:
- true if buttons are enabled
-
setReorderable
Description copied from interface:TwinColumn
Allows you to configure whether items should be reordered after selection.Reordering is enabled by default.
- Specified by:
setReorderable
in interfaceTwinColumn<V>
- Parameters:
reorderable
- pass 'true' to enable reordering or 'false' otherwise
-
isReorderable
public boolean isReorderable()- Specified by:
isReorderable
in interfaceTwinColumn<V>
- Returns:
- true if items are reordered or false otherwise
-
setLeftColumnCaption
Description copied from interface:TwinColumn
Sets caption for the left column.- Specified by:
setLeftColumnCaption
in interfaceTwinColumn<V>
- Parameters:
leftColumnCaption
- a caption for the left column
-
getLeftColumnCaption
Description copied from interface:TwinColumn
Returns caption of the left column.- Specified by:
getLeftColumnCaption
in interfaceTwinColumn<V>
- Returns:
- caption text or null if not set.
-
setRightColumnCaption
Description copied from interface:TwinColumn
Sets caption for the right column.- Specified by:
setRightColumnCaption
in interfaceTwinColumn<V>
- Parameters:
rightColumnCaption
- a caption for the right column
-
getRightColumnCaption
Description copied from interface:TwinColumn
Returns caption of the right column.- Specified by:
getRightColumnCaption
in interfaceTwinColumn<V>
- Returns:
- caption text or null if not set.
-
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
-
isEmpty
public boolean isEmpty()
-