Package io.jmix.ui.component.impl
Class FileStorageUploadFieldImpl
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<T>
io.jmix.ui.component.impl.AbstractFileStorageUploadField<FileRef>
io.jmix.ui.component.impl.FileStorageUploadFieldImpl
- All Implemented Interfaces:
AttachNotifier
,Buffered
,Component
,Component.BelongToFrame
,Component.Editable
,Component.Focusable
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,Component.HasXmlDescriptor
,Component.Wrapper
,HasValueSource<FileRef>
,Field<FileRef>
,FileStorageUploadField
,HasContextHelp
,HasDebugId
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,HasValidator<FileRef>
,HasValue<FileRef>
,Requirable
,SingleFileUploadField
,UploadField
,Validatable
,org.springframework.beans.factory.InitializingBean
public class FileStorageUploadFieldImpl
extends AbstractFileStorageUploadField<FileRef>
implements FileStorageUploadField
-
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.FileStorageUploadField
FileStorageUploadField.FileStoragePutMode
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.AbstractFileStorageUploadField
fileId, fileStorage, fileStorageLocator, fileStorageName, internalValueChangedOnUpload, mode, tempFileId, temporaryStorage
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.FileStorageUploadField
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
convertToPresentation
(FileRef modelValue) getMode()
protected void
onFileNameClick
(com.vaadin.ui.Button.ClickEvent e) protected void
protected void
void
setFileStorageName
(String fileStorageName) Sets the name of FileStorage where the upload file will be placed.void
Sets mode which determines when file will be put into FileStorage.protected void
valueBindingConnected
(ValueSource<FileRef> valueSource) Methods inherited from class io.jmix.ui.component.impl.AbstractFileStorageUploadField
checkFileStorageInitialized, getFileContent, getFileId, getFileName, internalValueChanged, onUploadFailed, receiveUpload, setFileStorageLocator, setTemporaryStorage
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, isBuffered, isModified, isShowClearButton, isShowFileName, onFileExtensionNotAllowed, onFileSizeLimitExceeded, 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.FileStorageUploadField
getFileId, getFileName
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
-
Constructor Details
-
FileStorageUploadFieldImpl
public FileStorageUploadFieldImpl()
-
-
Method Details
-
onUploadSucceeded
- Overrides:
onUploadSucceeded
in classAbstractSingleFileUploadField<FileRef>
-
saveFile
-
onFileNameClick
protected void onFileNameClick(com.vaadin.ui.Button.ClickEvent e) - Specified by:
onFileNameClick
in classAbstractSingleFileUploadField<FileRef>
-
valueBindingConnected
- Overrides:
valueBindingConnected
in classAbstractFileStorageUploadField<FileRef>
-
getFileContent
- Specified by:
getFileContent
in interfaceSingleFileUploadField
- Returns:
- content of uploaded file.
-
convertToPresentation
@Nullable protected String convertToPresentation(@Nullable FileRef modelValue) throws ConversionException - Overrides:
convertToPresentation
in classAbstractValueComponent<JmixFileUploadField,
String, FileRef> - Throws:
ConversionException
-
setFileStorageName
Description copied from interface:FileStorageUploadField
Sets the name of FileStorage where the upload file will be placed.- Specified by:
setFileStorageName
in interfaceFileStorageUploadField
- Parameters:
fileStorageName
- the name of file storage
-
getFileStorageName
- Specified by:
getFileStorageName
in interfaceFileStorageUploadField
- Returns:
- the name of FileStorage where the upload file will be placed
-
getMode
- Specified by:
getMode
in interfaceFileStorageUploadField
- Returns:
- mode which determines when file will be put into FileStorage.
-
setMode
Description copied from interface:FileStorageUploadField
Sets mode which determines when file will be put into FileStorage.- Specified by:
setMode
in interfaceFileStorageUploadField
-