com.vaadin.ui.Upload.addListener()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中com.vaadin.ui.Upload.addListener()方法的一些代码示例,展示了Upload.addListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Upload.addListener()方法的具体详情如下:
包路径:com.vaadin.ui.Upload
类名称:Upload
方法名:addListener

Upload.addListener介绍

暂无

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Adds the upload started event listener.
 *
 * @param listener
 *            the Listener to be added, not null
 * @since 8.0
 */
public Registration addStartedListener(StartedListener listener) {
  return addListener(StartedEvent.class, listener, UPLOAD_STARTED_METHOD);
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Adds the upload received event listener.
 *
 * @param listener
 *            the Listener to be added, not null
 * @since 8.0
 */
public Registration addFinishedListener(FinishedListener listener) {
  return addListener(FinishedEvent.class, listener,
      UPLOAD_FINISHED_METHOD);
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Adds the upload interrupted event listener.
 *
 * @param listener
 *            the Listener to be added, not null
 * @since 8.0
 */
public Registration addFailedListener(FailedListener listener) {
  return addListener(FailedEvent.class, listener, UPLOAD_FAILED_METHOD);
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Adds the upload success event listener.
 *
 * @param listener
 *            the Listener to be added, not null
 * @since 8.0
 */
public Registration addSucceededListener(SucceededListener listener) {
  return addListener(SucceededEvent.class, listener,
      UPLOAD_SUCCEEDED_METHOD);
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Adds a filename change event listener.
 *
 * @param listener
 *            the Listener to add, not null
 * @since 8.0
 */
public Registration addChangeListener(ChangeListener listener) {
  return addListener(EventId.CHANGE, ChangeEvent.class, listener,
      ChangeListener.FILENAME_CHANGED);
}

代码示例来源:origin: apache/ace

/**
 * Install this upload handler for the given {@link Upload} component.
 * 
 * @param upload
 *            the upload component to install this handler on, cannot be <code>null</code>.
 */
public void install(Upload upload) {
  upload.setReceiver(this);
  upload.addListener((Upload.FailedListener) this);
  upload.addListener((Upload.FinishedListener) this);
  upload.addListener((Upload.ProgressListener) this);
  upload.addListener((Upload.SucceededListener) this);
}

代码示例来源:origin: org.aperteworkflow/base-widgets

public FileUploadComponent(I18NSource i18NSource) {
  this.i18NSource = i18NSource;
  uploadFile.addStyleName("default");
  uploadFile.setButtonCaption(i18NSource.getMessage(UPLOAD_START));
  uploadFile.addListener((FailedListener) this);
  uploadFile.addListener((FinishedListener) this);
  uploadFile.addListener((ProgressListener) this);
  uploadFile.addListener((StartedListener) this);
  uploadFile.addListener((SucceededListener) this);
  mainPanel.setMargin(true);
  initView();
  setCompositionRoot(mainPanel);
}

代码示例来源:origin: org.activiti/activiti-explorer

/**
 * @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);
}

代码示例来源:origin: org.activiti/activiti-explorer

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);
}

代码示例来源:origin: org.activiti/activiti-explorer

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);
}

代码示例来源:origin: org.aperteworkflow/gui-commons

private void initComponent() {
  progressIndicator = new ProgressIndicator();
  progressIndicator.setPollingInterval(100);
  progressIndicator.setSizeFull();
  resetAndHideProgressIndicator();
  upload = new Upload(null, this);
  upload.setImmediate(true);
  upload.addListener((Upload.SucceededListener) this);
  upload.addListener((Upload.FailedListener) this);
  upload.addListener((Upload.ProgressListener) this);
  addComponent(upload);
  addComponent(progressIndicator);
}

代码示例来源:origin: org.activiti/activiti-explorer

protected Upload initChangePictureButton() {
 final Upload changePictureUpload = new Upload();
 changePictureUpload.setImmediate(true);
 changePictureUpload.setButtonCaption(i18nManager.getMessage(Messages.PROFILE_CHANGE_PICTURE));
 
 final InMemoryUploadReceiver receiver = initPictureReceiver(changePictureUpload);
 changePictureUpload.addListener(new FinishedListener() {
  private static final long serialVersionUID = 1L;
  public void uploadFinished(FinishedEvent event) {
   if (!receiver.isInterruped()) {
    picture = new Picture(receiver.getBytes(), receiver.getMimeType());
    identityService.setUserPicture(userId, picture);
    
    // reset picture
    imageLayout.removeAllComponents();
    initPicture();
   } else {
    receiver.reset();
   }
  }
 });
 
 return changePictureUpload;
}

代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin

uploadArtifact.addListener(new Upload.SucceededListener() {
uploadArtifact.addListener(new Upload.FailedListener() {
  public void uploadFailed(FailedEvent event) {
    getMainWindow().showNotification(

相关文章