• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FinishedListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vaadin.ui.Upload.FinishedListener的典型用法代码示例。如果您正苦于以下问题:Java FinishedListener类的具体用法?Java FinishedListener怎么用?Java FinishedListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FinishedListener类属于com.vaadin.ui.Upload包,在下文中一共展示了FinishedListener类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initChangePictureButton

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
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;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:25,代码来源:ProfilePanel.java


示例2: addUpload

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
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);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:14,代码来源:UploadComponent.java


示例3: uploadFinished

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
public void uploadFinished(FinishedEvent event) {
  // Hide progress indicator
  progressIndicator.setVisible(false);
  for (FinishedListener finishedListener : finishedListeners) {
    finishedListener.uploadFinished(event);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:UploadComponent.java


示例4: UploadPopupWindow

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
public UploadPopupWindow(String caption, String description, Receiver receiver) {
  this.i18nManager = ExplorerApp.get().getI18nManager();
  
  init(caption, description, receiver);
  
  uploadComponent.addFinishedListener(new FinishedListener() {
    
    private static final long serialVersionUID = 1L;

    public void uploadFinished(FinishedEvent event) {
      close();
    }
  });
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:15,代码来源:UploadPopupWindow.java


示例5: UploadComponent

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
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);
 }
 
开发者ID:nyholmniklas,项目名称:vaadinInvoiceGenerator,代码行数:31,代码来源:UploadComponent.java


示例6: addFinishedListener

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
public void addFinishedListener(FinishedListener finishedListener) {
  finishedListeners.add(finishedListener);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:UploadComponent.java


示例7: addFinishedListener

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
public void addFinishedListener(FinishedListener finishedListener) {
  uploadComponent.addFinishedListener(finishedListener);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:UploadPopupWindow.java


示例8: initFileUpload

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
protected void initFileUpload() {
  uploadComponent = new UploadComponent(null, new Receiver() {
    private static final long serialVersionUID = 1L;
    
    public OutputStream receiveUpload(String filename, String mType) {
      fileName = filename;
      
      // Try extracting the extention as well, and append it to the mime-type
      String extention = extractExtention(filename);
      if(extention != null) {
        mimeType = mType + MIME_TYPE_EXTENTION_SPLIT_CHAR + extention;
      } else {
        mimeType = mType;
      }
      
      // TODO: Refactor, don't use BAOS!!
      byteArrayOutputStream = new ByteArrayOutputStream();
      return byteArrayOutputStream;
    }
  });
  
  uploadComponent.addFinishedListener(new FinishedListener() {
    
    private static final long serialVersionUID = 1L;

    public void uploadFinished(FinishedEvent event) {
      // Update UI
      if(getAttachmentName() == null || "".equals(getAttachmentName())) {
        setAttachmentName(getFriendlyName(fileName));
      }
      
      fileUploaded = true;
      successIndicator.setVisible(true);
      successIndicator.setCaption(i18nManager.getMessage(Messages.RELATED_CONTENT_TYPE_FILE_UPLOADED, fileName));
      form.setComponentError(null);
    }
  });
  
  addComponent(uploadComponent);
  setExpandRatio(uploadComponent, 1.0f);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:42,代码来源:FileAttachmentEditorComponent.java


示例9: withFinishedListener

import com.vaadin.ui.Upload.FinishedListener; //导入依赖的package包/类
/**
 * Adds the upload received event listener.
 *
 * @param listener
 *            the Listener to be added, not null
 * @return this for method chaining
 * @see Upload#addFinishedListener(FinishedListener)
 */
@SuppressWarnings("unchecked")
public default THIS withFinishedListener(FinishedListener listener) {
    ((Upload) this).addFinishedListener(listener);
    return (THIS) this;
}
 
开发者ID:viydaag,项目名称:vaadin-fluent-api,代码行数:14,代码来源:FluentUpload.java



注:本文中的com.vaadin.ui.Upload.FinishedListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ImmutableNavbarComponent类代码示例发布时间:2022-05-22
下一篇:
Java Message类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap