Class GeneratedVaadinUploadFile<R extends GeneratedVaadinUploadFile<R>>

  • All Implemented Interfaces:
    com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable

    @Tag("vaadin-upload-file")
    @NpmPackage(value="@vaadin/polymer-legacy-adapter",
                version="23.0.0")
    @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/upload/src/vaadin-upload-file.js")
    public abstract class GeneratedVaadinUploadFile<R extends GeneratedVaadinUploadFile<R>>
    extends com.vaadin.flow.component.Component
    implements com.vaadin.flow.component.HasStyle

    Description copied from corresponding location in WebComponent:

    <vaadin-upload-file> element represents a file in the file list of <vaadin-upload>.

    Styling

    The following shadow DOM parts are available for styling:

    Part name Description
    row File container
    info Container for file status icon, file name, status and error messages
    done-icon File done status icon
    warning-icon File warning status icon
    meta Container for file name, status and error messages
    name File name
    error Error message, shown when error happens
    status Status message
    commands Container for file command icons
    start-button Start file upload button
    retry-button Retry file upload button
    clear-button Clear file button
    progress Progress bar

    The following state attributes are available for styling:

    Attribute Description Part name
    error An error has happened during uploading :host
    indeterminate Uploading is in progress, but the progress value is unknown :host
    uploading Uploading is in progress :host
    complete Uploading has finished successfully :host

    See ThemableMixin – how to apply styles for shadow parts

    See Also:
    Serialized Form
    • Constructor Detail

      • GeneratedVaadinUploadFile

        public GeneratedVaadinUploadFile()
    • Method Detail

      • getFileJsonObject

        protected elemental.json.JsonObject getFileJsonObject()
        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
        Returns:
        the file property from the webcomponent
      • setFile

        protected void setFile​(elemental.json.JsonObject file)
        Parameters:
        file - the JsonObject value to set
      • addFileAbortListener

        protected com.vaadin.flow.shared.Registration addFileAbortListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinUploadFile.FileAbortEvent<R>> listener)
        Adds a listener for file-abort events fired by the webcomponent.
        Parameters:
        listener - the listener
        Returns:
        a Registration for removing the event listener
      • addFileRemoveListener

        protected com.vaadin.flow.shared.Registration addFileRemoveListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinUploadFile.FileRemoveEvent<R>> listener)
        Adds a listener for file-remove events fired by the webcomponent.
        Parameters:
        listener - the listener
        Returns:
        a Registration for removing the event listener
      • addFileRetryListener

        protected com.vaadin.flow.shared.Registration addFileRetryListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinUploadFile.FileRetryEvent<R>> listener)
        Adds a listener for file-retry events fired by the webcomponent.
        Parameters:
        listener - the listener
        Returns:
        a Registration for removing the event listener
      • addFileStartListener

        protected com.vaadin.flow.shared.Registration addFileStartListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinUploadFile.FileStartEvent<R>> listener)
        Adds a listener for file-start events fired by the webcomponent.
        Parameters:
        listener - the listener
        Returns:
        a Registration for removing the event listener