X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=rcp%2Forg.argeo.eclipse.ui.rcp%2Fsrc%2Forg%2Feclipse%2Frap%2Ffileupload%2FFileUploadListener.java;fp=rcp%2Forg.argeo.eclipse.ui.rcp%2Fsrc%2Forg%2Feclipse%2Frap%2Ffileupload%2FFileUploadListener.java;h=b59fd39ea83f799e0995f2412f7d321d61818224;hb=05b37fe95b9379c17061463d84f67145c2e11371;hp=0000000000000000000000000000000000000000;hpb=54453ccd2a0525236250c150f6b720e8fcac5c53;p=lgpl%2Fargeo-commons.git diff --git a/rcp/org.argeo.eclipse.ui.rcp/src/org/eclipse/rap/fileupload/FileUploadListener.java b/rcp/org.argeo.eclipse.ui.rcp/src/org/eclipse/rap/fileupload/FileUploadListener.java new file mode 100644 index 000000000..b59fd39ea --- /dev/null +++ b/rcp/org.argeo.eclipse.ui.rcp/src/org/eclipse/rap/fileupload/FileUploadListener.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 EclipseSource and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - initial API and implementation + ******************************************************************************/ +package org.eclipse.rap.fileupload; + +import org.eclipse.swt.widgets.Display; + + +/** + * Listener to react on progress and completion of a file upload. + *

+ * Note: This listener will be called from a different thread than the UI thread. + * Implementations must use {@link Display#asyncExec(Runnable)} to access the UI. + *

+ * + * @see FileUploadEvent + */ +public interface FileUploadListener { + + /** + * Called when new information about an in-progress upload is available. + * + * @param event event object that contains information about the uploaded file + * @see FileUploadEvent#getBytesRead() + */ + void uploadProgress( FileUploadEvent event ); + + /** + * Called when a file upload has finished successfully. + * + * @param event event object that contains information about the uploaded file + * @see FileUploadEvent + */ + void uploadFinished( FileUploadEvent event ); + + /** + * Called when a file upload failed. + * + * @param event event object that contains information about the uploaded file + * @see FileUploadEvent#getErrorMessage() + */ + void uploadFailed( FileUploadEvent event ); + +}