Java 类com.vaadin.ui.Upload.SucceededListener 实例源码

项目:osc-core    文件:ImportApplianceSoftwareVersionWindow.java   
@SuppressWarnings("serial")
private SucceededListener getUploadSucceededListener() {
    return new SucceededListener() {

        @Override
        public void uploadSucceeded(SucceededEvent event) {
            log.info("Upload Successful! Analyzing Uploaded Image.....");
            final ProgressIndicatorWindow progressIndicatorWindow = new ProgressIndicatorWindow();

            progressIndicatorWindow.setWidth("200px");
            progressIndicatorWindow.setHeight("100px");
            progressIndicatorWindow.setCaption("Processing image ...");

            UI.getCurrent().addWindow(progressIndicatorWindow);
            progressIndicatorWindow.bringToFront();

            Runnable serviceCall = uploadValidationService(progressIndicatorWindow, event);

            ScheduledExecutorService exec = Executors.newScheduledThreadPool(1);
            exec.schedule(serviceCall, 1, TimeUnit.MILLISECONDS);
        }
    };
}
项目:vaadinInvoiceGenerator    文件:UploadComponent.java   
public UploadComponent(String buttonCaption, String sessionId, int maxSize, String folderPath) {
     upload = new Upload();
     this.addComponent(upload);
     this.maxSize = maxSize;
     upload.setReceiver( this); 
     this.directory = folderPath;
     upload.setButtonCaption(buttonCaption);
     upload.addSucceededListener((Upload.SucceededListener) this);
     upload.addFailedListener((Upload.FailedListener) this);
     upload.addProgressListener((Upload.ProgressListener) this);
     upload.addFinishedListener((Upload.FinishedListener) this);

     processingLayout = new HorizontalLayout();
     processingLayout.setSpacing(true);
     processingLayout.setVisible(false);
     this.addComponent(processingLayout);

     progressBar = new ProgressBar();
     processingLayout.addComponent(progressBar);

     cancelProcessing = new Button("cancel", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
    cancelled = true;
             upload.interruptUpload();

}
     });
     processingLayout.addComponent(cancelProcessing);
 }
项目:vaadin-fluent-api    文件:FluentUpload.java   
/**
 * Adds the upload success event listener.
 *
 * @param listener
 *            the Listener to be added, not null
 * @return this for method chaining
 * @see Upload#addSucceededListener(SucceededListener)
 */
@SuppressWarnings("unchecked")
public default THIS withSucceededListener(SucceededListener listener) {
    ((Upload) this).addSucceededListener(listener);
    return (THIS) this;
}