All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.fluorumlabs.disconnect.vaadin.UploadFile Maven / Gradle / Ivy

The newest version!
package com.github.fluorumlabs.disconnect.vaadin;

import com.github.fluorumlabs.disconnect.core.annotations.WebComponent;
import com.github.fluorumlabs.disconnect.vaadin.elements.UploadFileElement;
import com.github.fluorumlabs.disconnect.vaadin.types.UploadFileEvent;
import com.github.fluorumlabs.disconnect.vaadin.types.UploadingFile;
import com.github.fluorumlabs.disconnect.zero.component.AbstractComponent;
import com.github.fluorumlabs.disconnect.zero.component.Component;
import com.github.fluorumlabs.disconnect.zero.component.HasComponents;
import com.github.fluorumlabs.disconnect.zero.component.HasStyle;
import com.github.fluorumlabs.disconnect.zero.observable.ObservableEvent;

import javax.annotation.Nullable;

/**
 * <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 nameDescription
rowFile container
infoContainer for file status icon, file name, status and error messages
done-iconFile done status icon
warning-iconFile warning status icon
metaContainer for file name, status and error messages
nameFile name
errorError message, shown when error happens
statusStatus message
commandsContainer for file command icons
start-buttonStart file upload button
retry-buttonRetry file upload button
clear-buttonClear file button
progressProgress bar
* The following state attributes are available for styling: * * * * * * * * * * * *
AttributeDescriptionPart name
errorAn error has happened during uploading:host
indeterminateUploading is in progress, but the progress value is * unknown:host
uploadingUploading is in progress:host
completeUploading has finished successfully:host
* See * ThemableMixin – how to apply styles for shadow parts */ @WebComponent public class UploadFile extends AbstractComponent implements HasStyle, HasComponents> { public UploadFile() { super(UploadFileElement.TAGNAME()); } /** * */ @Nullable public UploadingFile file() { return getNode().getFile(); } /** * */ public UploadFile file(UploadingFile file) { getNode().setFile(file); return this; } /** * Fired when abort button is pressed. It is listened by vaadin-upload which * will abort the upload in progress, but will not remove the file from the list * to allow the animation to hide the element to be run. */ public ObservableEvent fileAbortEvent() { return createEvent("file-abort"); } /** * Fired after the animation to hide the element has finished. It is listened * by vaadin-upload which will actually remove the file from the upload * file list. */ public ObservableEvent fileRemoveEvent() { return createEvent("file-remove"); } /** * Fired when the retry button is pressed. It is listened by vaadin-upload * which will start a new upload process of this file. */ public ObservableEvent fileRetryEvent() { return createEvent("file-retry"); } /** * Fired when the start button is pressed. It is listened by vaadin-upload * which will start a new upload process of this file. */ public ObservableEvent fileStartEvent() { return createEvent("file-start"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy