Package com.vaadin.ui

Examples of com.vaadin.ui.VerticalLayout


        root.addComponent(getSelect());
        root.addComponent(getDateField());
        root.addComponent(getSelect());
        root.addComponent(getDateField());

        final VerticalLayout p1Layout = createPanelLayout();
        final Panel p1 = getPanel(p1Layout);
        p1.setContent(p1Layout);
        root.addComponent(p1);

        p1Layout.addComponent(getSelect());
        p1Layout.addComponent(getDateField());
        p1Layout.addComponent(getSelect());
        p1Layout.addComponent(getDateField());

        final AbstractOrderedLayout l1 = getOrderedLayout();
        p1Layout.addComponent(l1);

        l1.addComponent(getSelect());
        l1.addComponent(getDateField());
        l1.addComponent(getSelect());
        l1.addComponent(getDateField());

        final VerticalLayout p2Layout = createPanelLayout();
        final Panel p2 = getPanel(p2Layout);
        l1.addComponent(p2);

        p2Layout.addComponent(getSelect());
        p2Layout.addComponent(getDateField());
        p2Layout.addComponent(getSelect());
        p2Layout.addComponent(getDateField());
    }
View Full Code Here


        p2Layout.addComponent(getSelect());
        p2Layout.addComponent(getDateField());
    }

    VerticalLayout getOrderedLayout() {
        final VerticalLayout l = new VerticalLayout();
        l.setCaption(getCaption("orderedlayout"));
        return l;
    }
View Full Code Here

        l.setCaption(getCaption("orderedlayout"));
        return l;
    }

    private VerticalLayout createPanelLayout() {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        return layout;
    }
View Full Code Here

    protected void setup(VaadinRequest request) {
        buildUI(FontAwesome.ANDROID);
    }

    private void buildUI(final Resource icon) {
        VerticalLayout layout = new VerticalLayout();
        setContent(layout);
        layout.setMargin(true);

        layout.setIcon(icon);

        layout.addComponent(new Button("Switch icon type",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        buildUI(icon instanceof FontIcon ? new ThemeResource(
                                "../runo/icons/16/user.png")
                                : FontAwesome.ANDROID);
                    }
                }));

        Handler actionHandler = new Handler() {
            Action[] actions = { new Action("Do it!", icon) };

            @Override
            public void handleAction(Action action, Object sender, Object target) {

            }

            @Override
            public Action[] getActions(Object target, Object sender) {
                return actions;
            }
        };

        // Notification
        Notification n = new Notification("Hey there!");
        n.setIcon(icon);
        n.setPosition(Position.BOTTOM_CENTER);
        n.setDelayMsec(300000);
        n.show(Page.getCurrent());

        // grid of compoents
        GridLayout gl = new GridLayout(4, 5);
        gl.setSpacing(true);
        layout.addComponent(gl);

        // Basic components, caption icon only
        Class<?>[] components = { Button.class, CheckBox.class,
                DateField.class, NativeButton.class, Link.class, Label.class,
                Panel.class, Slider.class, TextArea.class, TextField.class,
                Upload.class };
        for (Class<?> clazz : components) {
            Component c;
            try {
                c = (Component) clazz.newInstance();
            } catch (Exception e) {
                e.printStackTrace();
                continue;
            }
            c.setCaption(clazz.getSimpleName());
            c.setIcon(icon);
            gl.addComponent(c);
        }

        // TabSheet, caption + tab icons
        TabSheet tabs = new TabSheet();
        tabs.setCaption("TabSheet");
        tabs.setIcon(icon);
        tabs.addStyleName("myTabs");
        tabs.addTab(new Label("Content 1"), "Tab 1", icon);
        tabs.addTab(new Label("Content 2"), "Tab 2", icon);
        tabs.setWidth("150px");
        gl.addComponent(tabs);

        // Accordion, caption + tab icons
        Accordion acc = new Accordion();
        acc.setCaption("Accordion");
        acc.setIcon(icon);
        acc.addTab(new Label(), "Section 1", icon);
        acc.addTab(new Label(), "Section 2", icon);
        gl.addComponent(acc);

        // Table, caption + column + row + action icons
        Table tbl = new Table("Table");
        tbl.setRowHeaderMode(RowHeaderMode.ICON_ONLY);
        tbl.setIcon(icon);
        tbl.addContainerProperty("Column 1", String.class, "Row", "Column 1",
                icon, Align.LEFT);
        tbl.addContainerProperty("Column 2", String.class, "Row", "Column 2",
                icon, Align.LEFT);
        tbl.setItemIcon(tbl.addItem(), icon);
        tbl.setItemIcon(tbl.addItem(), icon);
        tbl.setItemIcon(tbl.addItem(), icon);
        tbl.setPageLength(3);
        gl.addComponent(tbl);
        tbl.addActionHandler(actionHandler);

        // Selects, caption + item icons
        Class<?>[] selects = { ComboBox.class, NativeSelect.class,
                ListSelect.class, TwinColSelect.class, OptionGroup.class };
        for (Class<?> clazz : selects) {
            AbstractSelect sel;
            try {
                sel = (AbstractSelect) clazz.newInstance();
            } catch (Exception e) {
                e.printStackTrace();
                continue;
            }
            sel.setCaption(clazz.getSimpleName());
            sel.setIcon(icon);
            sel.addItem("One");
            sel.setItemIcon("One", icon);
            sel.addItem("Two");
            sel.setItemIcon("Two", icon);
            gl.addComponent(sel);
        }

        // MenuBar, caption + item + sub-item icons
        MenuBar menu = new MenuBar();
        menu.setIcon(icon);
        menu.setCaption("MenuBar");
        MenuItem mi = menu.addItem("File", icon, null);
        MenuItem smi = mi.addItem("Item", icon, null);
        smi = mi.addItem("Item", icon, null);
        smi = smi.addItem("Item", icon, null);
        gl.addComponent(menu);

        // Tree, caption + item + subitem + action icons
        Tree tree = new Tree("Tree");
        tree.addItem("Root");
        tree.setItemIcon("Root", icon);
        tree.addItem("Leaf");
        tree.setItemIcon("Leaf", icon);
        tree.setParent("Leaf", "Root");
        tree.expandItemsRecursively("Root");
        tree.addActionHandler(actionHandler);
        gl.addComponent(tree);

        // All of FontAwesome
        String allIcons = "";
        for (FontIcon ic : FontAwesome.values()) {
            allIcons += ic.getHtml() + " ";
        }
        layout.addComponent(new Label(allIcons, ContentMode.HTML));
    }
