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

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.context.ApplicationContext
     
    protected Messages
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    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.
    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.
    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.
    void
     
    protected com.vaadin.flow.server.streams.TransferProgressListener
     
    protected void
     
    protected void
    onUploadComplete(com.vaadin.flow.server.streams.TransferContext context, long transferredBytes)
     
    protected void
    onUploadError(com.vaadin.flow.server.streams.TransferContext context, IOException reason)
     
    protected void
    onUploadProgress(com.vaadin.flow.server.streams.TransferContext context, long transferredBytes, long totalBytes)
     
    protected void
    onUploadStart(com.vaadin.flow.server.streams.TransferContext context)
     
    protected void
     
    void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     
    void
    setUploadHandler(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, setUploadHandler

    Methods 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, 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.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    bindEnabled, isEnabled, setEnabled

    Methods 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, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasTheme

    addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant

    addThemeVariants, bindThemeVariant, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariants
  • Field Details

    • messages

      protected Messages 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:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.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 Registration object 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 Registration object 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 Registration object 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 Registration object 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 Registration object 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:
      setUploadHandler in class com.vaadin.flow.component.upload.Upload
    • onUploadSuccess

      protected void onUploadSuccess(SupportUploadSuccessHandler.UploadSuccessContext<?> context)
    • 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()