Package com.vaadin.server

Examples of com.vaadin.server.StreamResource


        final Label label = new Label(labelText());
        addComponent(label);

        final Image image = new Image();
        final MyImageSource imageSource = new MyImageSource();
        final StreamResource imageResource = new StreamResource(imageSource,
                "testimage.png");
        image.setSource(imageResource);
        image.addClickListener(new ClickListener() {

            @Override
            public void click(ClickEvent event) {
                ++clickCounter;
                imageResource.setFilename("testimage.png?"
                        + new Date().getTime());
                image.markAsDirty();
                label.setValue(labelText());
            }
View Full Code Here


                        return new ByteArrayInputStream(byteArray);
                    }
                    return null;
                }
            };
            return new StreamResource(streamSource, getName());
        }
View Full Code Here

        // addComponents(resource, components);
        // resource = new ExternalResource(
        // "https://vaadin.com/download/book-of-vaadin/current/pdf/book-of-vaadin.pdf");
        // addComponents(resource, components);
        ConnectorResource resource;
        resource = new StreamResource(new StreamResource.StreamSource() {

            @Override
            public InputStream getStream() {
                try {
                    BufferedImage img = getImage2("demo.png");
View Full Code Here

        embedded.setDescription("Click on the grid cells to switch them.");
        addComponent(embedded);

        // Attach it to a resource.
        final MyImageSource imageSource = new MyImageSource();
        final StreamResource imageResource = new StreamResource(imageSource,
                "testimage.png");
        imageResource.setCacheTime(0);
        embedded.setSource(imageResource);

        // The button requests repainting the embedded.
        Button button = new Button("refr");
        button.addListener(new Button.ClickListener() {
View Full Code Here

                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

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

TOP

Related Classes of com.vaadin.server.StreamResource

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.