Package com.vaadin.ui

Examples of com.vaadin.ui.HorizontalLayout


    /* LAYOUTS */

    @SuppressWarnings({ "unused", "deprecation" })
    private Layout layout1() {
        HorizontalLayout ol = new HorizontalLayout();
        ol.setHeight("200px");
        ol.setWidth("");
        ol.setCaption("Fixed height (200px) and dynamic width");

        TextField tf = new TextField("100px high TextField, valign: bottom");
        tf.setHeight("100px");
        tf.setWidth("");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);

        ListSelect s = new ListSelect("100% high select");
        s.setMultiSelect(true);
        s.setHeight("100%");
        s.setWidth("");
        ol.addComponent(s);

        s = new ListSelect("200 px high select");
        s.setMultiSelect(true);
        s.setHeight("200px");
        s.setWidth("");
        ol.addComponent(s);

        // tf = new TextField("100% high TextField, right/bottom");
        // tf.setHeight("100%");
        // tf.setWidth("");
        // ol.addComponent(tf);
View Full Code Here


    }

    @SuppressWarnings({ "unused", "deprecation" })
    private Layout layout2() {
        HorizontalLayout ol = new HorizontalLayout();
        ol.setHeight("70px");
        ol.setWidth("");
        ol.setCaption("Fixed height (50px) and dynamic width");

        TextField tf = new TextField(
                "100px high TextField, valign: bottom, should be partly outside");
        tf.setHeight("100px");
        tf.setWidth("");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);

        tf = new TextField(
                "100% high, 50px wide TextField, valign: bottom, should fill full height");
        tf.setHeight("100%");
        tf.setWidth("50px");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);

        Label l = new Label(
                "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");
        tf.setHeight("100%");
        tf.setWidth("50px");
        ol.addComponent(l);
        ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT);

        ListSelect s = new ListSelect(
                "100% high select, should fit into layout");
        s.setMultiSelect(true);
        s.setHeight("100%");
        s.setWidth("");
        for (int i = 0; i < 10; i++) {
            s.addItem(new Object());
        }

        ol.addComponent(s);

        s = new ListSelect("200 px high select, should be partly outside");
        s.setMultiSelect(true);
        s.setHeight("200px");
        s.setWidth("");
        ol.addComponent(s);

        return ol;
    }
View Full Code Here

                    drawInExpandLayout();
                }
            }
        });

        HorizontalLayout ol = new HorizontalLayout();
        ol.addComponent(context);
        ol.addComponent(testComponent);
        ol.addComponent(width);
        ol.addComponent(height);
        ol.addComponent(set);
        ol.setSpacing(true);
        ol.setMargin(true);

        Window controller = new Window("Controller");
        controller.setContent(ol);
        main.addWindow(controller);
    }
View Full Code Here

        return ol;
    }

    @SuppressWarnings({ "unused", "deprecation" })
    private Layout layout3() {
        HorizontalLayout ol = new HorizontalLayout();
        ol.setHeight("");
        ol.setWidth("500px");
        ol.setCaption("Fixed width (500px) and dynamic height");
        TextField tf;

        tf = new TextField("100px high TextField, valign: bottom");
        tf.setHeight("100px");
        tf.setWidth("100%");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);

        tf = new TextField("100px high TextField, valign: top");
        tf.setHeight("100px");
        tf.setWidth("100%");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.TOP_LEFT);

        tf = new TextField("100% high, 50px wide TextField, valign: bottom");
        tf.setHeight("100%");
        tf.setWidth("50px");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);

        Label l = new Label(
                "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");
        tf.setHeight("100%");
        tf.setWidth("50px");
        ol.addComponent(l);
        ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT);

        ListSelect s = new ListSelect(
                "100% high select, should fit into layout");
        s.setMultiSelect(true);
        s.setHeight("100%");
        s.setWidth("100%");
        for (int i = 0; i < 10; i++) {
            s.addItem(new Object());
        }

        ol.addComponent(s);

        s = new ListSelect(
                "200 px high select, should make the layout 200px high");
        s.setMultiSelect(true);
        s.setHeight("200px");
        s.setWidth("100%");
        ol.addComponent(s);

        return ol;
    }
View Full Code Here

        gl.setRowExpandRatio(3, 1);

        gl.setWidth("500px");
        gl.setHeight("800px");

        HorizontalLayout images = new HorizontalLayout();
        images.setSpacing(true);

        Label l = new Label("Chameleon theme image in caption");
        l.setIcon(new ThemeResource("img/magnifier.png"));
        images.addComponent(l);
        Image image = new Image("Runo theme image", new ThemeResource(
                "icons/64/ok.png"));
        images.addComponent(image);
        image = new Image("Reindeer theme image", new ThemeResource(
                "button/img/left-focus.png"));
        images.addComponent(image);
        addComponent(images);
        addComponent(gl);

        getLayout().setSpacing(true);
