Package io.jmix.flowui.component.upload
Class JmixUpload<V>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.upload.Upload
io.jmix.flowui.component.upload.JmixUpload<V>
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.upload.UploadVariant>,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class JmixUpload<V>
extends com.vaadin.flow.component.upload.Upload
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected Messages -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddUploadFailedListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.upload.FailedEvent> listener) Registers a listener that will be notified when a file upload failed.com.vaadin.flow.shared.RegistrationaddUploadFinishedListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.upload.FinishedEvent> listener) Registers a listener that will be notified when a file upload finished.com.vaadin.flow.shared.RegistrationaddUploadProgressListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.upload.ProgressUpdateEvent> listener) Registers a listener that will be notified when a file upload progress changes.com.vaadin.flow.shared.RegistrationaddUploadStartedListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.upload.StartedEvent> listener) Registers a listener that will be notified when a file upload started.com.vaadin.flow.shared.RegistrationaddUploadSucceededListener(com.vaadin.flow.component.ComponentEventListener<UploadSucceededEvent<V>> listener) Registers a listener that will be notified when a file upload succeeds.voidprotected com.vaadin.flow.server.streams.TransferProgressListenerprotected voidinitI18n()protected voidonUploadComplete(com.vaadin.flow.server.streams.TransferContext context, long transferredBytes) protected voidonUploadError(com.vaadin.flow.server.streams.TransferContext context, IOException reason) protected voidonUploadProgress(com.vaadin.flow.server.streams.TransferContext context, long transferredBytes, long totalBytes) protected voidonUploadStart(com.vaadin.flow.server.streams.TransferContext context) protected voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetUploadHandler(com.vaadin.flow.server.streams.UploadHandler handler, String targetName) Methods inherited from class com.vaadin.flow.component.upload.Upload
addAllFinishedListener, addFailedListener, addFileRejectedListener, addFileRemovedListener, addFinishedListener, addProgressListener, addStartedListener, addSucceededListener, clearFileList, fireUpdateProgress, fireUpdateProgress, getAcceptedFileTypes, getDropLabel, getDropLabelIcon, getI18n, getMaxFiles, getMaxFileSize, getReceiver, getUploadButton, interruptUpload, isAutoUpload, isDropAllowed, isUploading, setAcceptedFileTypes, setAutoUpload, setDropAllowed, setDropLabel, setDropLabelIcon, setI18n, setMaxFiles, setMaxFileSize, setReceiver, setUploadButton, setUploadFormat, setUploadHandlerMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, 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.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariants
-
Field Details
-
messages
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
JmixUpload
public JmixUpload()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
initI18n
protected void initI18n() -
addUploadProgressListener
public com.vaadin.flow.shared.Registration addUploadProgressListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.upload.ProgressUpdateEvent> listener) Registers a listener that will be notified when a file upload progress changes.- Parameters:
listener- the listener to add- Returns:
- a
Registrationobject that allows the listener to be removed if no longer needed
-
addUploadFailedListener
public com.vaadin.flow.shared.Registration addUploadFailedListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.upload.FailedEvent> listener) Registers a listener that will be notified when a file upload failed.- Parameters:
listener- the listener to add- Returns:
- a
Registrationobject that allows the listener to be removed if no longer needed
-
addUploadFinishedListener
public com.vaadin.flow.shared.Registration addUploadFinishedListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.upload.FinishedEvent> listener) Registers a listener that will be notified when a file upload finished.- Parameters:
listener- the listener to add- Returns:
- a
Registrationobject that allows the listener to be removed if no longer needed
-
addUploadStartedListener
public com.vaadin.flow.shared.Registration addUploadStartedListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.upload.StartedEvent> listener) Registers a listener that will be notified when a file upload started.- Parameters:
listener- the listener to add- Returns:
- a
Registrationobject that allows the listener to be removed if no longer needed
-
addUploadSucceededListener
public com.vaadin.flow.shared.Registration addUploadSucceededListener(com.vaadin.flow.component.ComponentEventListener<UploadSucceededEvent<V>> listener) Registers a listener that will be notified when a file upload succeeds.- Parameters:
listener- the listener to add- Returns:
- a
Registrationobject that allows the listener to be removed if no longer needed
-
setUploadHandler
public void setUploadHandler(com.vaadin.flow.server.streams.UploadHandler handler, String targetName) - Overrides:
setUploadHandlerin classcom.vaadin.flow.component.upload.Upload
-
onUploadSuccess
-
onUploadStart
protected void onUploadStart(com.vaadin.flow.server.streams.TransferContext context) -
onUploadProgress
protected void onUploadProgress(com.vaadin.flow.server.streams.TransferContext context, long transferredBytes, long totalBytes) -
onUploadError
protected void onUploadError(com.vaadin.flow.server.streams.TransferContext context, IOException reason) -
onUploadComplete
protected void onUploadComplete(com.vaadin.flow.server.streams.TransferContext context, long transferredBytes) -
createDefaultTransferProgressListener
protected com.vaadin.flow.server.streams.TransferProgressListener createDefaultTransferProgressListener()
-