com.vaadin.ui.Upload.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中com.vaadin.ui.Upload.<init>()方法的一些代码示例,展示了Upload.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Upload.<init>()方法的具体详情如下:
包路径:com.vaadin.ui.Upload
类名称:Upload
方法名:<init>

Upload.<init>介绍

[英]Creates a new instance of Upload. The receiver must be set before performing an upload.
[中]创建上载的新实例。在执行上传之前,必须设置接收器。

代码示例

代码示例来源:origin: org.activiti/activiti-explorer

  1. protected Upload initChangePictureButton() {
  2. final Upload changePictureUpload = new Upload();
  3. changePictureUpload.setImmediate(true);
  4. changePictureUpload.setButtonCaption(i18nManager.getMessage(Messages.PROFILE_CHANGE_PICTURE));
  5. final InMemoryUploadReceiver receiver = initPictureReceiver(changePictureUpload);
  6. changePictureUpload.addListener(new FinishedListener() {
  7. private static final long serialVersionUID = 1L;
  8. public void uploadFinished(FinishedEvent event) {
  9. if (!receiver.isInterruped()) {
  10. picture = new Picture(receiver.getBytes(), receiver.getMimeType());
  11. identityService.setUserPicture(userId, picture);
  12. // reset picture
  13. imageLayout.removeAllComponents();
  14. initPicture();
  15. } else {
  16. receiver.reset();
  17. }
  18. }
  19. });
  20. return changePictureUpload;
  21. }

代码示例来源:origin: org.activiti/activiti-explorer

  1. protected void addUpload() {
  2. this.upload = new Upload(null, receiver);
  3. upload.setButtonCaption(i18nManager.getMessage(Messages.UPLOAD_SELECT));
  4. upload.setImmediate(true);
  5. addComponent(upload);
  6. setComponentAlignment(upload, Alignment.MIDDLE_CENTER);
  7. // register ourselves as listener for upload events
  8. upload.addListener((StartedListener) this);
  9. upload.addListener((FailedListener) this);
  10. upload.addListener((FinishedListener) this);
  11. upload.addListener((ProgressListener) this);
  12. }

代码示例来源:origin: org.activiti/activiti-explorer

  1. protected void addUpload() {
  2. this.upload = new Upload(null, receiver);
  3. upload.setButtonCaption(i18nManager.getMessage(Messages.UPLOAD_SELECT));
  4. upload.setImmediate(true);
  5. addComponent(upload);
  6. setComponentAlignment(upload, Alignment.MIDDLE_CENTER);
  7. // register ourselves as listener for upload events
  8. upload.addListener((StartedListener) this);
  9. upload.addListener((FailedListener) this);
  10. upload.addListener((FinishedListener) this);
  11. upload.addListener((ProgressListener) this);
  12. }

代码示例来源:origin: org.aperteworkflow/gui-commons

  1. private void initComponent() {
  2. progressIndicator = new ProgressIndicator();
  3. progressIndicator.setPollingInterval(100);
  4. progressIndicator.setSizeFull();
  5. resetAndHideProgressIndicator();
  6. upload = new Upload(null, this);
  7. upload.setImmediate(true);
  8. upload.addListener((Upload.SucceededListener) this);
  9. upload.addListener((Upload.FailedListener) this);
  10. upload.addListener((Upload.ProgressListener) this);
  11. addComponent(upload);
  12. addComponent(progressIndicator);
  13. }

