Package com.vaadin.ui

Examples of com.vaadin.ui.Link


    public void createNewView() {
        main.removeAllComponents();
        main.addComponent(new Label("SDFGFHFHGJGFDSDSSSGFDD"));

        final Link l = new Link();
        l.setCaption("Siirry Vaadiniin");
        l.setResource(new ExternalResource("http://www.vaadin.com/"));
        l.setTargetHeight(200);
        l.setTargetWidth(500);
        l.setTargetBorder(Link.TARGET_BORDER_MINIMAL);
        main.addComponent(l);

        final Select se = new Select();
        se.setCaption("VALITSET TÄSTÄ");
        se.addItem("valinta1");
View Full Code Here


            statusLayout.addComponent(new Label("<b>Mimetype:</b> "
                    + event.getMIMEType(), ContentMode.HTML));
            statusLayout.addComponent(new Label("<b>Size:</b> "
                    + event.getLength() + " bytes.", ContentMode.HTML));

            statusLayout.addComponent(new Link("Download "
                    + buffer.getFileName(), new StreamResource(buffer, buffer
                    .getFileName())));

            status.setVisible(true);
        }
View Full Code Here

                    statusLayout.addComponent(new Label("<b>Mimetype:</b> "
                            + event.getMIMEType(), ContentMode.HTML));
                    statusLayout.addComponent(new Label("<b>Size:</b> "
                            + event.getLength() + " bytes.", ContentMode.HTML));

                    statusLayout.addComponent(new Link("Download "
                            + buffer.getFileName(), new StreamResource(buffer,
                            buffer.getFileName())));

                    statusLayout.setVisible(true);
                }
View Full Code Here

            ((Select) result).addItem("Second item");
            ((Select) result).addItem("Third item");
            break;
        case 4:
            // Link
            result = new Link("", new ExternalResource("http://www.vaadin.com"));
            result.setCaption("Link component " + caption);
            break;
        case 5:
            // Link
            VerticalLayout panelLayout = new VerticalLayout();
View Full Code Here

    public void createNewView() {
        main.removeAllComponents();
        main.addComponent(new Label("SDFGFHFHGJGFDSDSSSGFDD"));

        final Link l = new Link();
        l.setCaption("Siirry Vaadiniin");
        l.setResource(new ExternalResource("http://www.vaadin.com/"));
        l.setTargetHeight(200);
        l.setTargetWidth(500);
        l.setTargetBorder(Link.TARGET_BORDER_MINIMAL);
        main.addComponent(l);

        final Select se = new Select("Tästä valitaan");
        se.setCaption("Whattaa select");
        se.addItem("valinta1");
View Full Code Here

        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

        for (int i = 0; i < items.length; i++) {
            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);
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

                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

TOP

Related Classes of com.vaadin.ui.Link

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.