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


Java StartedEvent类代码示例

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


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

示例1: ApplianceUploader

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
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);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:27,代码来源:ApplianceUploader.java

示例2: uploadStarted

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
/**
 * Upload started for {@link Upload} variant.
 *
 * @see com.vaadin.ui.Upload.StartedListener#uploadStarted(com.vaadin.ui.Upload.StartedEvent)
 */
@Override
public void uploadStarted(final StartedEvent event) {
    uploadInterrupted = false;
    selectedSwForUpload = null;

    final Optional<Long> selectedBaseSwModuleId = artifactUploadState.getSelectedBaseSwModuleId();
    if (selectedBaseSwModuleId.isPresent()) {
        selectedSwForUpload = softwareModuleManagement.get(selectedBaseSwModuleId.get()).orElse(null);
    }

    if (selectedSwForUpload != null && view.checkIfSoftwareModuleIsSelected()
            && !view.checkIfFileIsDuplicate(event.getFilename(), selectedSwForUpload)) {
        LOG.debug("Upload started for file :{}", event.getFilename());
        eventBus.publish(this, new UploadStatusEvent(UploadStatusEventType.UPLOAD_STARTED,
                new UploadFileStatus(event.getFilename(), 0, 0, selectedSwForUpload)));
    } else {
        failureReason = i18n.getMessage("message.upload.failed");
        upload.interruptUpload();
        // actual interrupt will happen a bit late so setting the below
        // flag
        uploadInterrupted = true;
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:29,代码来源:UploadHandler.java

示例3: PluginUploader

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
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);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:30,代码来源:PluginUploader.java

示例4: DbRestorer

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
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);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:30,代码来源:DbRestorer.java

示例5: uploadStarted

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
@Override
public void uploadStarted(final StartedEvent event) {
    this.progressBar.setValue(0f);
    this.progressBar.setVisible(true);
    this.bytesProcessed.setVisible(true);
    this.file.setValue(event.getFilename());
    this.cancelButton.setVisible(true);
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:9,代码来源:UploadInfoWindow.java

示例6: uploadStarted

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
@Override
public void uploadStarted(final StartedEvent event) {
	// this method gets called immediately after upload is started
	progressBar.setValue(0f);
	progressBar.setVisible(true);
	UI.getCurrent().setPollInterval(500);
	textualProgress.setVisible(true);
	// updates to client
	state.setValue("Cargando");
	fileName.setValue(event.getFilename());

	cancelButton.setVisible(true);
}
 
开发者ID:damiancom,项目名称:garantia,代码行数:14,代码来源:UploadInfoWindow.java

示例7: uploadStarted

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
@Override
public void uploadStarted(final StartedEvent event) {
    if (!event.getFilename().endsWith(".csv")) {

        new HawkbitErrorNotificationMessage(SPUILabelDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE, null,
                i18n.getMessage("bulk.targets.upload"), true).show(Page.getCurrent());
        LOG.error("Wrong file format for file {}", event.getFilename());
        upload.interruptUpload();
    } else {
        eventBus.publish(this, new TargetTableEvent(TargetComponentEvent.BULK_TARGET_UPLOAD_STARTED));
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:13,代码来源:BulkUploadHandler.java

示例8: uploadStarted

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

示例9: uploadStarted

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
public void uploadStarted(StartedEvent event) {
	super.uploadStarted(event);
	long l = event.getContentLength();
	if(l < getMaxContentLength()) {
		stream.reset();
		jImage.createImage();
	}
}
 
开发者ID:lkumarjain,项目名称:jain-I18n,代码行数:9,代码来源:JImageUpload.java

示例10: uploadStarted

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
public void uploadStarted(StartedEvent event) {
	pi.setVisible(true);
	upload.setVisible(false);

	long l = event.getContentLength();
	if(l > maxContentLength) {
		interruptUpload();
	}
}
 
开发者ID:lkumarjain,项目名称:jain-I18n,代码行数:10,代码来源:JUploader.java

示例11: startListener

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

示例12: uploadStarted

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
public void uploadStarted(StartedEvent event) {
  checkFileSize(event.getContentLength());
  if (!interrupted) { // upload can be interrupted by invalid file size
    checkMimeType(event.getMIMEType());
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:7,代码来源:InMemoryUploadReceiver.java

示例13: uploadStarted

import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
@Override
public void uploadStarted(StartedEvent event) {
	progressBar.setValue(0.0f);
	setComponentsToVisible(true);
	//progressBar.setPollingInterval(100);
}
 
开发者ID:mwolski89,项目名称:own-music-cloud,代码行数:7,代码来源:MusicUploader.java


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