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

项目:osc-core    文件:ApplianceUploader.java   
public ApplianceUploader() {
    this.upload = new Upload();
    this.upload.setButtonCaption(null);
    this.upload.setReceiver(this);
    this.upload.addFailedListener(this);
    this.upload.setImmediate(false);

    final UploadInfoWindow uploadInfoWindow = new UploadInfoWindow(this.upload);

    this.upload.addStartedListener(new StartedListener() {
        @Override
        public void uploadStarted(final StartedEvent event) {
            if (uploadInfoWindow.getParent() == null) {
                ViewUtil.addWindow(uploadInfoWindow);
            }
        }
    });

    this.verLayout.setSpacing(true);
    this.verLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
    this.verLayout.addComponent(this.upload);

    this.panel.setWidth("100%");
    this.panel.setContent(this.verLayout);
    setCompositionRoot(this.panel);
}
项目:osc-core    文件:SslCertificateUploader.java   
protected void createUpload() {
    this.upload = new Upload();
    this.upload.setButtonCaption(getString(MAINTENANCE_SSLCONFIGURATION_UPLOAD));
    this.upload.setReceiver(this);
    this.upload.addFailedListener(this);
    this.upload.addSucceededListener(this);
    this.upload.setImmediate(false);

    final UploadInfoWindow uploadInfoWindow = new UploadInfoWindow(this.upload);

    this.upload.addStartedListener((StartedListener) event -> {
        if (uploadInfoWindow.getParent() == null) {
            ViewUtil.addWindow(uploadInfoWindow);
        }
    });
}
项目:osc-core    文件:PluginUploader.java   
public PluginUploader(ServerApi server) {
    this.server = server;

    this.upload = new Upload();
    this.upload.setButtonCaption("Upload");
    this.upload.setReceiver(this);
    this.upload.addFailedListener(this);
    this.upload.addSucceededListener(this);
    this.upload.setImmediate(false);

    final UploadInfoWindow uploadInfoWindow = new UploadInfoWindow(this.upload);

    this.upload.addStartedListener(new StartedListener() {
        @Override
        public void uploadStarted(final StartedEvent event) {
            if (uploadInfoWindow.getParent() == null) {
                ViewUtil.addWindow(uploadInfoWindow);
            }
        }
    });

    this.verLayout.setSpacing(true);
    this.verLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
    this.verLayout.addComponent(this.upload);

    this.panel.setWidth("100%");
    this.panel.setContent(this.verLayout);
    setCompositionRoot(this.panel);
}
项目:osc-core    文件:DbRestorer.java   
public DbRestorer(RestoreServiceApi restoreService, ServerApi server, ValidationApi validator) {
    this.restoreService = restoreService;
    this.server = server;
    this.validator = validator;
    this.upload = new Upload();
    this.upload.setButtonCaption(VmidcMessages.getString(VmidcMessages_.UPLOAD_RESTORE));
    this.upload.setReceiver(this);
    this.upload.addFailedListener(this);
    this.upload.addSucceededListener(this);
    this.upload.setImmediate(false);

    final UploadInfoWindow uploadInfoWindow = new UploadInfoWindow(this.upload);

    this.upload.addStartedListener(new StartedListener() {
        @Override
        public void uploadStarted(final StartedEvent event) {
            if (uploadInfoWindow.getParent() == null) {
                ViewUtil.addWindow(uploadInfoWindow);
            }
        }
    });

    this.verLayout.setSpacing(true);
    this.panel.setWidth("100%");
    this.panel.setContent(this.verLayout);
    this.verLayout.addComponent(this.upload);
    this.verLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
    setCompositionRoot(this.panel);
}
项目:SecureBPMN    文件:UploadComponent.java   
protected void addUpload() {
  this.upload = new Upload(null, receiver);
  upload.setButtonCaption(i18nManager.getMessage(Messages.UPLOAD_SELECT));
  upload.setImmediate(true);
  addComponent(upload);
  setComponentAlignment(upload, Alignment.MIDDLE_CENTER);

  // register ourselves as listener for upload events
  upload.addListener((StartedListener) this);
  upload.addListener((FailedListener) this);
  upload.addListener((FinishedListener) this);
  upload.addListener((ProgressListener) this);
}
项目:SecureBPMN    文件:UploadComponent.java   
public void uploadStarted(StartedEvent event) {
  removeAllComponents(); // Visible components are replaced by a progress bar

  this.progressIndicator = new ProgressIndicator();
  progressIndicator.setPollingInterval(500);
  addComponent(progressIndicator);
  setComponentAlignment(progressIndicator, Alignment.MIDDLE_CENTER);

  for (StartedListener startedListener : startedListeners) {
    startedListener.uploadStarted(event);
  }
}
项目:SecureBPMN    文件:InMemoryUploadReceiver.java   
/**
 * @param upload The component that will serve this receiver
 * @param maxFileSize The maximum size of files that will be accepted (in bytes). -1 in case of no limit.
 */
