Package com.storedobject.ui
Class ObjectField<T extends StoredObject>
java.lang.Object
- Type Parameters:
T- Type of objects accepted. OnlyIdvalues of this type are valid.
- All Implemented Interfaces:
FilterMethods<T>,ObjectGetter<T>,ObjectSetter<T>,IdInput<T>,ObjectProvider<T>,AbstractObjectInput<T>,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<T>
- Direct Known Subclasses:
AccountField,UserField
public class ObjectField<T extends StoredObject>
extends CustomField<Id>
implements IdInput<T>, ViewDependent, NoDisplayField, ValueRequired
A field that can be used to accept
Id values. It has an "internal field" of type ObjectInput
that actually accepts the object values.- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested ClassesNested 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
ConstructorsModifierConstructorDescriptionObjectField(ObjectInput<T> field) Constructor.ObjectField(Class<T> objectClass) Constructor.ObjectField(Class<T> objectClass, boolean any) Constructor.ObjectField(Class<T> objectClass, boolean any, boolean addAllowed) Constructor.ObjectField(Class<T> objectClass, boolean any, ObjectField.Type type) Constructor.ObjectField(Class<T> objectClass, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.ObjectField(Class<T> objectClass, ObjectField.Type type) Constructor.ObjectField(Iterable<T> list) Constructor.ObjectField(String label, ObjectInput<T> field) Constructor.ObjectField(String label, Class<T> objectClass) Constructor.ObjectField(String label, Class<T> objectClass, boolean any) Constructor.ObjectField(String label, Class<T> objectClass, boolean any, boolean addAllowed) Constructor.ObjectField(String label, Class<T> objectClass, boolean any, ObjectField.Type type) Constructor.ObjectField(String label, Class<T> objectClass, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.protectedObjectField(String label, Class<T> objectClass, boolean any, ObjectGetField.GetProvider<T> getProvider, boolean addAllowed) Constructor.ObjectField(String label, Class<T> objectClass, ObjectField.Type type) Constructor.ObjectField(String label, Class<T> objectClass, String fieldName, BiFunction<String, Class<T>, ObjectEditor<T>> editorCreator, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.Constructor.ObjectField(String label, Iterable<T> list) Constructor.ObjectField(String label, List<T> list) Constructor.ObjectField(String label, List<T> list, boolean any) Constructor.ObjectField(List<T> list) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method is called whenever a filter condition is changed.booleanCan this field display information like normal fields?voidclear()Clear the field value.static <O extends StoredObject>
ObjectField<O> createSingle(String label, O object) Create a read-only instance of theObjectFieldthat has a pre-selected value.voidDeprecated.voidfocus()Focus this field.protected IdGet the currently cached object.Get the dependent view.com.vaadin.flow.component.ComponentGet the component that is currently displaying details of the object value.Get the consumer that is currently consuming details of the object value.getField()Get the internal field.Get the load filter.Class of the object supported in this input field.getType()Get the type of the internal field.getValue()Get the value.booleanWhether this field allows any derived object values or not.booleanbooleanGet the value required flag.voidload(ObjectIterator<T> objects) Load allowed values from a list.voidreload()Reload the allowed values by applying newly set filters.voidCache an object instance.voidsetDependentView(View dependent) Set the dependent view.voidsetDetailComponent(com.vaadin.flow.component.Component detailComponent) Set a component that will display details of the object value.voidsetDisplayDetail(Consumer<T> displayDetail) Set a consumer that can display/consume the details of the object value.voidsetEnabled(boolean enabled) Enable/disable this field.voidvoidsetItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator) Set an "item label generator" that returns the string value of the object value of this field.voidvoidsetLoadFilter(Predicate<T> loadFilter) Set a filter predicate that will be used while loading.voidsetLoadFilter(Predicate<T> loadFilter, boolean apply) Set the load filter.voidsetMaxWidth(String width) voidsetMinWidth(String width) voidsetNotFoundHandler(Function<String, T> notFoundHandler) voidSet object for the givenId.voidsetObject(StoredObject object) Set a raw object as the value.final voidsetObjectClass(Class<? extends T>... classes) Set one or more (typically more than one) class subtypes that this field supports.voidsetPlaceholder(String placeholder) voidsetPrefixFieldControl(boolean searchFieldControl) Decide whether "prefix components" needs to be controlled by this field or not.protected voidsetPresentationValue(Id value) voidsetReadOnly(boolean readOnly) Make this field read-only.voidsetRequired(boolean required) Set value required flag.voidSet the value.voidSet the value for the given object.voidvoidprotected voidMethods 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
-
ObjectField
-
ObjectField
Constructor.- Parameters:
objectClass- Class of the objects that are valid.type- Desired type of the field.
-
ObjectField
-
ObjectField
Constructor.- Parameters:
label- Label for the field.objectClass- Class of the objects that are valid.type- Desired type of the field.
-
ObjectField
-
ObjectField
-
ObjectField
Constructor.- Parameters:
objectClass- Class of the objects that are valid.any- Whether subclasses should be allowed or not.type- Desired type of the field.
-
ObjectField
Constructor.- Parameters:
label- Label for the field.objectClass- Class of the objects that are valid.any- Whether subclasses should be allowed or not.type- Desired type of the field.
-
ObjectField
Constructor.- Parameters:
objectClass- Class of the objects that are valid.any- Whether subclasses should be allowed or not.addAllowed- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
Constructor.- Parameters:
label- Label for the field.objectClass- Class of the objects that are valid.any- Whether subclasses should be allowed or not.addAllowed- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
Constructor.- Parameters:
objectClass- Class of the objects that are valid.any- Whether subclasses should be allowed or not.type- Desired type of the field.addAllowed- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
public ObjectField(String label, Class<T> objectClass, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.- Parameters:
label- Label for the field.objectClass- Class of the objects that are valid.any- Whether subclasses should be allowed or not.type- Desired type of the field.addAllowed- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
public ObjectField(String label, Class<T> objectClass, String fieldName, BiFunction<String, Class<T>, ObjectEditor<T>> editorCreator, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.- Parameters:
label- Label for the field.objectClass- Class of the objects that are valid.fieldName- Name of the field (Useful when crated from anObjectEditor).editorCreator- Editor creator for theObjectFormField. (Useful when the type isObjectField.Type.FORMorObjectField.Type.FORM_BLOCK).any- Whether subclasses should be allowed or not.type- Desired type of the field.addAllowed- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
-
ObjectField
-
ObjectField
-
ObjectField
protected ObjectField(String label, Class<T> objectClass, boolean any, ObjectGetField.GetProvider<T> getProvider, boolean addAllowed) Constructor.- Parameters:
label- Label for the field.objectClass- Class of the objects that are valid.any- Whether subclasses should be allowed or not.getProvider- "Get" provider for searching the object instances.addAllowed- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
-
ObjectField
-
ObjectField
-
ObjectField
Constructor.- Parameters:
field- Object input field to be used internally.
-
ObjectField
Constructor.- Parameters:
label- Label for the field.field- Object input field to be used internally.
-
-
Method Details
-
filter
Deprecated.Please usesetFilter(Predicate)instead.Set a predicate that will be used for filtering the object after loading is done.- Parameters:
predicate- Filter to apply after loaded.
-
setFilter
-
setLoadFilter
Set a filter predicate that will be used while loading.- Specified by:
setLoadFilterin interfaceFilterMethods<T extends StoredObject>- Parameters:
loadFilter- Filter to apply while loading.
-
setLoadFilter
Description copied from interface:FilterMethodsSet the load filter. This will be applied whenever loading takes place.- Specified by:
setLoadFilterin interfaceFilterMethods<T extends StoredObject>- Parameters:
loadFilter- Load filter to be applied while loading.apply- Whether to apply it immediately or not.
-
clear
public void clear()Description copied from interface:AbstractObjectInputClear the field value.- Specified by:
clearin interfaceAbstractObjectInput<T extends StoredObject>- Specified by:
clearin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,Id>, Id>
-
focus
public void focus()Description copied from interface:AbstractObjectInputFocus this field.- Specified by:
focusin interfaceAbstractObjectInput<T extends StoredObject>- Specified by:
focusin interfacecom.vaadin.flow.component.Focusable<T extends StoredObject>- Overrides:
focusin classCustomField<Id>
-
setWidth
- Specified by:
setWidthin interfacecom.vaadin.flow.component.HasSize
-
setWidthFull
public void setWidthFull()- Specified by:
setWidthFullin interfacecom.vaadin.flow.component.HasSize
-
setMaxWidth
- Specified by:
setMaxWidthin interfacecom.vaadin.flow.component.HasSize
-
setMinWidth
- Specified by:
setMinWidthin interfacecom.vaadin.flow.component.HasSize
-
setLabel
-
canDisplay
public boolean canDisplay()Description copied from interface:NoDisplayFieldCan this field display information like normal fields?- Specified by:
canDisplayin interfaceNoDisplayField- Returns:
- True/false.
-
updateValue
protected void updateValue()- Overrides:
updateValuein classcom.vaadin.flow.component.customfield.CustomField<Id>
-
isInvalid
public boolean isInvalid()- Specified by:
isInvalidin interfacecom.vaadin.flow.component.HasValidation- Specified by:
isInvalidin interfacecom.vaadin.flow.component.shared.HasValidationProperties
-
setPlaceholder
- Specified by:
setPlaceholderin interfacecom.vaadin.flow.component.HasPlaceholder
-
getCached
Description copied from interface:AbstractObjectInputGet the currently cached object.- Specified by:
getCachedin interfaceAbstractObjectInput<T extends StoredObject>- Returns:
- Object that is currently cached. It may return
null.
-
setCached
Description copied from interface:AbstractObjectInputCache an object instance. Default implementation doesn't do anything but a field may cache it and re-used for eliminating unwanted database access.- Specified by:
setCachedin interfaceAbstractObjectInput<T extends StoredObject>- Parameters:
object- Object to be cached.
-
getObjectClass
Description copied from interface:AbstractObjectInputClass of the object supported in this input field.- Specified by:
getObjectClassin interfaceAbstractObjectInput<T extends StoredObject>- Specified by:
getObjectClassin interfaceObjectGetter<T extends StoredObject>- Specified by:
getObjectClassin interfaceObjectProvider<T extends StoredObject>- Specified by:
getObjectClassin interfaceObjectSetter<T extends StoredObject>- Returns:
- Class of the supported object.
-
applyFilter
public void applyFilter()Description copied from interface:FilterMethodsThis method is called whenever a filter condition is changed. Methods with default implementation already invoke this method. If any of those methods are overridden, make sure that it invokes this method so that logic to handle filter changes can be coded here.- Specified by:
applyFilterin interfaceFilterMethods<T extends StoredObject>
-
getLoadFilter
Description copied from interface:FilterMethodsGet the load filter.- Specified by:
getLoadFilterin interfaceFilterMethods<T extends StoredObject>- Returns:
- Current load filter.
-
setDetailComponent
public void setDetailComponent(com.vaadin.flow.component.Component detailComponent) Description copied from interface:AbstractObjectInputSet a component that will display details of the object value.- Specified by:
setDetailComponentin interfaceAbstractObjectInput<T extends StoredObject>- Parameters:
detailComponent- A component that can display information regarding the object.
-
getDetailComponent
public com.vaadin.flow.component.Component getDetailComponent()Description copied from interface:AbstractObjectInputGet the component that is currently displaying details of the object value.- Specified by:
getDetailComponentin interfaceAbstractObjectInput<T extends StoredObject>- Returns:
- Component that is displaying the details.
-
setDisplayDetail
Description copied from interface:AbstractObjectInputSet a consumer that can display/consume the details of the object value.- Specified by:
setDisplayDetailin interfaceAbstractObjectInput<T extends StoredObject>- Parameters:
displayDetail- A consumer that can accept the object value.
-
getDisplayDetail
Description copied from interface:AbstractObjectInputGet the consumer that is currently consuming details of the object value.- Specified by:
getDisplayDetailin interfaceAbstractObjectInput<T extends StoredObject>- Returns:
- Consumer that is currently set.
-
setPrefixFieldControl
public void setPrefixFieldControl(boolean searchFieldControl) Description copied from interface:AbstractObjectInputDecide 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:
setPrefixFieldControlin interfaceAbstractObjectInput<T extends StoredObject>- Parameters:
searchFieldControl- True if it needs to be controlled by this field.
-
isAllowAny
public boolean isAllowAny()Description copied from interface:AbstractObjectInputWhether this field allows any derived object values or not.- Specified by:
isAllowAnyin interfaceAbstractObjectInput<T extends StoredObject>- Specified by:
isAllowAnyin interfaceObjectGetter<T extends StoredObject>- Specified by:
isAllowAnyin interfaceObjectSetter<T extends StoredObject>- Returns:
- True or false.
-
setReadOnly
public void setReadOnly(boolean readOnly) Description copied from interface:AbstractObjectInputMake this field read-only.- Specified by:
setReadOnlyin interfaceAbstractObjectInput<T extends StoredObject>- Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,Id>, Id> - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,Id>, Id> - Parameters:
readOnly- True to set as read-only.
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:AbstractObjectInputEnable/disable this field.- Specified by:
setEnabledin interfaceAbstractObjectInput<T extends StoredObject>- Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled- Parameters:
enabled- True for enabling.
-
getField
Get the internal field.- Returns:
- The internal field that accepts the object values.
-
generateModelValue
-
setPresentationValue
-
getType
Get the type of the internal field.- Returns:
- Type of the internal field.
-
setItemLabelGenerator
public void setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator) Description copied from interface:AbstractObjectInputSet an "item label generator" that returns the string value of the object value of this field. (It is mainly used to display the object).- Specified by:
setItemLabelGeneratorin interfaceAbstractObjectInput<T extends StoredObject>- Parameters:
itemLabelGenerator- Item value generator.
-
getValue
Description copied from interface:IdInputGet the value.- Specified by:
getValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,Id>, Id> - Specified by:
getValuein interfaceIdInput<T extends StoredObject>- Overrides:
getValuein classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<Id>,Id> - Returns:
- Value.
-
setDependentView
Description copied from interface:ViewDependentSet the dependent view.- Specified by:
setDependentViewin interfaceViewDependent- Parameters:
dependent- The dependent view.
-
setValue
Description copied from interface:IdInputSet the value.- Specified by:
setValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,Id>, Id> - Specified by:
setValuein interfaceIdInput<T extends StoredObject>- Overrides:
setValuein classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<Id>,Id> - Parameters:
value- Value to set.
-
setValue
-
setObject
Description copied from interface:AbstractObjectInputSet object for the givenId.- Specified by:
setObjectin interfaceAbstractObjectInput<T extends StoredObject>- Specified by:
setObjectin interfaceObjectSetter<T extends StoredObject>- Parameters:
objectId-Idof the object to be set.
-
setObject
Description copied from interface:IdInputSet a raw object as the value. If the object is not convertible to the supported type, it will setnullvalue.- Specified by:
setObjectin interfaceAbstractObjectInput<T extends StoredObject>- Specified by:
setObjectin interfaceIdInput<T extends StoredObject>- Specified by:
setObjectin interfaceObjectSetter<T extends StoredObject>- Parameters:
object- Object to set.
-
getDependentView
Description copied from interface:ViewDependentGet the dependent view.- Specified by:
getDependentViewin interfaceViewDependent- Returns:
- The dependent view.
-
load
Load allowed values from a list. Once invoked, only this list will be used for showing the allowed objects that can be selected via this field.- Parameters:
objects- Objects to load.
-
reload
public void reload()Reload the allowed values by applying newly set filters. -
setObjectClass
Set one or more (typically more than one) class subtypes that this field supports.- Parameters:
classes- Classes to allow.
-
createSingle
Create a read-only instance of theObjectFieldthat has a pre-selected value.- Type Parameters:
O- Type of the object accepted.- Parameters:
label- Field label.object- Pre-selected value. (Must be non-null).- Returns:
- A read-only field with a value already set.
-
setNotFoundHandler
-
setRequired
public void setRequired(boolean required) Description copied from interface:ValueRequiredSet value required flag.- Specified by:
setRequiredin interfaceValueRequired- Parameters:
required- Required or not
-
isRequired
public boolean isRequired()Description copied from interface:ValueRequiredGet the value required flag.- Specified by:
isRequiredin interfaceValueRequired- Returns:
- Whether required or not.
-
setFilter(Predicate)instead.