View Full Code Here

        t = createTestTree();
        t.setCaption("with actions");
        t.setImmediate(true);
        t.addActionHandler(this);
        final AbstractOrderedLayout ol = (AbstractOrderedLayout) createTestBench(t);
        al = new VerticalLayout();
        al.setMargin(true);
        ol.addComponent(new Panel("action log", al));
        main.addComponent(ol);
        contextTree = t;
View Full Code Here

    public Component createTestBench(Tree t) {
        final HorizontalLayout ol = new HorizontalLayout();

        ol.addComponent(t);

        final VerticalLayout statusLayout = new VerticalLayout();
        statusLayout.setMargin(true);
        final Panel status = new Panel("Events", statusLayout);
        final Button clear = new Button("c");
        clear.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                statusLayout.removeAllComponents();
                statusLayout.addComponent(clear);
            }
        });
        statusLayout.addComponent(clear);

        status.setHeight("300px");
        status.setWidth("400px");

        ol.addComponent(status);

        t.addListener(new Listener() {
            @Override
            public void componentEvent(Event event) {
                statusLayout
                        .addComponent(new Label(event.getClass().getName()));
                // TODO should not use Field.toString()
                statusLayout.addComponent(new Label("selected: "
                        + event.getSource().toString()));
            }
        });

        return ol;
View Full Code Here

        hl.addComponent(panel2);
        mainw.addComponent(hl);

        HorizontalSplitPanel sp = new HorizontalSplitPanel();

        VerticalLayout first = new VerticalLayout();
        first.addComponent(new Label("first"));
        VerticalLayout second = new VerticalLayout();
        second.addComponent(new Label("second"));

        sp.setFirstComponent(first);
        sp.setSecondComponent(second);

        VerticalSplitPanel sp2 = new VerticalSplitPanel();
View Full Code Here

        mainw.addComponent(new Button("click me to save split panel state"));
    }

    private Panel buildPanel(String caption) {
        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        return new Panel(caption, pl);
    }
View Full Code Here

public class StationaryTooltip extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        VerticalLayout vl = new VerticalLayout();
        Button button = new Button("Button");
        button.setDescription("description");

        button.setWidth("200px");
        vl.addComponent(button);

        addComponent(vl);
    }
View Full Code Here

public class ButtonIOSDragTest extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        final VerticalLayout layout = new VerticalLayout();

        Button offset = new Button("Drag me");
        offset.addListener(new ClickListener() {
            @Override
            public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
                Notification.show("Button clicked!");
            }
        });
        DragAndDropWrapper dragMe = new DragAndDropWrapper(offset);
        dragMe.setDragStartMode(DragStartMode.WRAPPER);
        layout.addComponent(dragMe);
        addComponent(layout);
    }
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.