Examples of StreamResource


Examples of com.vaadin.server.StreamResource

                awtBg);

        Date now = new Date();
        SimpleDateFormat format = new SimpleDateFormat("hhmmss");

        StreamResource imageresource = new StreamResource(imagesource,
                "myimage" + format.format(now) + ".png");
        imageresource.setCacheTime(0);

        display.setSource(imageresource);
    }
View Full Code Here

Examples of com.vaadin.server.StreamResource

public class LinkToPercentage extends TestBase {

    @Override
    protected void setup() {
        String filename = "110% Vaadin";
        Resource resource = new StreamResource(new StreamSource() {
            @Override
            public InputStream getStream() {
                return new InputStream() {
                    boolean first = true;
View Full Code Here

Examples of com.vaadin.terminal.StreamResource

      * Here we create a new StreamResource to get our PDF
      * Not working for the moment
      * __this__ must be replaced with a StreamSource
      *
      */
        StreamResource resource = new StreamResource(this, "/home/matrix/Desktop/pv.pdf", __app);
       
        // Set the right MIME type
        resource.setMIMEType(resource.getMIMEType());
        e.setSource(new ClassResource(resource.getFilename(), __app));
        window.addComponent(e);
        __app.getMainWindow().addWindow(window);
    }
View Full Code Here

Examples of com.vaadin.terminal.StreamResource

         *  Here we create a new StreamResource to get our PDF
         *  Not working for the moment
         *  __this__ must be replaced with a StreamSource
         * 
         */
        StreamResource resource = new StreamResource(this, "/home/matrix/Desktop/pv.pdf", __app);
       
        // Set the right MIME type
        resource.setMIMEType(resource.getMIMEType());
        e.setSource(new ClassResource(resource.getFilename(), __app));
        __app.getMainWindow().addComponent(e);
    }
View Full Code Here

Examples of com.vaadin.terminal.StreamResource

    e.setSizeFull();
    e.setType(Embedded.TYPE_BROWSER);

    // Here we create a new StreamResource which downloads our StreamSource,
    // which is our pdf.
    StreamResource resource = new StreamResource(this, "schedule.pdf?"
        + System.currentTimeMillis(), application);
    // Set the right mime type
    resource.setMIMEType("application/pdf");

    e.setSource(resource);
    window.addComponent(e);
    application.getMainWindow().addWindow(window);
  }
View Full Code Here

Examples of com.vaadin.terminal.StreamResource

                    return new ByteArrayInputStream(byteArray);
                }
                return null;
            }
        };
        StreamResource resource = new StreamResource(streamSource, name,
                getApplication());

        // show the file contents - images only for now
        Embedded embedded = new Embedded(name, resource);
        showComponent(embedded, name);
View Full Code Here

Examples of com.vaadin.terminal.StreamResource

  protected void initPicture(IdentityService identityService, boolean renderPicture, final String userName) {
    if(renderPicture) {
      Picture picture = identityService.getUserPicture(userName);
      if(picture != null) {
        Resource imageResource = new StreamResource(new InputStreamStreamSource(picture.getInputStream()),
          userName + picture.getMimeType(), ExplorerApp.get());
       
        Embedded image = new Embedded(null, imageResource);
        image.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
        image.setType(Embedded.TYPE_IMAGE);
View Full Code Here

Examples of com.vaadin.terminal.StreamResource

            processEngineConfiguration.getLabelFontName(), processEngineConfiguration.getClassLoader());
      }
    };
   
    // resource must have unique id (or cache-crap can happen)!
    StreamResource imageresource = new StreamResource(streamSource,UUID.randomUUID() + ".png", ExplorerApp.get());
    Embedded diagram = new Embedded("", imageresource);
    diagram.setType(Embedded.TYPE_IMAGE);
    diagram.setSizeUndefined();
   
    imagePanel = new Panel(); // using panel for scrollbars
View Full Code Here

Examples of com.vaadin.terminal.StreamResource

  protected void initPicture(IdentityService identityService, boolean renderPicture, final String userName) {
    if(renderPicture) {
      Picture picture = identityService.getUserPicture(userName);
      if(picture != null) {
        Resource imageResource = new StreamResource(new InputStreamStreamSource(picture.getInputStream()),
          userName + picture.getMimeType(), ExplorerApp.get());
       
        Embedded image = new Embedded(null, imageResource);
        image.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
        image.setType(Embedded.TYPE_IMAGE);
View Full Code Here

Examples of com.vaadin.terminal.StreamResource

      }
     
      if(!didDrawImage && processDefinitionEntity.isGraphicalNotationDefined()) {
        ProcessEngineConfiguration processEngineConfiguration = ProcessEngines.getDefaultProcessEngine().getProcessEngineConfiguration();
        ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator();
        StreamResource diagram = new ProcessDefinitionImageStreamResourceBuilder()
          .buildStreamResource(processInstance, repositoryService, runtimeService, diagramGenerator, processEngineConfiguration);
 
        if(diagram != null) {
          Label header = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
          header.addStyleName(ExplorerLayout.STYLE_H3);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.