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
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addValueChangeListener
(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField, byte[]>> listener) com.vaadin.flow.component.upload.Upload
byte[]
getValue()
boolean
boolean
static String
readableFileSize
(long size) void
setDownloadFileName
(String downloadFileName) Sets the name of the file that people download if they download the file directlyvoid
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.void
setReadOnly
(boolean bln) void
setRequiredIndicatorVisible
(boolean bln) void
setUploadCaption
(String uploadCaption) void
setValue
(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, 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.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
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.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:
addValueChangeListener
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,
byte[]>, byte[]>
-
setReadOnly
public void setReadOnly(boolean bln) - Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,
byte[]>, byte[]>
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,
byte[]>, byte[]>
-
setRequiredIndicatorVisible
public void setRequiredIndicatorVisible(boolean bln) - Specified by:
setRequiredIndicatorVisible
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,
byte[]>, byte[]>
-
isRequiredIndicatorVisible
public boolean isRequiredIndicatorVisible()- Specified by:
isRequiredIndicatorVisible
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,
byte[]>, byte[]>
-
setValue
public void setValue(byte[] v) - Specified by:
setValue
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ByteArrayUploadField,
byte[]>, byte[]>
-
getValue
public byte[] getValue()- Specified by:
getValue
in 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
-