Package com.vaadin.ui

Examples of com.vaadin.ui.VerticalLayout


        setMainWindow(main);

        // setTheme("quicktest");

        VerticalLayout hl = new VerticalLayout();
        hl.setWidth("400px");
        main.setContent(hl);

        Table t = new Table();
        t.setWidth("100%");

        t.addContainerProperty("Prop 1", VerticalLayout.class, "");
        t.addContainerProperty("Prop 2", String.class, "");
        t.addContainerProperty("Prop 3", String.class, "");
        t.addContainerProperty("Prop 4", String.class, "");
        t.addContainerProperty("Prop 5", Button.class, "");

        t.setPageLength(3);

        for (int i = 0; i < 10; i++) {

            VerticalLayout vl = new VerticalLayout();
            // vl.setWidth(null);
            Button b = new Button("String 1 2 3");
            b.setStyleName(BaseTheme.BUTTON_LINK);
            vl.addComponent(b);
            t.addItem(new Object[] { vl, "String 2", "String 3", "String 4",

            new Button("String 5") }, new Integer(new Random().nextInt()));

        }
View Full Code Here


    private int windowCount = 0;
    private ComboBox addWindowAgain;

    private Window createNewWindow() {
        final Window w = new Window("Window " + (++windowCount));
        final VerticalLayout content = new VerticalLayout();
        w.setContent(content);
        w.setData(windowCount);
        w.setWidth("200px");
        w.setHeight("300px");
        w.setPositionX(200);
View Full Code Here

    @Override
    public void init() {
        setMainWindow(new LegacyWindow());
        getMainWindow().getContent().setWidth("250px");
        gl = new VerticalLayout();
        gl.setSizeUndefined();
        gl.setStyleName("borders");
        getMainWindow().addComponent(gl);
        setTheme("tests-tickets");
        combo = new ComboBox("Combo caption");
View Full Code Here

    private void orderedLayout(Layout layout) {
        Panel p = new Panel("OrderedLayout");
        layout.addComponent(p);

        AbstractOrderedLayout ol = new VerticalLayout();
        ol.setMargin(true);
        ol.setCaption("Horizontal");
        // ol.setWidth("100%");

        Button b;

        b = new Button("Wide button");
        b.setWidth("500px");
        ol.addComponent(b);

        addButtons(ol);
        p.setContent(ol);

        /* VERTICAL */

        ol = new HorizontalLayout();
        ol.setMargin(true);
        ol.setCaption("Vertical");

        addButtons(ol);
        b = new Button("High button");
        b.setHeight("200px");
        ol.addComponent(b);

        p.setContent(ol);

    }
View Full Code Here

        return 5038;
    }

    @Override
    protected void setup() {
        VerticalLayout layout = new VerticalLayout();
        layout.addListener(new LayoutClickListener() {
            @Override
            public void layoutClick(LayoutClickEvent event) {
                WindowClickEvents.this.click("Sub window layout", event);
            }
        });

        ((VerticalLayout) getMainWindow().getContent())
                .addListener(new LayoutClickListener() {
                    @Override
                    public void layoutClick(LayoutClickEvent event) {
                        WindowClickEvents.this.click("Main window layout",
                                event);
                    }
                });
        layout.setMargin(true);
        Window centered = new Window("A window with a click listener", layout);
        centered.addListener(new ClickListener() {

            @Override
            public void click(ClickEvent event) {
                WindowClickEvents.this.click("Sub window", event);
            }

        });
        centered.setSizeUndefined();
        layout.setSizeUndefined();
        centered.center();

        Label l = new Label("This window is centered");
        l.setSizeUndefined();
        Button b = new Button(
                "Clicking here should not produce a layout click event");
        b.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
                log.log("Click on button");
            }

        });
        layout.addComponent(l);
        layout.addComponent(b);

        getMainWindow().addWindow(centered);
        log = new Log(5);
        addComponent(log);
        getMainWindow().addListener(new ClickListener() {
View Full Code Here

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getName());
        setMainWindow(w);

        final VerticalLayout l = new VerticalLayout();
        l.setWidth("400px");
        l.setHeight("100px");
        l.addComponent(new TextField("This one works fine"));
        TextField t = new TextField();
        t.setRequired(true);
        t.setValue("This one bugs");
        l.addComponent(t);
        w.addComponent(l);

        w.addComponent(new Button("show me the bug",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        l.setWidth(null);
                    }
                }));

    }
