本文整理汇总了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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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;
}
});
}
示例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());
}
}
示例13: uploadStarted
import com.vaadin.ui.Upload.StartedEvent; //导入依赖的package包/类
@Override
public void uploadStarted(StartedEvent event) {
progressBar.setValue(0.0f);
setComponentsToVisible(true);
//progressBar.setPollingInterval(100);
}