Package com.storedobject.ui.inventory
Class ItemField<I extends InventoryItem>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<I>,I>
com.vaadin.flow.component.customfield.CustomField<I>
com.storedobject.vaadin.CustomField<I>
com.storedobject.ui.AbstractObjectField<I>
com.storedobject.ui.ObjectGetField<I>
com.storedobject.ui.inventory.ItemField<I>
- Type Parameters:
I
- Type of inventory item to accept.
- All Implemented Interfaces:
FilterMethods<I>
,ObjectGetter<I>
,ObjectSetter<I>
,ItemInput<I>
,ObjectInput<I>
,ObjectProvider<I>
,AbstractObjectInput<I>
,HasElement
,HasThemeStyle
,ValueRequired
,com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<I>>
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<I>>
,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<I>>
,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<I>,
,I>, I> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<I>,
,I>, I> 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<I>,
,I>, I> Serializable
,Consumer<I>
Field to accept an instance of the
InventoryItem
with provision to input part number.- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.ui.ObjectGetField
ObjectGetField.GetProvider<O extends StoredObject>, ObjectGetField.GetSupplier<O extends StoredObject>, ObjectGetField.GetTypedSupplier<O extends StoredObject>
Nested 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
protected ObjectGetField.GetProvider
<I> Create the "get" provider for this field.protected ObjectBrowser
<I> Get the searcher for this field.protected void
doSearch()
Do a search using the searcher component.protected boolean
Load the searcher with all the available instances.void
fixPartNumber
(InventoryItemType partNumber) Fix the part number (an instance ofInventoryItemType
).Get the current value of the part number.GetId
of the current part number value.ObjectProvider
<? extends InventoryItemType> Get the P/N provider of this.<T extends InventoryItemType>
ObjectField<T> protected ButtonLayout
This is where the display parts of the field is initialized.void
setDetailComponent
(com.vaadin.flow.component.Component detailComponent) Set a component that will display details of the object value.void
setDisplayDetail
(Consumer<I> displayDetail) Set a consumer that can display/consume the details of the object value.void
setEnabled
(boolean enabled) Enable/disable this field.void
setExtraFilterProvider
(FilterProvider extraFilterProvider) Set extra filters that need to be added to other filters when item's accessibility is checked.void
setLocation
(InventoryLocation location) Set the location (it could be bin location or any other location).void
setLocation
(ObjectProvider<? extends InventoryLocation> locationField) Set the location (it could be bin location or any other location).void
setPartNumber
(InventoryItemType partNumber) Set the part number (an instance ofInventoryItemType
) portion.void
setPrefixFieldControl
(boolean searchFieldControl) Decide whether "prefix components" needs to be controlled by this field or not.protected void
setPresentationValue
(I value) void
setReadOnly
(boolean readOnly) Make this field read-only.void
setRequired
(boolean required) Set value required flag.void
setStore
(InventoryStore store) Set the store.void
setStore
(ObjectProvider<? extends InventoryStore> storeField) Set the store.void
Set the value.Methods inherited from class com.storedobject.ui.ObjectGetField
canCreate, createPrefixComponent, focus, generateModelValue, getSearchField, setNotFoundHandler, setNotFoundTacker, setPlaceholder
Methods inherited from class com.storedobject.ui.AbstractObjectField
applyFilter, createDefaultSearcher, editor, filter, filteredList, getBrowseColumns, getCached, getContent, getDetailComponent, getDisplayDetail, getInternalLabel, getLoadFilter, getObjectClass, getPrefixComponent, getSearchColumns, getSearcher, isAllowAny, isInvalid, isRequired, load, onAttach, reget, reload, setBrowseColumns, setCached, setInternalLabel, setItemLabelGenerator, setSearchColumns
Methods inherited from class com.storedobject.vaadin.CustomField
addField, addField
Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getLabel, remove, removeThemeVariants, setLabel, updateValue
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, valueEquals
Methods 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, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.ui.util.AbstractObjectInput
applyFilterPredicate, convert, focus, getCached, getDetailComponent, getDisplayDetail, getObject, getObjectClass, getObjectId, getObjectId, isAllowAny, setCached, setItemLabelGenerator, setObject
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.storedobject.core.FilterMethods
applyFilter, getEffectiveCondition, getFilterCondition, getLoadFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setLoadFilter, setLoadFilter, setViewFilter, setViewFilter
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, getTabIndex, setTabIndex
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener
Methods inherited from interface com.storedobject.vaadin.HasElement
getAttribute, getStyle, setAttribute, setStyle
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled
Methods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperText
Methods inherited from interface com.vaadin.flow.component.HasLabel
getLabel, setLabel
Methods inherited from interface com.vaadin.flow.component.HasPlaceholder
getPlaceholder, setPlaceholder
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
Methods inherited from interface com.storedobject.vaadin.HasThemeStyle
addTheme, asPrimary, asSmall, clearThemes, getInternalElement, removeTheme, setTheme
Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipText
Methods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidation
Methods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, setErrorMessage, setInvalid
Methods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, getEmptyValue, getOptionalValue, getValue, isEmpty
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
Methods inherited from interface com.storedobject.ui.ObjectInput
getInternalLabel, getObject, getSearcher, getValue, load, reload, setInternalLabel, setObject, setObjectClass, setValue
Methods inherited from interface com.storedobject.core.ObjectSetter
accept
Methods inherited from interface com.storedobject.vaadin.ValueRequired
isRequired
-
Constructor Details
-
ItemField
Constructor.- Parameters:
objectClass
- Class of theInventoryItem
objects that are valid.
-
ItemField
Constructor.- Parameters:
label
- Label for the field.objectClass
- Class of theInventoryItem
objects that are valid.
-
ItemField
Constructor.- Parameters:
objectClass
- Class of theInventoryItem
objects that are valid.allowAny
- Whether subclasses should be allowed or not.
-
ItemField
Constructor.- Parameters:
label
- Label for the field.objectClass
- Class of theInventoryItem
objects that are valid.allowAny
- Whether subclasses should be allowed or not.
-
-
Method Details
-
getPNField
-
clear
public void clear()- Specified by:
clear
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<I extends InventoryItem>,
I extends InventoryItem>, I extends InventoryItem>
-
setValue
Description copied from interface:ObjectInput
Set the value.- Specified by:
setValue
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<I extends InventoryItem>,
I extends InventoryItem>, I extends InventoryItem> - Specified by:
setValue
in interfaceObjectInput<I extends InventoryItem>
- Overrides:
setValue
in classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<I extends InventoryItem>,
I extends InventoryItem> - Parameters:
value
- Value to set.
-
setRequired
public void setRequired(boolean required) Description copied from interface:ValueRequired
Set value required flag.- Specified by:
setRequired
in interfaceValueRequired
- Overrides:
setRequired
in classAbstractObjectField<I extends InventoryItem>
- Parameters:
required
- Required or not
-
fixPartNumber
Fix the part number (an instance ofInventoryItemType
). If a non-null value is set, "part number" portion will be locked with that value. Anull
value may be set later to unlock it.- Parameters:
partNumber
- Part number to set.
-
setPartNumber
Set the part number (an instance ofInventoryItemType
) portion.- Parameters:
partNumber
- Part number to set.
-
getPartNumber
Get the current value of the part number.- Returns:
- Current value of the part number. It may be
null
.
-
getPartNumberId
-
initComponent
Description copied from class:AbstractObjectField
This is where the display parts of the field is initialized. If overridden, you need to make sure to always return the same component between calls.- Overrides:
initComponent
in classAbstractObjectField<I extends InventoryItem>
- Returns:
- The layout component containing other display components.
-
setPresentationValue
- Overrides:
setPresentationValue
in classObjectGetField<I extends InventoryItem>
-
setReadOnly
public void setReadOnly(boolean readOnly) Description copied from interface:AbstractObjectInput
Make this field read-only.- Specified by:
setReadOnly
in interfaceAbstractObjectInput<I extends InventoryItem>
- Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<I extends InventoryItem>,
I extends InventoryItem>, I extends InventoryItem> - Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<I extends InventoryItem>,
I extends InventoryItem>, I extends InventoryItem> - Overrides:
setReadOnly
in classAbstractObjectField<I extends InventoryItem>
- Parameters:
readOnly
- True to set as read-only.
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:AbstractObjectInput
Enable/disable this field.- Specified by:
setEnabled
in interfaceAbstractObjectInput<I extends InventoryItem>
- Specified by:
setEnabled
in interfacecom.vaadin.flow.component.HasEnabled
- Overrides:
setEnabled
in classAbstractObjectField<I extends InventoryItem>
- Parameters:
enabled
- True for enabling.
-
createGetProvider
Description copied from class:ObjectGetField
Create the "get" provider for this field.- Overrides:
createGetProvider
in classObjectGetField<I extends InventoryItem>
- Returns:
- By default, it will create an instance of
ObjectGetField.GetSupplier
.
-
setDetailComponent
public void setDetailComponent(com.vaadin.flow.component.Component detailComponent) Description copied from interface:AbstractObjectInput
Set a component that will display details of the object value.- Specified by:
setDetailComponent
in interfaceAbstractObjectInput<I extends InventoryItem>
- Overrides:
setDetailComponent
in classAbstractObjectField<I extends InventoryItem>
- Parameters:
detailComponent
- A component that can display information regarding the object.
-
setDisplayDetail
Description copied from interface:AbstractObjectInput
Set a consumer that can display/consume the details of the object value.- Specified by:
setDisplayDetail
in interfaceAbstractObjectInput<I extends InventoryItem>
- Overrides:
setDisplayDetail
in classAbstractObjectField<I extends InventoryItem>
- Parameters:
displayDetail
- A consumer that can accept the object value.
-
setPrefixFieldControl
public void setPrefixFieldControl(boolean searchFieldControl) Description copied from interface:AbstractObjectInput
Decide whether "prefix components" needs to be controlled by this field or not. "Prefix components" are parts of the field that display extra information, and it needs to be turned on or off when the status of the field changes via methods such asAbstractObjectInput.setEnabled(boolean)
,AbstractObjectInput.setReadOnly(boolean)
etc. In some cases, prefix components may be displayed elsewhere and needs to be controlled outside the field.- Specified by:
setPrefixFieldControl
in interfaceAbstractObjectInput<I extends InventoryItem>
- Overrides:
setPrefixFieldControl
in classAbstractObjectField<I extends InventoryItem>
- Parameters:
searchFieldControl
- True if it needs to be controlled by this field.
-
setStore
Description copied from interface:ItemInput
Set the store. If set, only items from the given store will be acceptable.- Specified by:
setStore
in interfaceItemInput<I extends InventoryItem>
- Parameters:
storeField
- Any provider that can supply anInventoryStore
instance.
-
setStore
Description copied from interface:ItemInput
Set the store. If set, only items from the given store will be acceptable.- Specified by:
setStore
in interfaceItemInput<I extends InventoryItem>
- Parameters:
store
- An instance ofInventoryStore
.
-
setLocation
Description copied from interface:ItemInput
Set the location (it could be bin location or any other location). If set, only items from the given location will be acceptable.- Specified by:
setLocation
in interfaceItemInput<I extends InventoryItem>
- Parameters:
locationField
- Any provider that can supply anInventoryLocation
instance.
-
setLocation
Description copied from interface:ItemInput
Set the location (it could be bin location or any other location). If set, only items from the given location will be acceptable.- Specified by:
setLocation
in interfaceItemInput<I extends InventoryItem>
- Parameters:
location
- An instance of anInventoryLocation
.
-
setExtraFilterProvider
Description copied from interface:ItemInput
Set extra filters that need to be added to other filters when item's accessibility is checked.- Specified by:
setExtraFilterProvider
in interfaceItemInput<I extends InventoryItem>
- Parameters:
extraFilterProvider
- Extra filter to be set.
-
getPartNumberProvider
Description copied from interface:ItemInput
Get the P/N provider of this.- Specified by:
getPartNumberProvider
in interfaceItemInput<I extends InventoryItem>
- Returns:
- P/N provider.
-
doSearch
protected void doSearch()Description copied from class:AbstractObjectField
Do a search using the searcher component.- Overrides:
doSearch
in classObjectGetField<I extends InventoryItem>
-
doSearchLoadAll
protected boolean doSearchLoadAll()Description copied from class:ObjectGetField
Load the searcher with all the available instances. Iftrue
is returned from this method, it will be assumed that appropriate search action is already carried out.- Overrides:
doSearchLoadAll
in classObjectGetField<I extends InventoryItem>
- Returns:
- True if loaded. Default implementation reapplies the filter if the load filter is dynamic and
returns
false
.
-
createSearcher
Description copied from class:AbstractObjectField
Get the searcher for this field.- Overrides:
createSearcher
in classAbstractObjectField<I extends InventoryItem>
- Returns:
- Typically, an instance of the
ObjectBrowser
that has search capability.
-