本文整理汇总了Java中com.vaadin.ui.Upload.FailedListener类的典型用法代码示例。如果您正苦于以下问题:Java FailedListener类的具体用法?Java FailedListener怎么用?Java FailedListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FailedListener类属于com.vaadin.ui.Upload包,在下文中一共展示了FailedListener类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: failedListener
import com.vaadin.ui.Upload.FailedListener; //导入依赖的package包/类
private void failedListener()
{
this.upload.addFailedListener(new FailedListener()
{
private static final long serialVersionUID = 1L;
@Override
public void uploadFailed(final FailedEvent event)
{
UI ui = UI.getCurrent();
ui.access(() -> {
Notification
.show("The upload failed. " + event.getReason() + " Please fix the problem and try again.");
ImportSelectFile.this.uploadStarted = true;
ImportSelectFile.this.uploadComplete = false;
});
}
});
}
示例2: addUpload
import com.vaadin.ui.Upload.FailedListener; //导入依赖的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);
}
示例3: UploadComponent
import com.vaadin.ui.Upload.FailedListener; //导入依赖的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);
}
示例4: uploadFailed
import com.vaadin.ui.Upload.FailedListener; //导入依赖的package包/类
public void uploadFailed(FailedEvent event) {
for (FailedListener failedListener : failedListeners) {
failedListener.uploadFailed(event);
}
}
示例5: addFailedListener
import com.vaadin.ui.Upload.FailedListener; //导入依赖的package包/类
public void addFailedListener(FailedListener failedListener) {
failedListeners.add(failedListener);
}
示例6: addFailedListener
import com.vaadin.ui.Upload.FailedListener; //导入依赖的package包/类
public void addFailedListener(FailedListener failedListener) {
uploadComponent.addFailedListener(failedListener);
}
示例7: withFailedListener
import com.vaadin.ui.Upload.FailedListener; //导入依赖的package包/类
/**
* Adds the upload interrupted event listener.
*
* @param listener
* the Listener to be added, not null
* @return this for method chaining
* @see Upload#addFailedListener(FailedListener)
*/
@SuppressWarnings("unchecked")
public default THIS withFailedListener(FailedListener listener) {
((Upload) this).addFailedListener(listener);
return (THIS) this;
}