代码示例来源:origin: org.aperteworkflow/cmis-widget

  1. Upload upload = new Upload();
  2. upload.setButtonCaption(getI18NSource().getMessage("pt.ext.cmis.list.update.button"));
  3. upload.setReceiver(new UpdateReceiver(doc));
  4. if ("normal".equalsIgnoreCase(mode) || !hasAnyDocuments) {
  5. vl.addComponent(new Label(getI18NSource().getMessage("pt.ext.cmis.list.upload")));
  6. Upload upload = new Upload();
  7. upload.setImmediate(true);
  8. upload.setButtonCaption(getI18NSource().getMessage("pt.ext.cmis.list.upload.button"));

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

  1. void buildLayout() {
  2. final HorizontalLayout horizontalLayout = new HorizontalLayout();
  3. upload = new Upload();
  4. upload.setEnabled(false);
  5. upload.setButtonCaption(i18n.getMessage("caption.bulk.upload"));
  6. upload.setReceiver(this);
  7. upload.setImmediate(true);
  8. upload.setWidthUndefined();
  9. upload.addSucceededListener(this);
  10. upload.addFailedListener(this);
  11. upload.addStartedListener(this);
  12. horizontalLayout.addComponent(upload);
  13. horizontalLayout.setComponentAlignment(upload, Alignment.BOTTOM_RIGHT);
  14. setCompositionRoot(horizontalLayout);
  15. }

代码示例来源:origin: eclipse/hawkbit

  1. void buildLayout() {
  2. final HorizontalLayout horizontalLayout = new HorizontalLayout();
  3. upload = new Upload();
  4. upload.setEnabled(false);
  5. upload.setButtonCaption(i18n.getMessage("caption.bulk.upload"));
  6. upload.setReceiver(this);
  7. upload.setImmediate(true);
  8. upload.setWidthUndefined();
  9. upload.addSucceededListener(this);
  10. upload.addFailedListener(this);
  11. upload.addStartedListener(this);
  12. horizontalLayout.addComponent(upload);
  13. horizontalLayout.setComponentAlignment(upload, Alignment.BOTTOM_RIGHT);
  14. setCompositionRoot(horizontalLayout);
  15. }

代码示例来源:origin: nz.co.senanque/madura-workflow-vaadin

  1. public void load(final long pid) {
  2. panel.removeAllComponents();
  3. final Upload upload = new Upload(null, receiver);
  4. upload.setImmediate(true);
  5. upload.setButtonCaption(m_messageSourceAccessor.getMessage("upload.file", "Upload File"));
  6. checkbox = new CheckBox(m_messageSourceAccessor.getMessage("upload.protected", "Protected"));
  7. comment = new TextField(m_messageSourceAccessor.getMessage("upload.comment", "Comment"));
  8. panel.addComponent(comment);
  9. panel.addComponent(checkbox);
  10. panel.addComponent(upload);
  11. upload.addFinishedListener(new Upload.FinishedListener() {
  12. private static final long serialVersionUID = 1L;
  13. public void uploadFinished(FinishedEvent event) {
  14. Attachment attachment = receiver.getWrapper().getCurrentAttachment();
  15. attachment.setProcessInstanceId(pid);
  16. attachment.setComment((String)comment.getValue());
  17. attachment.setProtectedDocument((boolean)checkbox.getValue());
  18. m_workflowDAO.addAttachment(attachment);
  19. close();
  20. }
  21. });
  22. if (getParent() == null) {
  23. UI.getCurrent().addWindow(this);
  24. this.center();
  25. }
  26. }
  27. public void close() {

代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin

  1. final Table artifacts = new ArtifactTable(main);
  2. final Table uploadedArtifacts = new ArtifactTable(main);
  3. final Upload uploadArtifact = new Upload("Upload Artifact", new Upload.Receiver() {
  4. public OutputStream receiveUpload(String filename, String MIMEType) {
  5. FileOutputStream fos = null;

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

  1. progressLayout.addComponent(uploadLabel);
  2. final Upload upload = new Upload("", receiver);
  3. upload.addSucceededListener(receiver);

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

  1. progressLayout.addComponent(uploadLabel);
  2. final Upload upload = new Upload("", receiver);
  3. upload.addSucceededListener(receiver);

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

  1. progressLayout.addComponent(uploadLabel);
  2. final Upload upload = new Upload("", receiver);
  3. upload.addSucceededListener(receiver);

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

  1. progressLayout.addComponent(uploadLabel);
  2. final Upload upload = new Upload("", receiver);
  3. upload.addSucceededListener(receiver);

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

  1. progressLayout.addComponent(uploadLabel);
  2. final Upload upload = new Upload("", receiver);
  3. upload.addSucceededListener(receiver);

代码示例来源:origin: apache/ace

  1. final Upload uploadArtifact = new Upload();
  2. uploadArtifact.setCaption("Upload Artifact");
  3. uploadHandler.install(uploadArtifact);

相关文章