Package com.vaadin.ui

Examples of com.vaadin.ui.Label


        w.setContent(layout);
        createUI(layout);
    }

    private void createUI(GridLayout layout) {
        layout.addComponent(new Label("abc"));
        layout.addComponent(new Button("B", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Notification n = new Notification("Test");
                getMainWindow().showNotification(n);
            }

        }));

        layout.addComponent(new Label("abc"));
    }
View Full Code Here


                final String name = "Child " + (++childs);
                LegacyWindow c = new LegacyWindow(name);

                addWindow(c);
                main.open(new ExternalResource(c.getURL()), "_new");
                main.addComponent(new Label(name + " opened"));
                final TextField tf = new TextField("Non immediate textfield");
                c.addComponent(tf);
                tf.addListener(new Property.ValueChangeListener() {
                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        main.addComponent(new Label(name + " send text:"
                                + tf.getValue()));
                    }
                });
                for (int i = 0; i < 3; i++) {
                    final String caption = "Slow button " + i;
                    c.addComponent(new Button(caption,
                            new Button.ClickListener() {
                                @Override
                                public synchronized void buttonClick(
                                        ClickEvent event) {
                                    try {
                                        this.wait(2000);
                                    } catch (InterruptedException e) {
                                    }
                                    main.addComponent(new Label(caption
                                            + " pressed"));
                                }
                            }));
                }
View Full Code Here

        private GridLayout layout;

        public TitleBar(String title, GridLayout layout) {
            super();
            this.layout = layout;
            addComponent(new Label(title));
            addComponent(max);
            addComponent(min);
            min.setVisible(false);

            max.addListener(new ClickListener() {
View Full Code Here

    @Override
    public void init() {
        LegacyWindow main = new LegacyWindow();
        setMainWindow(main);

        main.addComponent(new Label(
                "Use debug dialog and trac number of registered paintables. It should not grow on subsequant b clicks."));

        final Layout lo = new VerticalLayout();

        Button b = new Button("b");
View Full Code Here

    protected void repopupate(Layout lo) {
        lo.removeAllComponents();

        for (int i = 0; i < 20; i++) {
            lo.addComponent(new Label("tc" + (counter++)));
        }

    }
View Full Code Here

        setMainWindow(w);
        Button b = new Button("add", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                gl.addComponent(new Label("asd"), 0, gl.getCursorY(), 2,
                        gl.getCursorY());

            }

        });
View Full Code Here

    private void createUI(AbstractOrderedLayout layout) {
        layout.setSizeUndefined();
        layout.setMargin(false);
        layout.setStyleName("borders");
        Label l = new Label("Margin-label");

        l.setStyleName("ticket2231");

        layout.addComponent(l);

        for (int i = 0; i < 5; i++) {
            l = new Label("This is a label with border");
            l.setStyleName("ticket2231-border");
            if (i == 2) {
                l.setWidth("100%");
                l.setValue("100% wide");
            } else if (i == 4) {
                l.setWidth("20em");
                l.setValue("20em wide");
            }
            // l.addStyleName("ticket2231");
            layout.addComponent(l);
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    protected void setup(VaadinRequest request) {
        final VerticalLayout verticalLayout = new VerticalLayout();

        final Label label1 = new Label("1");
        final Label label2 = new Label("2");

        Button button = new Button("Replace label");
        button.addClickListener(new Button.ClickListener() {

            @Override
View Full Code Here

        Button b = new Button("This is a button");
        CheckBox cb = new CheckBox("This is a checkbox");
        cb.setImmediate(true);
        setTheme("tests-tickets");
        layout.setStyleName("mylayout");
        status = new Label("Result:");
        layout.addComponent(status);
        layout.setSpacing(true);
        layout.setMargin(true);

        layout.addComponent(b);
        layout.addComponent(cb);

        layout.addComponent(new Label("a"));
        layout.addComponent(new Label("b"));
        layout.addComponent(new Label("c"));

        checkButton(Button.class);
        checkCheckBox(CheckBox.class);
        checkDataBinding(CheckBox.class);
View Full Code Here

        gl = new GridLayout(1, 2);
        gl.setStyleName("borders");
        getMainWindow().addComponent(gl);
        setTheme("tests-tickets");
        combo = new ComboBox("Combo caption");
        labelLong = new Label(
                "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");
        gl.addComponent(combo);
        gl.addComponent(labelLong);

        Button b = new Button("Add label text", new ClickListener() {
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.