Package com.vaadin.terminal.StreamResource

Examples of com.vaadin.terminal.StreamResource.StreamSource


    protected void addUserPicture() {
      Resource pictureResource = Images.USER_32; // default icon
      if (user != null) {
        final Picture userPicture = identityService.getUserPicture(user.getId());
        if (userPicture != null) {
          pictureResource = new StreamResource(new StreamSource() {       
            public InputStream getStream() {
              return userPicture.getInputStream();
            }
          }, user.getId(), ExplorerApp.get());
         
View Full Code Here


    for (final ProcessDefinitionConfig definition : orderedByProcessDescr) {
      if (session.hasPermissionsForDefinitionConfig(definition)) {
        if(!logoResourceCache.containsKey(definition)){
          logoResourceCache.put(definition, definition.getProcessLogo() == null ? defaultLogoResource
              : new StreamResource(new StreamSource() {
                @Override
                public InputStream getStream() {
                  return new ByteArrayInputStream(definition.getProcessLogo());
                }
              }, definition.getBpmDefinitionKey() + "_logo.png", activityMainPane.getApplication())
View Full Code Here

  protected void loadPicture() {
    Component pictureComponent = null;
    final Picture userPicture = identityService.getUserPicture(user.getId());
    if (userPicture != null) {
      StreamResource imageresource = new StreamResource(new StreamSource() {
        private static final long serialVersionUID = 1L;
        public InputStream getStream() {
          return userPicture.getInputStream();
        }
      }, user.getId() + "." + Constants.MIMETYPE_EXTENSION_MAPPING.get(userPicture.getMimeType()), ExplorerApp.get());
View Full Code Here

    protected void addUserPicture() {
      Resource pictureResource = Images.USER_32; // default icon
      if (user != null) {
        final Picture userPicture = identityService.getUserPicture(user.getId());
        if (userPicture != null) {
          pictureResource = new StreamResource(new StreamSource() {       
            public InputStream getStream() {
              return userPicture.getInputStream();
            }
          }, user.getId(), ExplorerApp.get());
         
View Full Code Here

  protected void addTaskEventPicture(final org.activiti.engine.task.Event taskEvent, GridLayout eventGrid) {
    final Picture userPicture = identityService.getUserPicture(taskEvent.getUserId());
    Embedded authorPicture = null;
   
    if (userPicture != null) {
      StreamResource imageresource = new StreamResource(new StreamSource() {
        private static final long serialVersionUID = 1L;
        public InputStream getStream() {
          return userPicture.getInputStream();
        }
      }, "event_" + taskEvent.getUserId() + "." + Constants.MIMETYPE_EXTENSION_MAPPING.get(userPicture.getMimeType()), ExplorerApp.get());
View Full Code Here

   
    if(processDefinition.getDiagramResourceName() != null) {
      final InputStream definitionImageStream = repositoryService.getResourceAsStream(
        processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName());
     
      StreamSource streamSource = new InputStreamStreamSource(definitionImageStream);
     
      // Creating image name based on process-definition ID is fine, since the diagram image cannot
      // be altered once deployed.
      String imageExtension = extractImageExtension(processDefinition.getDiagramResourceName());
      String fileName = processDefinition.getId() + "." + imageExtension;
View Full Code Here

      try {
        InputStream definitionImageStream = ProcessDiagramGenerator.generateDiagram(processDefinition, "png",
                runtimeService.getActiveActivityIds(processInstance.getId()));
             
        if(definitionImageStream != null) {
          StreamSource streamSource = new InputStreamStreamSource(definitionImageStream);
         
          // Create image name
          String imageExtension = extractImageExtension(processDefinition.getDiagramResourceName());
          String fileName = processInstance.getId() + UUID.randomUUID() + "." + imageExtension;
         
View Full Code Here

    if (processDefinition != null && processDefinition.isGraphicalNotationDefined()) {
      InputStream definitionImageStream = ProcessDiagramGenerator.generateDiagram(processDefinition, "png",
        runtimeService.getActiveActivityIds(processInstanceId));
     
      StreamSource streamSource = new InputStreamStreamSource(definitionImageStream);
     
      // Create image name
      String imageExtension = extractImageExtension(processDefinition.getDiagramResourceName());
      String fileName = processInstanceId + UUID.randomUUID() + "." + imageExtension;
     
View Full Code Here

    profilePanelLayout.addComponent(imageLayout);
    initPicture();
  }
 
  protected void initPicture() {
    StreamResource imageresource = new StreamResource(new StreamSource() {
      private static final long serialVersionUID = 1L;
      public InputStream getStream() {
        return picture.getInputStream();
      }
    }, user.getId(), ExplorerApp.get());
View Full Code Here

      resourceLinksLayout.setSpacing(true);
      resourceLinksLayout.setMargin(true, false, false, false);
      addDetailComponent(resourceLinksLayout);
     
      for (final String resourceName : resourceNames) {
        StreamResource.StreamSource streamSource = new StreamSource() {
          public InputStream getStream() {
            return repositoryService.getResourceAsStream(deployment.getId(), resourceName);
          }
        };
        Link resourceLink = new Link(resourceName, new StreamResource(streamSource, resourceName, ExplorerApp.get()));
View Full Code Here

TOP

Related Classes of com.vaadin.terminal.StreamResource.StreamSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.