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.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>,byte[]>,Serializable
@CssImport("./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:
- Serialized Form
-
-
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 Constructor Description ByteArrayUploadField()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.vaadin.flow.shared.RegistrationaddValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,byte[]>> listener)StringgetDownloadFileName()StringgetFileDownloadText()com.vaadin.flow.component.upload.UploadgetUpload()byte[]getValue()booleanisReadOnly()booleanisRequiredIndicatorVisible()static 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, initContent
-
Methods 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, scrollIntoView, set, setElement, setId, setVisible
-
-
-
-
Method Detail
-
getDownloadFileName
public String getDownloadFileName()
-
setDownloadFileName
public void setDownloadFileName(String downloadFileName)
Sets the name of the file that people download if they download the file directly- Parameters:
downloadFileName- the file name
-
setFileDownloadText
public void setFileDownloadText(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. String parameter for formatting is the human readable size of the byte array.- Parameters:
fileDownloadText- the text, default "download ( %s )"
-
getFileDownloadText
public String 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
public static String readableFileSize(long size)
-
getUpload
public com.vaadin.flow.component.upload.Upload getUpload()
-
setUploadCaption
public void setUploadCaption(String uploadCaption)
-
-