当前位置: 首页>>代码示例>>Java>>正文


Java ProgressListener类代码示例

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


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

示例1: progressListener

import com.vaadin.ui.Upload.ProgressListener; //导入依赖的package包/类
private void progressListener()
{
	this.upload.addProgressListener(new ProgressListener()
	{
		private static final long serialVersionUID = 1L;

		@Override
		public void updateProgress(final long readBytes, final long contentLength)
		{
			UI ui = UI.getCurrent();
			ui.access(() -> {
				ImportSelectFile.this.progressBar
						.setCaption("Uploaded: " + (float) readBytes / (float) contentLength * 100 + "%");
				ImportSelectFile.this.progressBar.setValue((float) readBytes / (float) contentLength);
				ImportSelectFile.this.progressBar.setVisible(true);
			});
		}
	});
}
 
开发者ID:bsutton,项目名称:scoutmaster,代码行数:20,代码来源:ImportSelectFile.java

示例2: addUpload

import com.vaadin.ui.Upload.ProgressListener; //导入依赖的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: updateProgress

import com.vaadin.ui.Upload.ProgressListener; //导入依赖的package包/类
public void updateProgress(long readBytes, long contentLength) {
  progressIndicator.setValue(new Float(readBytes / (float) contentLength));
  
  for (ProgressListener progressListener : progressListeners) {
    progressListener.updateProgress(readBytes, contentLength);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:UploadComponent.java

示例4: InMemoryUploadReceiver

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

示例5: UploadComponent

import com.vaadin.ui.Upload.ProgressListener; //导入依赖的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: addProgressListener

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

示例7: addProgressListener

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

示例8: withProgressListener

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


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