Package org.vaadin.firitin.fields
Class ByteArrayUploadField
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
org.vaadin.firitin.fields.ByteArrayUploadField
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,,byte[]>, byte[]> Serializable
@StyleSheet("context://frontend/org/vaadin/firitin/bytearrayuploadfield.css")
public class ByteArrayUploadField
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
implements com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>,byte[]>
- Author:
- mstahv
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField, byte[]>> listener) com.vaadin.flow.component.upload.Uploadbyte[]getValue()booleanbooleanstatic StringreadableFileSize(long size) voidsetDownloadFileName(String downloadFileName) Sets the name of the file that people download if they download the file directlyvoidsetFileDownloadText(String fileDownloadText) Sets the (formatted text) that is shown in a link if the value is not null to download the contents of the byte array.voidsetReadOnly(boolean bln) voidsetRequiredIndicatorVisible(boolean bln) voidsetUploadCaption(String uploadCaption) voidsetValue(byte[] v) Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, 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.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods 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.HasValue
clear, getEmptyValue, getOptionalValue, isEmpty
-
Constructor Details
-
ByteArrayUploadField
public ByteArrayUploadField()
-
-
Method Details
-
getDownloadFileName
-
setDownloadFileName
Sets the name of the file that people download if they download the file directly- Parameters:
downloadFileName- the file name
-
setFileDownloadText
Sets the (formatted text) that is shown in a link if the value is not null to download the contents of the byte array. String parameter for formatting is the human readable size of the byte array.- Parameters:
fileDownloadText- the text, default "download ( %s )"
-
getFileDownloadText
-
addValueChangeListener
public com.vaadin.flow.shared.Registration addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField, byte[]>> listener) - Specified by:
addValueChangeListenerin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>, byte[]>
-
setReadOnly
public void setReadOnly(boolean bln) - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>, byte[]>
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnlyin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>, byte[]>
-
setRequiredIndicatorVisible
public void setRequiredIndicatorVisible(boolean bln) - Specified by:
setRequiredIndicatorVisiblein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>, byte[]>
-
isRequiredIndicatorVisible
public boolean isRequiredIndicatorVisible()- Specified by:
isRequiredIndicatorVisiblein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>, byte[]>
-
setValue
public void setValue(byte[] v) - Specified by:
setValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>, byte[]>
-
getValue
public byte[] getValue()- Specified by:
getValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>, byte[]>
-
readableFileSize
-
getUpload
public com.vaadin.flow.component.upload.Upload getUpload() -
setUploadCaption
-