View Full Code Here

    @Override
    public void setup() {
        LegacyWindow main = getMainWindow();

        final VerticalLayout mainLayout = new VerticalLayout();
        main.setContent(mainLayout);

        mainLayout.addComponent(new Label(
                "Replace the floating-point values with an integer"));

        // ///////////////////////////////////////////////////
        // Better working case

        final ObjectProperty<Double> property1 = new ObjectProperty<Double>(
                new Double(42.0));

        // A text field that changes its caption
        final TextField tf1 = new TextField(
                "Changing this field modifies only the textfield", property1);
        tf1.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                // This value change event is called twice if the new
                // input value is an integer. The second time is during
                // paint() of AbstractOrderedLayout.

                System.out.println("Value 2 is: " + property1.getValue());

                tf1.setCaption("With caption " + property1.getValue());
            }
        });
        tf1.setImmediate(true);
        mainLayout.addComponent(tf1);

        // ///////////////////////////////////////////////////
        // Totally failing case

        final ObjectProperty<Double> property2 = new ObjectProperty<Double>(
                new Double(42.0));

        // A text field that adds new components
        final TextField tf2 = new TextField(
                "Changing this field modifies the layout - do it twice",
                property2);
        tf2.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                // This value change event is called twice if the new
                // input value is an integer. The second time is during
                // paint() of AbstractOrderedLayout.

                System.out.println("Value 1 is: " + property2.getValue());

                // When this listener is called the second time in paint(), the
                // add operation causes a ConcurrentModificationException
                mainLayout.addComponent(new Label(
                        "Added a component, value is " + property2.getValue()));
            }
        });
        tf2.setImmediate(true);
        mainLayout.addComponent(tf2);

        mainLayout.setSpacing(true);
    }
View Full Code Here

            }
        });

        split.setFirstComponent(table);
        split.setSplitPosition(100, Sizeable.UNITS_PERCENTAGE);
        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        Panel editor = new Panel("Editor", pl);
        editor.setSizeFull();
        split.setSecondComponent(editor);
        getLayout().setSizeFull();
        getLayout().addComponent(split);
View Full Code Here

        cl.setWidth("100%");
        w.setContent(cl);

        // VerticalLayout ol = new VerticalLayout();
        // w.setContent(ol);
        VerticalLayout hugeLayout = new VerticalLayout();
        hugeLayout.setMargin(true);
        hugeLayout.setSpacing(true);
        for (int i = 0; i < 30; i++) {
            hugeLayout.addComponent(new Label("huge " + i));
        }
        cl.addComponent(hugeLayout, "test");
        // ol.addComponent(hugeLayout);
        setMainWindow(w);
    }
View Full Code Here

        HorizontalLayout split = new HorizontalLayout();
        split.setWidth("100%");
        addComponent(split);

        VerticalLayout left = new VerticalLayout();
        left.setMargin(new MarginInfo(false, true, false, false));
        split.addComponent(left);

        Label huge = new Label("Huge type for display text.");
        huge.addStyleName("huge");
        left.addComponent(huge);

        Label large = new Label(
                "Large type for introductory text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        large.addStyleName("large");
        left.addComponent(large);

        Label h2 = new Label("Subtitle");
        h2.addStyleName("h2");
        left.addComponent(h2);

        Label normal = new Label(
                "Normal type for plain text, with a <a href=\"https://vaadin.com\">regular link</a>. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.",
                ContentMode.HTML);
        left.addComponent(normal);

        Label h3 = new Label("Small Title");
        h3.addStyleName("h3");
        left.addComponent(h3);

        Label small = new Label(
                "Small type for additional text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        small.addStyleName("small");
        left.addComponent(small);

        Label tiny = new Label("Tiny type for minor text.");
        tiny.addStyleName("tiny");
        left.addComponent(tiny);

        Label h4 = new Label("Section Title");
        h4.addStyleName("h4");
        left.addComponent(h4);

        normal = new Label(
                "Normal type for plain text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        left.addComponent(normal);

        Panel p = new Panel("Additional Label Styles");
        split.addComponent(p);

        VerticalLayout right = new VerticalLayout();
        right.setSpacing(true);
        right.setMargin(true);
        p.setContent(right);

        Label label = new Label(
                "Bold type for prominent text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        label.addStyleName("bold");
        right.addComponent(label);

        label = new Label(
                "Light type for subtle text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        label.addStyleName("light");
        right.addComponent(label);

        label = new Label(
                "Colored type for highlighted text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        label.addStyleName("colored");
        right.addComponent(label);

        label = new Label("A label for success");
        label.addStyleName("success");
        right.addComponent(label);

        label = new Label("A label for failure");
        label.addStyleName("failure");
        right.addComponent(label);

    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.VerticalLayout

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.