Package com.vaadin.server

Examples of com.vaadin.server.ExternalResource


                portletEdit.setCaption("Edit");
            } else {
                url.setPortletMode(PortletMode.VIEW);
                portletEdit.setCaption("Done");
            }
            portletEdit.setResource(new ExternalResource(url.toString()));
        } catch (Exception e) {
            portletEdit.setEnabled(false);
            Logger.getLogger(getClass().getName()).log(Level.SEVERE,
                    "Error creating edit mode link", e);
        }

        // Create Maximize/Normal link (actionUrl)
        url = getSession().generateActionURL("changeState");
        try {
            if (inNormalState) {
                url.setWindowState(WindowState.MAXIMIZED);
                portletMax.setCaption("Maximize");
            } else {
                url.setWindowState(WindowState.NORMAL);
                portletMax.setCaption("Back to normal");

            }
            portletMax.setResource(new ExternalResource(url.toString()));
        } catch (Exception e) {
            portletMax.setEnabled(false);
            Logger.getLogger(getClass().getName()).log(Level.SEVERE,
                    "Error creating state change link", e);
        }

        if (someAction == null) {
            url = getSession().generateActionURL("someAction");
            try {
                someAction = new Link("An action", new ExternalResource(
                        url.toString()));
                main.addComponent(someAction);
            } catch (Exception e) {
                // Oops
                System.err.println("Could not create someAction: " + e);
View Full Code Here


        find.addItem("Google Search", new Command() {
            @Override
            public void menuSelected(MenuItem selectedItem) {
                getMainWindow().open(
                        new ExternalResource("http://www.google.com"));
            }
        });
        find.addSeparator();
        find.addItem("Find/Replace...", null);
        find.addItem("Find Next", null);
View Full Code Here

        LegacyWindow w = super.getWindow(name);
        if (w == null) {

            // If no window found, create it
            w = createExtraWindow(name);
            w.open(new ExternalResource(w.getURL()));
        }
        return w;
    }
View Full Code Here

        VaadinSession.getCurrent().addRequestHandler(res);

        w.addComponent(new Link(
                "Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)",
                new ExternalResource("myresource")));

        w.addComponent(new Link(
                "Test (with Content-Disposition, should popup download dialog that suggests  filename downloadedPNG.png)",
                new ExternalResource("myresource_download")));
    }
View Full Code Here

    public void setup() {
        Flash player = new Flash();
        player.setWidth("400px");
        player.setHeight("300px");
        String url = "http://www.youtube.com/v/qQ9N742QB4g&autoplay=1";
        player.setSource(new ExternalResource(url));
        player.setParameter("movie", "someRandomValue");
        player.setParameter("allowFullScreen", "true");
        player.setAlternateText("Flash alternative text");

        addComponent(player);
View Full Code Here

    public void init() {
        final LegacyWindow main = new LegacyWindow(getClass().getName()
                .substring(getClass().getName().lastIndexOf(".") + 1));
        setMainWindow(main);

        ExternalResource icon = new ExternalResource("./icon.png");
        main.addComponent(new Label(
                "Note, run with trailing slash in url to have a working icon. Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)"));
        Button b = new Button();
        main.addComponent(b);
        b.setIcon(icon);
View Full Code Here

        // w.setContent(new ExpandLayout());
        w.getContent().setSizeFull();

        Embedded em = new Embedded();
        em.setType(Embedded.TYPE_BROWSER);
        em.setSource(new ExternalResource("../statictestfiles/ticket2095.html"));
        em.setId("MYIFRAME");

        em.setSizeFull();

        w.addComponent(em);
View Full Code Here

    }

    private void createTargetSelect(String category) {
        LinkedHashMap<String, Resource> options = new LinkedHashMap<String, Resource>();
        options.put("-", null);
        options.put("https://vaadin.com", new ExternalResource(
                "https://vaadin.com"));
        options.put("32x32 theme icon", ICON_32_ATTENTION_PNG_CACHEABLE);
        options.put("linktest-target.html", new ClassResource(
                "linktest-target.html"));
View Full Code Here

        return null;
    }

    @Override
    protected void setup() {
        Link l = new Link("www.google.com", new ExternalResource(
                "http://www.vaadin.com/"));
        l.setIcon(new ThemeResource("../runo/icons/32/calendar.png"));

        addComponent(l);
    }
View Full Code Here

        return 2524;
    }

    @Override
    protected void setup() {
        Link l = new Link("Try it!", new ExternalResource(
                "http://www.google.com/m"));
        l.setTargetName("_blank");
        l.setTargetWidth(300);
        l.setTargetHeight(300);
        l.setTargetBorder(BorderStyle.NONE);
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.