View Full Code Here

        return ol;
    }

    @SuppressWarnings({ "unused", "deprecation" })
    private Layout layout3New() {
        HorizontalLayout ol = new HorizontalLayout();
        ol.setHeight("300px");
        // ol.setWidth("500px");
        ol.setWidth("");
        ol.setCaption("Dynamic width and fixed height(300px)");
        TextField tf;

        tf = new TextField("100px high TextField, valign: bottom");
        tf.setHeight("100px");
        tf.setWidth("100%");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);

        tf = new TextField("100px high TextField, valign: top");
        tf.setHeight("100px");
        tf.setWidth("100%");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.TOP_LEFT);

        tf = new TextField("100% high, 50px wide TextField, valign: bottom");
        tf.setHeight("100%");
        tf.setWidth("50px");
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);

        Label l = new Label(
                "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");
        tf.setHeight("100%");
        tf.setWidth("50px");
        ol.addComponent(l);
        ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT);

        ListSelect s = new ListSelect(
                "100% high select, should fit into layout");
        s.setMultiSelect(true);
        s.setHeight("100%");
        s.setWidth("100%");
        for (int i = 0; i < 10; i++) {
            s.addItem(new Object());
        }

        ol.addComponent(s);

        s = new ListSelect(
                "200 px high select, should make the layout 200px high");
        s.setMultiSelect(true);
        s.setHeight("200px");
        s.setWidth("100%");
        ol.addComponent(s);

        return ol;
    }
View Full Code Here

            root.addComponent(getRow(i));
        }
    }

    private HorizontalLayout getRow(int i) {
        HorizontalLayout row = new HorizontalLayout();
        // row.setWidth("100%");
        // row.setSpacing(true);

        Embedded icon = new Embedded(null, new ThemeResource(
                "../runo/icons/32/document.png"));
        // row.addComponent(icon);
        // row.setComponentAlignment(icon, Alignment.MIDDLE_LEFT);

        Label text = new Label(
                "Row content #"
                        + i
                        + ". In pellentesque faucibus vestibulum. Nulla at nulla justo, eget luctus tortor. Nulla facilisi. Duis aliquet.");
        // row.addComponent(text);
        // row.setExpandRatio(text, 1);

        Button button = new Button("Edit");
        button.addStyleName(Reindeer.BUTTON_SMALL);
        row.addComponent(button);
        // row.setComponentAlignment(button, Alignment.MIDDLE_LEFT);

        button = new Button("Delete");
        button.addStyleName(Reindeer.BUTTON_SMALL);
        row.addComponent(button);
        // row.setComponentAlignment(button, Alignment.MIDDLE_LEFT);

        return row;
    }
View Full Code Here

public class TestLayoutClickListeners extends AbstractTestUIWithLog {

    @Override
    protected void setup(VaadinRequest request) {
        HorizontalLayout layoutsLayout = new HorizontalLayout();
        layoutsLayout.setSpacing(true);
        addComponent(layoutsLayout);

        layoutsLayout.addComponent(createClickableGridLayout());
        layoutsLayout.addComponent(createClickableVerticalLayout());
        layoutsLayout.addComponent(createClickableAbsoluteLayout());
        layoutsLayout.addComponent(createClickableCSSLayout());
    }
View Full Code Here

        setMainWindow(mainWindow);

    }

    private Window createSubWindow() {
        HorizontalLayout hl = new HorizontalLayout();

        VerticalLayout vlTF1 = new VerticalLayout();
        vlTF1.setSizeUndefined();
        final TextField tf1 = new TextField("Text1");
        tf1.setSizeUndefined();
        vlTF1.addComponent(tf1);
        hl.addComponent(vlTF1);

        VerticalLayout vlTF2 = new VerticalLayout();
        vlTF2.setSizeUndefined();
        final TextField tf2 = new TextField("Text2");
        tf2.setVisible(false);
        tf2.setSizeUndefined();
        vlTF2.addComponent(tf2);
        hl.addComponent(vlTF2);

        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        layout.setSizeUndefined();
        Window wnd = new Window("Test", layout);
View Full Code Here

        root.getContent().setSizeFull();
        ((MarginHandler) root.getContent()).setMargin(false);

        // Top area, containing playback and volume controls, play status, view
        // modes and search
        HorizontalLayout top = new HorizontalLayout();
        // GridLayout top = new GridLayout(1, 1);
        top.setWidth("100%");
        top.setMargin(false);
        top.setSpacing(false);

        // Let's attach that one straight away too
        root.addComponent(top);

        label = new Label(
                "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent porttitor porta lacus. Nulla tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mollis turpis in mauris faucibus posuere. Nullam rutrum, nisi a fermentum tempus, lacus metus rutrum massa, a condimentum mauris justo a tortor. Mauris aliquet, ante quis ultricies posuere, sapien libero laoreet sem, a accumsan diam metus sed elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vehicula metus nec turpis dignissim cursus. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam feugiat orci eget risus. Vestibulum at sem. ");
        label.setWidth("100%");
        top.addComponent(label);
        split = new HorizontalSplitPanel();
        split.setHeight("100%");
        Embedded image = new Embedded("An image", new ExternalResource(
                "http://dev.itmill.com/chrome/site/toolkit-logo.png"));
        image.setWidth("100%");
View Full Code Here

TOP

Related Classes of com.vaadin.ui.HorizontalLayout

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.