Package com.vaadin.server

Examples of com.vaadin.server.ExternalResource


        HttpServletRequest request = VaadinServletService
                .getCurrentServletRequest();
        String baseUrl = request.getContextPath() + request.getServletPath();

        addComponent(new Link("Existing resource", resource));
        addComponent(new Link("Non-existing resource", new ExternalResource(
                baseUrl + "/APP/connector/0/4/asdfasdf")));
        addComponent(new Link("/APP/ url that should give 404",
                new ExternalResource(baseUrl + "/APP/")));
        addComponent(new Link("/APPLE url that should go to UI providers",
                new ExternalResource(baseUrl + "/APPLE")));
    }
View Full Code Here


                }));
    }

    protected void downloadAndUpdate() {
        getMainWindow().open(
                new ExternalResource("/statictestfiles/dummy.zip", "_new"));

        // Any component sending an UIDL request when rendered will likely do
        Table table = new Table();
        table.addContainerProperty("A", String.class, "");
        for (int i = 0; i < 100; i++) {
View Full Code Here

        player.setType(Embedded.TYPE_OBJECT);
        player.setWidth("400px");
        player.setHeight("300px");
        player.setMimeType("application/x-shockwave-flash");
        String url = "http://www.youtube.com/v/qQ9N742QB4g&autoplay=1";
        player.setSource(new ExternalResource(url));
        player.setParameter("movie", "someRandomValue");
        player.setParameter("allowFullScreen", "true");
        addComponent(player);

        Button changeAltTexts = new Button("Change alt texts",
View Full Code Here

            items[i] = tt
                    .addItem(
                            new Object[] {
                                    i + 1,
                                    new Link(String.valueOf(i + 1),
                                            new ExternalResource(
                                                    "http://www.google.fi")) },
                            null);
        }
        tt.setChildrenAllowed(items[0], false);
        tt.setChildrenAllowed(items[2], false);
View Full Code Here

            @Override
            public Component generateCell(Table source, Object itemId,
                    Object columnId) {
                Item item = source.getItem(itemId);
                String name = (String) item.getItemProperty("Name").getValue();
                return new Link("Google for " + name, new ExternalResource(
                        "http://www.google.co.uk/search?q=" + name));
            }
        });

        // Insert some data
        Object people[][] = { { "Galileo", 77 }, { "Monnier", 83 },
                { "Vaisala", 79 }, { "Oterma", 86 } };

        for (int i = 0; i < people.length; i++) {
            table.addItem(people[i], i);
        }

        // Calculate the average of the numeric column
        double avgAge = 0;
        for (int i = 0; i < people.length; i++) {
            avgAge += (Integer) people[i][1];
        }
        avgAge /= people.length;

        // Set the footers
        table.setFooterVisible(true);
        table.setColumnFooter("Name", "Average");
        table.setColumnFooter("Died At Age", String.valueOf(avgAge));

        // Adjust the table height a bit
        table.setPageLength(table.size() + 2);

        for (int i = 0; i < people.length; i++) {
            Object[] person = people[i];
            String name = (String) person[0];
            addComponent(new Link("Google for " + name, new ExternalResource(
                    "http://www.google.co.uk/search?q=" + name)));
        }

    }
View Full Code Here

    public void setup() {
        final Embedded applet = new Embedded();
        applet.setType(Embedded.TYPE_BROWSER);
        applet.setWidth("400px");
        applet.setHeight("300px");
        applet.setSource(new ExternalResource("/statictestfiles/applet.html"));
        addComponent(applet);

        addComponent(new Button("Remove applet", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
View Full Code Here

                "Change URI using Application.getURL()",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        mainWin.open(new ExternalResource(getURL() + "#"
                                + System.currentTimeMillis()));
                    }
                }));
        mainWin.addComponent(new Button("Change URI uring Window.getURL()",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        mainWin.open(new ExternalResource(mainWin.getURL()
                                + "#" + System.currentTimeMillis()));
                    }
                }));
    }
View Full Code Here

                HierarchicalContainer container = (HierarchicalContainer) tt
                        .getContainerDataSource();
                Object itemId = container.addItem();
                container.getContainerProperty(itemId, "i").setValue(i++);
                container.getContainerProperty(itemId, "link").setValue(
                        new Link(String.valueOf(i + 1), new ExternalResource(
                                "http://www.google.fi")));
                container.setChildrenAllowed(itemId, false);
                container.setParent(itemId, null);
            }
        });
View Full Code Here

        Object previous = null;
        for (int i = 0; i < num; i++) {
            Object item = container.addItem();
            container.getContainerProperty(item, "i").setValue(i + 1);
            container.getContainerProperty(item, "link").setValue(
                    new Link(String.valueOf(i + 1), new ExternalResource(
                            "http://www.google.fi")));
            if (i > 0 && (i + 1) % 2 == 0) {
                container.setChildrenAllowed(item, false);
                container.setParent(item, previous);
            } else {
View Full Code Here

    @Override
    protected void setup() {
        final Video v = new Video("video");
        v.setSources(
                new ExternalResource(
                        "http://jonatan.virtuallypreinstalled.com/media/big_buck_bunny.mp4"),
                new ExternalResource(
                        "http://jonatan.virtuallypreinstalled.com/media/big_buck_bunny.ogv"));
        v.setWidth("640px");
        v.setHeight("360px");
        addComponent(v);
        addComponent(new Button("Play video", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                v.play();
            }

        }));
        addComponent(new Button("Pause video", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                v.pause();
            }

        }));

        final Audio a = new Audio("audio");
        a.setSources(
                new ExternalResource(
                        "http://jonatan.virtuallypreinstalled.com/media/audio.mp3"),
                new ExternalResource(
                        "http://jonatan.virtuallypreinstalled.com/media/audio.ogg"));
        addComponent(a);

        addComponent(new Button("Play audio", new ClickListener() {
View Full Code Here

TOP

Related Classes of com.vaadin.server.ExternalResource

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.