Package com.vaadin.ui

Examples of com.vaadin.ui.Label


    private Container buildContainer() {
        IndexedContainer cont = new IndexedContainer();
        cont.addContainerProperty("name", Label.class, null);
        for (int i = 0; i < 10000; i++) {
            cont.addItem(i);
            Label l = new Label("Item " + i);
            l.setHeight("50px");
            cont.getContainerProperty(i, "name").setValue(l);
        }
        return cont;
    }
View Full Code Here


        final TextField tx = new TextField(
                "Textfield with maxlenght 10, single row");
        tx.setImmediate(true);
        tx.setMaxLength(10);

        final Label l = new Label();

        Button b = new Button("Check value");
        b.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                l.setValue("Length: " + tx.getValue().toString().length()
                        + " Content: " + tx.getValue());
            }
        });

        mainWin.addComponent(tx);
        mainWin.addComponent(b);

        final TextArea tx2 = new TextArea(
                "Textfield with maxlenght 10, multirow ");
        mainWin.addComponent(tx2);
        tx2.setImmediate(true);
        tx2.setRows(5);
        tx2.setMaxLength(10);

        Button b2 = new Button("Check value");
        b2.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                l.setValue("Length: " + tx2.getValue().toString().length()
                        + " Content: " + tx2.getValue());
            }
        });

        mainWin.addComponent(tx);
View Full Code Here

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

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

        HorizontalLayout row = new HorizontalLayout();
        row.setSpacing(true);
        row.setWidth("100%");
View Full Code Here

        Accordion ac = new Accordion();
        ac.setCaption(caption);
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Fabio vel iudice vincam, sunt in culpa qui officia. Ut enim ad minim veniam, quis nostrud exercitation."));
            }
        }, "First Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Gallia est omnis divisa in partes tres, quarum."));
            }
        }, "Second Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Nihil hic munitissimus habendi senatus locus, nihil horum? Sed haec quis possit intrepidus aestimare tellus."));
            }
        }, "Third Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Inmensae subtilitatis, obscuris et malesuada fames. Quisque ut dolor gravida, placerat libero vel, euismod."));
            }
        }, "Custom Caption Style", testIcon.get()).setStyleName("color1");
        return ac;
    }
View Full Code Here

        button2.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Label mainComponent = new Label("Main");
                Label header = new Label("Header");
                final Label anotherComponent = new Label("another");
                layout.addComponent(mainComponent, "body");
                layout.addComponent(header, "loginUser");
                button.addListener(new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
View Full Code Here

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

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

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

        Slider slider = new Slider("Horizontal");
        slider.setValue(50.0);
        row.addComponent(slider);

        slider = new Slider("Horizontal, sized");
        slider.setValue(50.0);
        slider.setWidth("200px");
        row.addComponent(slider);

        slider = new Slider("Custom handle");
        slider.setValue(50.0);
        slider.setWidth("200px");
        slider.addStyleName("color1");
        row.addComponent(slider);

        slider = new Slider("Custom track");
        slider.setValue(50.0);
        slider.setWidth("200px");
        slider.addStyleName("color2");
        row.addComponent(slider);

        slider = new Slider("Custom indicator");
        slider.setValue(50.0);
        slider.setWidth("200px");
        slider.addStyleName("color3");
        row.addComponent(slider);

        slider = new Slider("No indicator");
        slider.setValue(50.0);
        slider.setWidth("200px");
        slider.addStyleName("no-indicator");
        row.addComponent(slider);

        slider = new Slider("With ticks (not in IE8 & IE9)");
        slider.setValue(3.0);
        slider.setWidth("200px");
        slider.setMax(4);
        slider.addStyleName("ticks");
        row.addComponent(slider);

        slider = new Slider("Toggle imitation");
        slider.setWidth("50px");
        slider.setResolution(0);
        slider.setMin(0);
        slider.setMax(1);
        row.addComponent(slider);

        slider = new Slider("Vertical");
        slider.setValue(50.0);
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("Vertical, sized");
        slider.setValue(50.0);
        slider.setOrientation(SliderOrientation.VERTICAL);
        slider.setHeight("200px");
        row.addComponent(slider);

        slider = new Slider("Custom handle");
        slider.setValue(50.0);
        slider.setHeight("200px");
        slider.addStyleName("color1");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("Custom track");
        slider.setValue(50.0);
        slider.setHeight("200px");
        slider.addStyleName("color2");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("Custom indicator");
        slider.setValue(50.0);
        slider.setHeight("200px");
        slider.addStyleName("color3");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("No indicator");
        slider.setValue(50.0);
        slider.setHeight("200px");
        slider.addStyleName("no-indicator");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("With ticks");
        slider.setValue(3.0);
        slider.setHeight("200px");
        slider.setMax(4);
        slider.addStyleName("ticks");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("Disabled");
        slider.setValue(50.0);
        slider.setEnabled(false);
        row.addComponent(slider);

        h1 = new Label("Progress Bars");
        h1.addStyleName("h1");
        addComponent(h1);

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

            table.addItem(new Object[] { "a" + i, "b" + i, "c" + i }, "" + i);
        }

        addComponent(table);

        pageLengthLabel = new Label("");
        updatePageLengthLabel();
        addComponent(pageLengthLabel);

        Button updateButton = new Button("Update pageLength",
                new ClickListener() {
View Full Code Here

        main = new VerticalLayout();
        setCompositionRoot(main);
        addInfo();

        result = new Label();
        main.addComponent(result);

        testContainer = new VerticalLayout();

        final Table t = TestForTablesInitialColumnWidthLogicRendering
                .getTestTable(5, 200);

        Table t2 = new Table("Test Table with 199 rows rendered initially") {
            @Override
            public void changeVariables(Object source,
                    Map<String, Object> variables) {
                super.changeVariables(source, variables);
                // end timing on cache row request
                endTest();
            }
        };
        t2.setPageLength(199); // render almost all rows at once
        t2.setContainerDataSource(t.getContainerDataSource());

        testContainer.addComponent(t2);

        for (int i = 0; i < INITIAL_COMPONENTS; i++) {
            ComboBox cb = new ComboBox("Combobox " + i);
            for (int j = 0; j < INITIAL_COMPONENTS; j++) {
                cb.addItem("option " + i + " " + j);
            }
            testContainer.addComponent(cb);

            TextField tf = new TextField("TextField " + i);
            tf.setDescription("DESC SDKJSDF");
            tf.setComponentError(new UserError("dsfjklsdf"));
            testContainer.addComponent(tf);

            testContainer.addComponent(new DateField("DateField" + i));

            testContainer.addComponent(new Button("Button" + i));

            TabSheet ts = new TabSheet();

            for (int j = 0; j < INITIAL_COMPONENTS; j++) {
                Label tab = new Label("Tab content " + i + " " + j);
                tab.setCaption("Tab " + i + " " + j);
                ts.addTab(tab);
            }
            testContainer.addComponent(ts);

        }
View Full Code Here

        final Float f = new Float(millis / 1000.0);
        result.setValue("Test completed in " + f + " seconds");
    }

    private void addInfo() {
        main.addComponent(new Label(DESCRIPTION, ContentMode.HTML));
    }
View Full Code Here

    public TestForWindowing() {

        final VerticalLayout main = new VerticalLayout();

        main.addComponent(new Label(
                "Click the button to create a new inline window."));

        final CheckBox asModal = new CheckBox("As modal");
        main.addComponent(asModal);
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.