Package com.vaadin.ui

Examples of com.vaadin.ui.Label


                        // Wait a bit so there's time to click multiple times
                        Thread.sleep(3000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    replaceComponent(table, new Label("Completed!"));
                }
            }
        });
        addComponent(table);
    }
View Full Code Here


public class TableInSubWindowMemoryLeak extends TestBase {

    @Override
    public void setup() {
        final Label label = new Label("Hello Vaadin user");
        addComponent(label);
        final Button openButton = new Button("open me");
        openButton.addClickListener(new ClickListener() {

            @Override
            public void buttonClick(final ClickEvent event) {
                final Window window = new Window("Simple Window");
                window.setModal(true);
                window.setHeight("200px");
                window.setWidth("200px");
                final Table table = new Table();
                window.setContent(table);
                UI.getCurrent().addWindow(window);
                window.addCloseListener(new CloseListener() {
                    @Override
                    public void windowClose(final CloseEvent e) {
                        window.setContent(new Label());
                        UI.getCurrent().removeWindow(window);
                    }
                });
            }
        });
View Full Code Here

    public void init() {
        final LegacyWindow main = new LegacyWindow(getClass().getName()
                .substring(getClass().getName().lastIndexOf(".") + 1));
        setMainWindow(main);
        URL url = getURL();
        main.addComponent(new Label(
                "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));

        try {
            CustomLayout cl = new CustomLayout(
                    new ByteArrayInputStream(
View Full Code Here

                    }
                }
            };
            table.setContainerDataSource(container);
            addComponent(table);
            final Label label = new Label();
            addComponent(label);
            Button button = new Button("Click");
            button.addListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    try {
                        reduceData = !reduceData;
                        table.refreshRowCache();
                        label.setValue("Index: "
                                + table.getCurrentPageFirstItemIndex());
                    } catch (Exception e) {
                        label.setValue("Exception: "
                                + e.getClass().getSimpleName());
                    }
                }
            });
            addComponent(button);
            Button button2 = new Button("Filter");
            button2.addListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    try {
                        if (filter != null) {
                            container.removeAllContainerFilters();
                            filter = null;
                        } else {
                            filter = new DecimateFilter();
                            container.addContainerFilter(filter);
                        }
                        table.refreshRowCache();
                        label.setValue("Index: "
                                + table.getCurrentPageFirstItemIndex());
                    } catch (Exception e) {
                        label.setValue("Exception: "
                                + e.getClass().getSimpleName());
                    }
                }
            });
            addComponent(button2);
View Full Code Here

        gl.setMargin(true);
        for (int i = 0; i < 3 * 3; i++) {
            gl.addComponent(new Button("test"));
        }
        pl.addComponent(gl);
        pl.addComponent(new Label("| next component"));

        Button b = new Button("next margin state");
        b.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                nextMarginState();
            }

        });

        state = new Label();
        state.setCaption("Current margin state:");
        main.addComponent(state);
        main.addComponent(b);

        Button b2 = new Button("next spacing state");
        b2.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                nextSpacingState();
            }

        });

        spacingstate = new Label();
        spacingstate.setCaption("Current Spacing State:");
        main.addComponent(spacingstate);
        main.addComponent(b2);

        main.addComponent(p);
View Full Code Here

public class CheckBoxes extends VerticalLayout implements View {
    public CheckBoxes() {
        setMargin(true);

        Label h1 = new Label("Check Boxes");
        h1.addStyleName("h1");
        addComponent(h1);

        HorizontalLayout row = new HorizontalLayout();
        row.addStyleName("wrapping");
        row.setSpacing(true);
        addComponent(row);

        CheckBox check = new CheckBox("Checked", true);
        row.addComponent(check);

        check = new CheckBox(
                "Checked, explicit width, so that the caption should wrap",
                true);
        row.addComponent(check);
        check.setWidth("150px");

        check = new CheckBox("Not checked");
        row.addComponent(check);

        check = new CheckBox(null, true);
        check.setDescription("No caption");
        row.addComponent(check);

        check = new CheckBox("Custom color", true);
        check.addStyleName("color1");
        row.addComponent(check);

        TestIcon testIcon = new TestIcon(30);
        check = new CheckBox("Custom color", true);
        check.addStyleName("color2");
        check.setIcon(testIcon.get());
        row.addComponent(check);

        check = new CheckBox("With Icon", true);
        check.setIcon(testIcon.get());
        row.addComponent(check);

        check = new CheckBox();
        check.setIcon(testIcon.get(true));
        row.addComponent(check);

        check = new CheckBox("Small", true);
        check.addStyleName("small");
        row.addComponent(check);

        check = new CheckBox("Large", true);
        check.addStyleName("large");
        row.addComponent(check);

        h1 = new Label("Option Groups");
        h1.addStyleName("h1");
        addComponent(h1);

        row = new HorizontalLayout();
        row.addStyleName("wrapping");
        row.setSpacing(true);
View Full Code Here

        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        Panel p = new Panel(
                "This is a panel with a longer caption than it should have", pl);
        p.setWidth("100px");
        pl.addComponent(new Label("Contents"));
        layout.addComponent(p);
    }
View Full Code Here

        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        Panel p = new Panel("Test panel", pl);
        p.setSizeFull();

        pl.addComponent(new Label(
                "Second component is embedded with a slow resource "
                        + "and thus should break layout if Embedded cannot"
                        + " request re-layout after load."));

        Embedded em = new Embedded("TestEmbedded", slowRes);
View Full Code Here

        setMainWindow(new LegacyWindow());
        setTheme("tests-tickets");

        getMainWindow()
                .addComponent(
                        new Label(
                                "Defining spacing must be possible also with pure CSS"));

        Layout gl;
        gl = new VerticalLayout();
        gl.setWidth("100%");
View Full Code Here

    public Tables() {
        setMargin(true);
        setSpacing(true);

        Label h1 = new Label("Tables");
        h1.addStyleName("h1");
        addComponent(h1);

        HorizontalLayout wrap = new HorizontalLayout();
        wrap.addStyleName("wrapping");
        wrap.setSpacing(true);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Label

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.