public class TagFieldImpl<V> extends AbstractSuggestionField<java.util.Collection<V>,V,JmixTagField<V>> implements TagField<V>
TagField.NewTagProvider<V>, TagField.TagClickEvent<V>
SuggestionFieldComponent.ArrowDownEvent, SuggestionFieldComponent.ParametrizedSearchExecutor<E>, SuggestionFieldComponent.SearchExecutor<E>
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
HasEnterPressHandler.EnterPressEvent
arrowDownHandler, backgroundWorker, enterPressHandler, formatter, handler, locale, metadataTools, optionStyleProvider, searchExecutor
editable, parentEditableChangeListener, validators, VALIDATORS_LIST_INITIAL_CAPACITY
internalValue, uiTestIdsSupport, valueBinding
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
POPUP_AUTO_WIDTH, POPUP_PARENT_WIDTH
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
TagFieldImpl() |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addTagClickListener(java.util.function.Consumer<TagField.TagClickEvent<V>> listener)
Sets tag click listener.
|
protected JmixTagField<V> |
createComponent() |
protected boolean |
equalCollections(java.util.Collection<V> a,
java.util.Collection<V> b) |
protected boolean |
fieldValueEquals(java.util.Collection<V> value,
java.util.Collection<V> oldValue) |
java.util.function.Function<? super V,java.lang.String> |
getTagCaptionProvider() |
java.util.Comparator<? super V> |
getTagComparator() |
java.util.function.Function<? super V,java.lang.String> |
getTagStyleProvider() |
boolean |
isClearAllVisible() |
boolean |
isEmpty() |
protected void |
onTagClick(V item) |
protected io.jmix.core.common.event.Subscription |
removeTagClickListener(java.util.function.Consumer<TagField.TagClickEvent<V>> listener) |
void |
setClearAllVisible(boolean visible)
Display the button that clears all tags from the field.
|
void |
setTagCaptionProvider(java.util.function.Function<? super V,java.lang.String> tagCaptionProvider)
Sets tag caption provider.
|
void |
setTagComparator(java.util.Comparator<? super V> tagComparator)
Sets comparator for sorting tags in the UI.
|
void |
setTagStyleProvider(java.util.function.Function<? super V,java.lang.String> tagStyleProvider)
Sets tag style provider.
|
void |
setValueFromUser(java.util.Collection<V> value)
Sets the value of this component as if the user had set it.
|
addStyleName, afterPropertiesSet, applyDefaultValueFormat, asyncSearch, cancelSearch, convertToTextView, focus, generateItemStylename, getArrowDownHandler, getAsyncSearchDelayMs, getEnterPressHandler, getFormatter, getInputPrompt, getMinSearchStringLength, getOptionStyleProvider, getPopupWidth, getSearchExecutor, getSearchSuggestionsTask, getSuggestionsLimit, getTabIndex, handleSearchResult, initComponent, onArrowDownHandler, onEnterPressHandler, removeStyleName, searchSuggestions, setArrowDownHandler, setAsyncSearchDelayMs, setBackgroundWorker, setCurrentAuthentication, setEnterPressHandler, setFormatter, setInputPrompt, setMetadataTools, setMinSearchStringLength, setOptionStyleProvider, setPopupWidth, setSearchExecutor, setStyleName, setSuggestionsLimit, setTabIndex, showSuggestions, showSuggestions
addValidator, attachValueChangeListener, getDatatypeConversionErrorMsg, getErrorMessage, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeValidator, setEditable, setEditableToComponent, setParent, setRequired, setRequiredMessage, setupComponentErrorProvider, triggerValidators, validate
addValueChangeListener, commit, componentValueChanged, convertToModel, convertToPresentation, discard, getValue, getValueSource, isBuffered, isModified, setBuffered, setUiTestId, setUiTestIdsSupport, setValue, setValueSource, setValueToPresentation, valueBindingActivated, valueBindingConnected
addAttachListener, addDetachListener, 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, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setResponsive, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
of, setSearchExecutor
getArrowDownHandler, getAsyncSearchDelayMs, getMinSearchStringLength, getPopupWidth, getSearchExecutor, getSuggestionsLimit, setArrowDownHandler, setAsyncSearchDelayMs, setMinSearchStringLength, setPopupWidth, setSuggestionsLimit, showSuggestions
getValueSource, setValueSource
addValueChangeListener, clear, getEmptyValue, getValue, 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
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
getInputPrompt, setInputPrompt
getOptionStyleProvider, setOptionStyleProvider
getFormatter, setFormatter
getEnterPressHandler, setEnterPressHandler
protected JmixTagField<V> createComponent()
public boolean isClearAllVisible()
isClearAllVisible
in interface TagField<V>
public void setClearAllVisible(boolean visible)
TagField
false
.setClearAllVisible
in interface TagField<V>
visible
- whether to display clear buttonpublic java.util.function.Function<? super V,java.lang.String> getTagStyleProvider()
getTagStyleProvider
in interface TagField<V>
null
if not setpublic void setTagStyleProvider(@Nullable java.util.function.Function<? super V,java.lang.String> tagStyleProvider)
TagField
For instance:
@Install(to = "tagField", subject = "tagStyleProvider") private String tagFieldTagStyleProvider(User user) { switch (user.getAccountType()) { case PREMIUM: return "user-premium"; case COMMON: return "user-common"; default: return null; } }
setTagStyleProvider
in interface TagField<V>
tagStyleProvider
- tag style provider to setpublic java.util.function.Function<? super V,java.lang.String> getTagCaptionProvider()
getTagCaptionProvider
in interface TagField<V>
null
if not setpublic void setTagCaptionProvider(@Nullable java.util.function.Function<? super V,java.lang.String> tagCaptionProvider)
TagField
For instance:
@Install(to = "tagField", subject = "tagCaptionProvider") private String tagFieldCaptionProvider(User user) { return "User: " + user.getUsername(); }
setTagCaptionProvider
in interface TagField<V>
tagCaptionProvider
- caption provider to set@Nullable public java.util.Comparator<? super V> getTagComparator()
getTagComparator
in interface TagField<V>
public void setTagComparator(@Nullable java.util.Comparator<? super V> tagComparator)
TagField
setTagComparator
in interface TagField<V>
tagComparator
- comparator to setpublic io.jmix.core.common.event.Subscription addTagClickListener(java.util.function.Consumer<TagField.TagClickEvent<V>> listener)
TagField
TagField.TagClickEvent
that is invoked when
user clicks on tag content.addTagClickListener
in interface TagField<V>
listener
- listener to addprotected io.jmix.core.common.event.Subscription removeTagClickListener(java.util.function.Consumer<TagField.TagClickEvent<V>> listener)
protected boolean fieldValueEquals(@Nullable java.util.Collection<V> value, @Nullable java.util.Collection<V> oldValue)
fieldValueEquals
in class AbstractValueComponent<JmixTagField<V>,java.util.Collection<V>,java.util.Collection<V>>
protected boolean equalCollections(@Nullable java.util.Collection<V> a, @Nullable java.util.Collection<V> b)
protected void onTagClick(V item)
public void setValueFromUser(@Nullable java.util.Collection<V> value)
SupportsUserAction
HasValue.ValueChangeEvent
.setValueFromUser
in interface SupportsUserAction<java.util.Collection<V>>
value
- the new value