Package com.storedobject.ui
Class UserField
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<Id>,Id>
com.vaadin.flow.component.customfield.CustomField<Id>
- All Implemented Interfaces:
FilterMethods<SystemUser>,ObjectGetter<SystemUser>,ObjectSetter<SystemUser>,IdInput<SystemUser>,ObjectProvider<SystemUser>,AbstractObjectInput<SystemUser>,NoDisplayField,HasElement,HasThemeStyle,ValueRequired,ViewDependent,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<Id>>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<Id>>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<Id>>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasPlaceholder,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,,Id>, Id> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,,Id>, Id> com.vaadin.flow.component.shared.HasTooltip,com.vaadin.flow.component.shared.HasValidationProperties,com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,,Id>, Id> Serializable,Consumer<SystemUser>
Field to select a normal user. Unless a list or iterator is provided, it will use the default filter criteria to
filter out system users, auditors, external users, and locked users.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.ui.ObjectField
ObjectField.TypeNested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>> -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for creating a new instance of UserField.UserField(ObjectField.Type type) Constructs a UserField with a specified type.UserField(ObjectInput<SystemUser> field) Constructs a UserField instance with the specified input field.UserField(Iterable<SystemUser> list) Constructs a UserField object with the given list of SystemUser objects.Constructor for the UserField class, used to create a labeled field for user input.UserField(String label, ObjectField.Type type) Constructs a newUserFieldwith the specified label and type.UserField(String label, ObjectInput<SystemUser> field) Constructs aUserFieldwith the specified label and field.UserField(String label, Iterable<SystemUser> list) Constructs a `UserField` instance with the specified label and a list of `SystemUser` objects.UserField(String label, List<SystemUser> list) Constructs a UserField with a specified label and a list of valid SystemUser instances.UserField(List<SystemUser> list) Constructs a UserField object with a specified list of SystemUser objects. -
Method Summary
Modifier and TypeMethodDescriptionstatic UserFieldforLinks(StoredObject master) Retrieves a UserField associated with the given master object for handling linked entities.static UserFieldforLinks(StoredObject master, Predicate<SystemUser> filter) Creates a UserField instance configured to handle linked entities associated with the specified master object.static UserFieldforLinks(String label, StoredObject master) Creates a UserField using the specified label and linked SystemUser objects from the provided master object.static UserFieldforLinks(String label, StoredObject master, Predicate<SystemUser> filter) Creates aUserFieldinstance populated with linkedSystemUserobjects from the provided master object, filtered by the specifiedPredicate.static UserFieldforMasters(StoredObject link) Creates a UserField instance for handling master-related operations.static UserFieldforMasters(StoredObject link, Predicate<SystemUser> filter) Creates a UserField instance configured for master-related functionality.static UserFieldforMasters(String label, StoredObject link) Creates a UserField instance for masters based on the specified label and stored object link.static UserFieldforMasters(String label, StoredObject link, Predicate<SystemUser> filter) Creates a UserField instance for handling master-related entities, using the specified label, stored object link, and an optional filter for filtering SystemUser objects.Methods inherited from class com.storedobject.ui.ObjectField
applyFilter, canDisplay, clear, createSingle, filter, focus, generateModelValue, getCached, getDependentView, getDetailComponent, getDisplayDetail, getField, getLoadFilter, getObjectClass, getType, getValue, isAllowAny, isInvalid, isRequired, load, reload, setCached, setDependentView, setDetailComponent, setDisplayDetail, setEnabled, setFilter, setItemLabelGenerator, setLabel, setLoadFilter, setLoadFilter, setMaxWidth, setMinWidth, setNotFoundHandler, setObject, setObject, setObjectClass, setPlaceholder, setPrefixFieldControl, setPresentationValue, setReadOnly, setRequired, setValue, setValue, setWidth, setWidthFull, updateValueMethods inherited from class com.storedobject.vaadin.CustomField
addField, addFieldMethods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getLabel, remove, removeThemeVariantsMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, isEmpty, setModelValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.ui.util.AbstractObjectInput
applyFilterPredicate, convert, getObject, getObjectIdMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.storedobject.core.FilterMethods
getEffectiveCondition, getFilterCondition, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setViewFilter, setViewFilterMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.storedobject.vaadin.HasElement
getAttribute, getStyle, setAttribute, setStyleMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasLabel
getLabelMethods inherited from interface com.vaadin.flow.component.HasPlaceholder
getPlaceholderMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidthMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.storedobject.vaadin.HasThemeStyle
addTheme, asPrimary, asSmall, clearThemes, getInternalElement, removeTheme, setThemeMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidationMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, getEmptyValue, getOptionalValue, isEmptyMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisibleMethods inherited from interface com.storedobject.ui.IdInput
getObject, getObjectIdMethods inherited from interface com.storedobject.core.ObjectSetter
accept
-
Constructor Details
-
UserField
public UserField()Default constructor for creating a new instance of UserField. Acts as shorthand for initializing the UserField with a default label. The label is set to "Username" if no specific label is provided. -
UserField
Constructs a UserField with a specified type.- Parameters:
type- The type of the field to be created. This determines the nature of the user field, such as whether it is a choice field, a search field, or another type from the predefinedTypeenumeration.
-
UserField
Constructor for the UserField class, used to create a labeled field for user input.- Parameters:
label- The label for the field. If null, the default label "Username" will be used.
-
UserField
Constructs a newUserFieldwith the specified label and type. If the label isnull, a default label of "Username" is used. Additionally, sets up the field with specific filters for validity.- Parameters:
label- The label for the field. Ifnull, defaults to "Username".type- The desired type of the field. Determines the behavior and constraints of the field.
-
UserField
Constructs a UserField object with a specified list of SystemUser objects.- Parameters:
list- a list of SystemUser instances to be associated with the UserField object
-
UserField
Constructs a UserField object with the given list of SystemUser objects.- Parameters:
list- an iterable collection of SystemUser objects to initialize the UserField.
-
UserField
Constructs a `UserField` instance with the specified label and a list of `SystemUser` objects.- Parameters:
label- Label associated with the field.list- An iterable collection of `SystemUser` objects that will be used to create the field's list.
-
UserField
Constructs a UserField with a specified label and a list of valid SystemUser instances.- Parameters:
label- Label for the field. If null, the default label "Username" will be used.list- List of SystemUser objects that will be allowed for selection in this field.
-
UserField
Constructs a UserField instance with the specified input field.- Parameters:
field- The input field of typeObjectInput<SystemUser>to define the behavior of the UserField.
-
UserField
Constructs aUserFieldwith the specified label and field. If the label isnull, a default label of "Username" is used.- Parameters:
label- The label to display for the field. Ifnull, "Username" is used as the default value.field- AnObjectInputinstance for handling input ofSystemUserobjects.
-
-
Method Details
-
forLinks
Retrieves a UserField associated with the given master object for handling linked entities.- Parameters:
master- the master StoredObject to associate the UserField with; must not be null.- Returns:
- a UserField instance configured for linked entity handling.
-
forLinks
Creates a UserField using the specified label and linked SystemUser objects from the provided master object.- Parameters:
label- the label to be used for the UserField.master- the StoredObject instance whose linked SystemUser objects are used to populate the UserField.- Returns:
- a new instance of UserField initialized with the provided label and linked SystemUser objects.
-
forLinks
Creates a UserField instance configured to handle linked entities associated with the specified master object. The SystemUser instances are filtered based on the provided predicate.- Parameters:
master- the master StoredObject from which linked entities of type SystemUser are retrieved; must not be nullfilter- a predicate to filter the SystemUser instances; if null, no filtering is applied- Returns:
- a UserField instance populated with the filtered list of linked SystemUser objects
-
forLinks
Creates aUserFieldinstance populated with linkedSystemUserobjects from the provided master object, filtered by the specifiedPredicate.- Parameters:
label- the label to be used for theUserField.master- theStoredObjectinstance whose linkedSystemUserobjects are used to populate theUserField; must not be null.filter- aPredicateto filter theSystemUserobjects. If the filter isnull, all linkedSystemUserobjects are included.- Returns:
- a new
UserFieldinstance initialized with the specified label, linkedSystemUserobjects, and filter.
-
forMasters
Creates a UserField instance for handling master-related operations.- Parameters:
link- the StoredObject instance representing the association or link needed for the master operation- Returns:
- a UserField instance configured for master-related functionality
-
forMasters
Creates a UserField instance for masters based on the specified label and stored object link.- Parameters:
label- the label to be displayed for the UserField.link- a reference to the stored object used to retrieve the list of master SystemUsers.- Returns:
- a UserField instance populated with the list of master SystemUsers.
-
forMasters
Creates a UserField instance configured for master-related functionality. This method initializes the UserField with a stored object link and filters SystemUsers based on the provided predicate.- Parameters:
link- the StoredObject instance representing the linked association for the master operationfilter- a Predicate to filter the SystemUser instances; if null, all SystemUsers are included- Returns:
- a UserField instance populated with the filtered list of master SystemUsers
-
forMasters
Creates a UserField instance for handling master-related entities, using the specified label, stored object link, and an optional filter for filtering SystemUser objects.- Parameters:
label- the label to be displayed for the UserField.link- the StoredObject instance used to retrieve the list of master SystemUsers.filter- a predicate to filter the list of SystemUser objects; if null, no filtering is applied.- Returns:
- a new UserField instance populated with the filtered list of master SystemUsers.
-