Package io.jmix.ui.component.impl
Class FileUploadFieldImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractComponent<T>
io.jmix.ui.component.impl.AbstractValueComponent<T,P,V>
io.jmix.ui.component.impl.AbstractField<JmixFileUploadField,String,R>
io.jmix.ui.component.impl.AbstractSingleFileUploadField<byte[]>
io.jmix.ui.component.impl.FileUploadFieldImpl
- All Implemented Interfaces:
AttachNotifier
,Buffered
,Component
,Component.BelongToFrame
,Component.Editable
,Component.Focusable
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,Component.HasXmlDescriptor
,Component.Wrapper
,HasValueSource<byte[]>
,Field<byte[]>
,FileUploadField
,HasContextHelp
,HasDebugId
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,HasValidator<byte[]>
,HasValue<byte[]>
,Requirable
,SingleFileUploadField
,UploadField
,Validatable
,org.springframework.beans.factory.InitializingBean
public class FileUploadFieldImpl
extends AbstractSingleFileUploadField<byte[]>
implements FileUploadField
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.component.impl.AbstractSingleFileUploadField
AbstractSingleFileUploadField.JmixSingleFileUploadField
Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V>
Nested classes/interfaces inherited from interface io.jmix.ui.component.SingleFileUploadField
SingleFileUploadField.AfterValueClearEvent, SingleFileUploadField.BeforeValueClearEvent, SingleFileUploadField.FileUploadSucceedEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.UploadField
UploadField.DropZone, UploadField.FileUploadErrorEvent, UploadField.FileUploadEvent, UploadField.FileUploadFinishEvent, UploadField.FileUploadStartEvent
-
Field Summary
Fields inherited from class io.jmix.ui.component.impl.AbstractSingleFileUploadField
accept, BYTES_IN_MEGABYTE, componentProperties, contentProvider, downloader, dropZone, dropZonePrompt, fileName, fileSizeLimit, messages, notifications, pasteZone, permittedExtensions
Fields inherited from class io.jmix.ui.component.impl.AbstractField
editable, parentEditableChangeListener, validators, VALIDATORS_LIST_INITIAL_CAPACITY
Fields inherited from class io.jmix.ui.component.impl.AbstractValueComponent
internalValue, uiTestIdsSupport, valueBinding
Fields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Fields inherited from interface io.jmix.ui.component.FileUploadField
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
convertToPresentation
(byte[] modelValue) protected void
onFileNameClick
(com.vaadin.ui.Button.ClickEvent e) protected void
protected OutputStream
receiveUpload
(String fileName, String MIMEType) void
setFileName
(String filename) Sets caption to be shown in the file download link next to upload button.protected void
valueBindingConnected
(ValueSource<byte[]> valueSource) Methods inherited from class io.jmix.ui.component.impl.AbstractSingleFileUploadField
addAfterValueClearListener, addBeforeValueClearListener, addFileUploadErrorListener, addFileUploadFinishListener, addFileUploadStartListener, addFileUploadSucceedListener, afterPropertiesSet, clearButtonClicked, commit, createComponent, discard, fireFileUploadError, fireFileUploadFinish, fireFileUploadStart, fireFileUploadSucceed, focus, getAccept, getActualFileSizeLimit, getClearButtonCaption, getClearButtonDescription, getClearButtonIcon, getContentProvider, getDropZone, getDropZonePrompt, getFileSizeLimit, getFileSizeLimitString, getPasteZone, getPermittedExtensions, getTabIndex, getUploadButtonCaption, getUploadButtonDescription, getUploadButtonIcon, initComponent, internalValueChanged, isBuffered, isModified, isShowClearButton, isShowFileName, onFileExtensionNotAllowed, onFileSizeLimitExceeded, onUploadFailed, onUploadFinished, onUploadStarted, setAccept, setBuffered, setClearButtonCaption, setClearButtonDescription, setClearButtonIcon, setComponentProperties, setContentProvider, setDownloader, setDropZone, setDropZonePrompt, setFileSizeLimit, setMessages, setNotifications, setPasteZone, setPermittedExtensions, setShowClearButton, setShowFileName, setTabIndex, setUploadButtonCaption, setUploadButtonDescription, setUploadButtonIcon
Methods inherited from class io.jmix.ui.component.impl.AbstractField
addValidator, attachValueChangeListener, getDatatypeConversionErrorMsg, getDefaultRequiredMessage, getErrorMessage, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeValidator, setEditable, setEditableToComponent, setParent, setRequired, setRequiredMessage, setupComponentErrorProvider, triggerValidators, validate
Methods inherited from class io.jmix.ui.component.impl.AbstractValueComponent
addValueChangeListener, componentValueChanged, convertToModel, fieldValueEquals, getValue, getValueSource, setUiTestId, setUiTestIdsSupport, setValue, setValueSource, setValueToPresentation, valueBindingActivated
Methods inherited from class io.jmix.ui.component.impl.AbstractComponent
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.ui.component.Buffered
commit, discard, isBuffered, isModified, setBuffered
Methods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditable
Methods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
Methods inherited from interface io.jmix.ui.component.HasValidator
addValidator, addValidators, getValidators, removeValidator
Methods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
Methods inherited from interface io.jmix.ui.component.data.HasValueSource
getValueSource, setValueSource
Methods inherited from interface io.jmix.ui.component.Requirable
getRequiredMessage, isRequired, setRequired, setRequiredMessage
Methods inherited from interface io.jmix.ui.component.SingleFileUploadField
addAfterValueClearListener, addBeforeValueClearListener, addFileUploadSucceedListener, getClearButtonCaption, getClearButtonDescription, getClearButtonIcon, getContentProvider, getUploadButtonCaption, getUploadButtonDescription, getUploadButtonIcon, isShowClearButton, isShowFileName, setClearButtonCaption, setClearButtonDescription, setClearButtonIcon, setContentProvider, setShowClearButton, setShowFileName, setUploadButtonCaption, setUploadButtonDescription, setUploadButtonIcon
Methods inherited from interface io.jmix.ui.component.UploadField
addFileUploadErrorListener, addFileUploadFinishListener, addFileUploadStartListener, getAccept, getDropZone, getDropZonePrompt, getFileSizeLimit, getPasteZone, getPermittedExtensions, setAccept, setDropZone, setDropZonePrompt, setFileSizeLimit, setPasteZone, setPermittedExtensions
Methods inherited from interface io.jmix.ui.component.Validatable
isValid, isValidateOnCommit, validate
-
Field Details
-
outputStream
-
-
Constructor Details
-
FileUploadFieldImpl
public FileUploadFieldImpl()
-
-
Method Details
-
valueBindingConnected
- Overrides:
valueBindingConnected
in classAbstractValueComponent<JmixFileUploadField,
String, byte[]>
-
onFileNameClick
protected void onFileNameClick(com.vaadin.ui.Button.ClickEvent e) - Specified by:
onFileNameClick
in classAbstractSingleFileUploadField<byte[]>
-
receiveUpload
- Specified by:
receiveUpload
in classAbstractSingleFileUploadField<byte[]>
-
onUploadSucceeded
- Overrides:
onUploadSucceeded
in classAbstractSingleFileUploadField<byte[]>
-
convertToPresentation
@Nullable protected String convertToPresentation(@Nullable byte[] modelValue) throws ConversionException - Overrides:
convertToPresentation
in classAbstractValueComponent<JmixFileUploadField,
String, byte[]> - Throws:
ConversionException
-
getFileName
- Specified by:
getFileName
in interfaceFileUploadField
- Overrides:
getFileName
in classAbstractSingleFileUploadField<byte[]>
- Returns:
- caption to be shown in the file download link next to upload button
-
setFileName
Description copied from interface:FileUploadField
Sets caption to be shown in the file download link next to upload button. The file name of the newly uploaded file will rewrite the caption.By default: "attachment (file_size Kb)".
- Specified by:
setFileName
in interfaceFileUploadField
-
getFileContent
- Specified by:
getFileContent
in interfaceSingleFileUploadField
- Returns:
- content of uploaded file.
-