Java 类com.vaadin.ui.Upload.Receiver 实例源码

项目:SecureBPMN    文件:UploadComponent.java   
public UploadComponent(String description, Receiver receiver) {
  this.receiver = receiver;
  this.i18nManager = ExplorerApp.get().getI18nManager();
  this.notificationManager = ExplorerApp.get().getNotificationManager();

  init(description);
}
项目:SecureBPMN    文件:UploadPopupWindow.java   
public UploadPopupWindow(String caption, String description, Receiver receiver) {
  this.i18nManager = ExplorerApp.get().getI18nManager();

  init(caption, description, receiver);

  uploadComponent.addFinishedListener(new FinishedListener() {

    private static final long serialVersionUID = 1L;

    public void uploadFinished(FinishedEvent event) {
      close();
    }
  });
}
项目:FiWare-Template-Handler    文件:UploadComponent.java   
public UploadComponent(String description, Receiver receiver) {
  this.receiver = receiver;
  this.i18nManager = ExplorerApp.get().getI18nManager();
  this.notificationManager = ExplorerApp.get().getNotificationManager();

  init(description);
}
项目:FiWare-Template-Handler    文件:UploadPopupWindow.java   
public UploadPopupWindow(String caption, String description, Receiver receiver) {
  this.i18nManager = ExplorerApp.get().getI18nManager();

  init(caption, description, receiver);

  uploadComponent.addFinishedListener(new FinishedListener() {

    private static final long serialVersionUID = 1L;

    public void uploadFinished(FinishedEvent event) {
      close();
    }
  });
}
项目:SecureBPMN    文件:UploadPopupWindow.java   
protected void init(String caption, String description, Receiver receiver) {
  uploadComponent = new UploadComponent(description, receiver);
  uploadComponent.setSizeFull();
  initWindow(caption);
}
项目:SecureBPMN    文件:FileAttachmentEditorComponent.java   
protected void initFileUpload() {
  uploadComponent = new UploadComponent(null, new Receiver() {
    private static final long serialVersionUID = 1L;

    public OutputStream receiveUpload(String filename, String mType) {
      fileName = filename;

      // Try extracting the extention as well, and append it to the mime-type
      String extention = extractExtention(filename);
      if(extention != null) {
        mimeType = mType + MIME_TYPE_EXTENTION_SPLIT_CHAR + extention;
      } else {
        mimeType = mType;
      }

      // TODO: Refactor, don't use BAOS!!
      byteArrayOutputStream = new ByteArrayOutputStream();
      return byteArrayOutputStream;
    }
  });

  uploadComponent.addFinishedListener(new FinishedListener() {

    private static final long serialVersionUID = 1L;

    public void uploadFinished(FinishedEvent event) {
      // Update UI
      if(getAttachmentName() == null || "".equals(getAttachmentName())) {
        setAttachmentName(getFriendlyName(fileName));
      }

      fileUploaded = true;
      successIndicator.setVisible(true);
      successIndicator.setCaption(i18nManager.getMessage(Messages.RELATED_CONTENT_TYPE_FILE_UPLOADED, fileName));
      form.setComponentError(null);
    }
  });

  addComponent(uploadComponent);
  setExpandRatio(uploadComponent, 1.0f);
}
项目:FiWare-Template-Handler    文件:UploadPopupWindow.java   
protected void init(String caption, String description, Receiver receiver) {
  uploadComponent = new UploadComponent(description, receiver);
  uploadComponent.setSizeFull();
  initWindow(caption);
}
项目:FiWare-Template-Handler    文件:FileAttachmentEditorComponent.java   
protected void initFileUpload() {
  uploadComponent = new UploadComponent(null, new Receiver() {
    private static final long serialVersionUID = 1L;

    public OutputStream receiveUpload(String filename, String mType) {
      fileName = filename;

      // Try extracting the extention as well, and append it to the mime-type
      String extention = extractExtention(filename);
      if(extention != null) {
        mimeType = mType + MIME_TYPE_EXTENTION_SPLIT_CHAR + extention;
      } else {
        mimeType = mType;
      }

      // TODO: Refactor, don't use BAOS!!
      byteArrayOutputStream = new ByteArrayOutputStream();
      return byteArrayOutputStream;
    }
  });

  uploadComponent.addFinishedListener(new FinishedListener() {

    private static final long serialVersionUID = 1L;

    public void uploadFinished(FinishedEvent event) {
      // Update UI
      if(getAttachmentName() == null || "".equals(getAttachmentName())) {
        setAttachmentName(getFriendlyName(fileName));
      }

      fileUploaded = true;
      successIndicator.setVisible(true);
      successIndicator.setCaption(i18nManager.getMessage(Messages.RELATED_CONTENT_TYPE_FILE_UPLOADED, fileName));
      form.setComponentError(null);
    }
  });

  addComponent(uploadComponent);
  setExpandRatio(uploadComponent, 1.0f);
}
项目:webcam    文件:Webcam.java   
public void setReceiver(Receiver reciver) {
    this.receiver = reciver;
}
项目:webcam    文件:Webcam.java   
public Receiver getReceiver() {
    return receiver;
}