Package com.storedobject.ui
Class FileField
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<StreamData>,StreamData>
com.vaadin.flow.component.customfield.CustomField<StreamData>
- All Implemented Interfaces:
FilterMethods<StreamData>,ObjectGetter<StreamData>,ObjectSetter<StreamData>,ObjectInput<StreamData>,ObjectProvider<StreamData>,AbstractObjectInput<StreamData>,HasElement,HasThemeStyle,ValueRequired,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<StreamData>>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<StreamData>>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<StreamData>>,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<StreamData>,,StreamData>, StreamData> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<StreamData>,,StreamData>, StreamData> 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<StreamData>,,StreamData>, StreamData> Serializable,Consumer<StreamData>
- See Also:
-
Nested Class Summary
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
ConstructorsConstructorDescriptionFileField(ObjectField.Type... types) FileField(String label, ObjectField.Type... types) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContentType(String... contentType) protected ImageButtonaddExtraButton(StreamData value) voidvoidstatic <O extends StoredObject>
booleanprotected com.vaadin.flow.component.Componentvoidvoidvoidprotected StreamDatabooleanisAudio()booleanisContentTypeAllowed(String contentType) booleanisImage()final booleanGet the value required flag.booleanisVideo()protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) voidremoveContentType(String contentType) voidsetEnabled(boolean enabled) Enable/disable this field.voidsetMaxFileSize(int maxFileSize) voidsetMediaPreview(boolean preview) protected voidsetModelValue(StreamData value, boolean fromClient) protected voidsetPresentationValue(StreamData value) voidsetReadOnly(boolean readOnly) Make this field read-only.voidsetRequired(boolean required) Set value required flag.voidsetValue(StreamData value) Set the value.Methods inherited from class com.storedobject.ui.AbstractObjectField
applyFilter, clear, createDefaultSearcher, createSearcher, doSearch, editor, filter, filteredList, getBrowseColumns, getCached, getContent, getDetailComponent, getDisplayDetail, getInternalLabel, getLoadFilter, getObjectClass, getPrefixComponent, getSearchColumns, getSearcher, initComponent, isAllowAny, isInvalid, load, reget, reload, setBrowseColumns, setCached, setDetailComponent, setDisplayDetail, setInternalLabel, setItemLabelGenerator, setPrefixFieldControl, setSearchColumnsMethods inherited from class com.storedobject.vaadin.CustomField
addField, addField, focusMethods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getLabel, remove, removeThemeVariants, setLabel, updateValueMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, 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, 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, focus, getObject, getObjectId, getObjectId, setObjectMethods 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, setLoadFilter, setLoadFilter, 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
getLabel, setLabelMethods inherited from interface com.vaadin.flow.component.HasPlaceholder
getPlaceholder, setPlaceholderMethods 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, setWidthFullMethods 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, getValue, isEmptyMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisibleMethods inherited from interface com.storedobject.ui.ObjectInput
getObject, getValue, setObject, setObjectClass, setValueMethods inherited from interface com.storedobject.core.ObjectSetter
accept
-
Constructor Details
-
FileField
public FileField() -
FileField
-
FileField
-
FileField
-
-
Method Details
-
allowLinking
public void allowLinking() -
setMaxFileSize
public void setMaxFileSize(int maxFileSize) -
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classAbstractObjectField<StreamData>
-
canCreate
-
setRequired
public void setRequired(boolean required) Description copied from interface:ValueRequiredSet value required flag.- Specified by:
setRequiredin interfaceValueRequired- Overrides:
setRequiredin classAbstractObjectField<StreamData>- Parameters:
required- Required or not
-
isRequired
public final boolean isRequired()Description copied from interface:ValueRequiredGet the value required flag.- Specified by:
isRequiredin interfaceValueRequired- Overrides:
isRequiredin classAbstractObjectField<StreamData>- Returns:
- Whether required or not.
-
createPrefixComponent
protected com.vaadin.flow.component.Component createPrefixComponent()- Specified by:
createPrefixComponentin classAbstractObjectField<StreamData>
-
generateModelValue
- Specified by:
generateModelValuein classcom.vaadin.flow.component.customfield.CustomField<StreamData>
-
setPresentationValue
- Overrides:
setPresentationValuein classAbstractObjectField<StreamData>
-
setModelValue
- Overrides:
setModelValuein classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<StreamData>,StreamData>
-
setValue
Description copied from interface:ObjectInputSet the value.- Specified by:
setValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<StreamData>,StreamData>, StreamData> - Specified by:
setValuein interfaceObjectInput<StreamData>- Overrides:
setValuein classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<StreamData>,StreamData> - Parameters:
value- Value to set.
-
setReadOnly
public void setReadOnly(boolean readOnly) Description copied from interface:AbstractObjectInputMake this field read-only.- Specified by:
setReadOnlyin interfaceAbstractObjectInput<StreamData>- Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<StreamData>,StreamData>, StreamData> - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<StreamData>,StreamData>, StreamData> - Overrides:
setReadOnlyin classAbstractObjectField<StreamData>- 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<StreamData>- Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled- Overrides:
setEnabledin classAbstractObjectField<StreamData>- Parameters:
enabled- True for enabling.
-
addExtraButton
-
addContentType
-
removeContentType
-
isContentTypeAllowed
-
isImage
public boolean isImage() -
isAudio
public boolean isAudio() -
isVideo
public boolean isVideo() -
disallowLinking
public void disallowLinking() -
disallowDownload
public void disallowDownload() -
allowDownload
public void allowDownload() -
disallowView
public void disallowView() -
getFileName
-
setMediaPreview
public void setMediaPreview(boolean preview)
-