public InMemoryUploadReceiver(Upload upload, long maxFileSize) {
  this.upload = upload;
  this.maxFileSize = maxFileSize;
  this.notificationManager = ExplorerApp.get().getNotificationManager();

  upload.setReceiver(this);
  upload.addListener((StartedListener) this);
  upload.addListener((ProgressListener) this);
}
项目:FiWare-Template-Handler    文件:UploadComponent.java   
protected void addUpload() {
  this.upload = new Upload(null, receiver);
  upload.setButtonCaption(i18nManager.getMessage(Messages.UPLOAD_SELECT));
  upload.setImmediate(true);
  addComponent(upload);
  setComponentAlignment(upload, Alignment.MIDDLE_CENTER);

  // register ourselves as listener for upload events
  upload.addListener((StartedListener) this);
  upload.addListener((FailedListener) this);
  upload.addListener((FinishedListener) this);
  upload.addListener((ProgressListener) this);
}
项目:FiWare-Template-Handler    文件:UploadComponent.java   
public void uploadStarted(StartedEvent event) {
  removeAllComponents(); // Visible components are replaced by a progress bar

  this.progressIndicator = new ProgressIndicator();
  progressIndicator.setPollingInterval(500);
  addComponent(progressIndicator);
  setComponentAlignment(progressIndicator, Alignment.MIDDLE_CENTER);

  for (StartedListener startedListener : startedListeners) {
    startedListener.uploadStarted(event);
  }
}
项目:FiWare-Template-Handler    文件:InMemoryUploadReceiver.java   
/**
 * @param upload The component that will serve this receiver
 * @param maxFileSize The maximum size of files that will be accepted (in bytes). -1 in case of no limit.
 */
public InMemoryUploadReceiver(Upload upload, long maxFileSize) {
  this.upload = upload;
  this.maxFileSize = maxFileSize;
  this.notificationManager = ExplorerApp.get().getNotificationManager();

  upload.setReceiver(this);
  upload.addListener((StartedListener) this);
  upload.addListener((ProgressListener) this);
}
项目:scoutmaster    文件:ImportSelectFile.java   
private void startListener()
{
    this.upload.addStartedListener(new StartedListener()
    {
        private static final long serialVersionUID = 1L;

        @Override
        public void uploadStarted(final StartedEvent event)
        {
            ImportSelectFile.this.uploadStarted = true;
            ImportSelectFile.this.uploadComplete = false;
        }
    });
}
项目:SecureBPMN    文件:UploadComponent.java   
public void addStartedListener(StartedListener startedListener) {
  startedListeners.add(startedListener);
}
项目:SecureBPMN    文件:UploadPopupWindow.java   
public void addStartedListener(StartedListener startedListener) {
  uploadComponent.addStartedListener(startedListener);
}
项目:FiWare-Template-Handler    文件:UploadComponent.java   
public void addStartedListener(StartedListener startedListener) {
  startedListeners.add(startedListener);
}
项目:FiWare-Template-Handler    文件:UploadPopupWindow.java   
public void addStartedListener(StartedListener startedListener) {
  uploadComponent.addStartedListener(startedListener);
}
项目:vaadin-fluent-api    文件:FluentUpload.java   
/**
 * Adds the upload started event listener.
 *
 * @param listener
 *            the Listener to be added, not null
 * @return this for method chaining
 * @see Upload#addStartedListener(StartedListener)
 */
@SuppressWarnings("unchecked")
public default THIS withStartedListener(StartedListener listener) {
    ((Upload) this).addStartedListener(listener);
    return (THIS) this;
}