Package com.vaadin.ui

Examples of com.vaadin.ui.AbstractOrderedLayout


    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


    @Override
    public void init() {
        mainWindow = new LegacyWindow("Ticket 2061b");
        mainWindow.setSizeFull();
        AbstractOrderedLayout mainLayout = (AbstractOrderedLayout) mainWindow
                .getContent();
        mainLayout.setSizeFull();
        mainLayout.setMargin(false);
        setMainWindow(mainWindow);

        VerticalSplitPanel sp = new VerticalSplitPanel();
        sp.setSizeFull();
        sp.setSplitPosition(20, Sizeable.UNITS_PIXELS);

        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        p = new Panel("This is a panel", pl);
        p.setSizeFull();
        Label label1 = new Label("This is a table!");
        label1.setHeight("1500px");
        label1.setWidth("1500px");
        pl.addComponent(label1);
        p.setScrollTop(50);
        // MyTable table1 = new MyTable(24, "table1");
        // table1.loadTable(1000);

        // MyTable table2 = new MyTable(24, "table2");
        // table2.loadTable(1000);

        // MyTable table3 = new MyTable(24, "table3");
        // table3.loadTable(1000);

        // MyAccordion accordion = new MyAccordion(new Component[] { table1,
        // table2 }, "Test");

        Label a = new Label("abc123");
        TextField tf = new TextField("A large textfield");
        tf.setHeight("2500px");
        tf.setWidth("2500px");

        TabsAcc tab = new TabsAcc(new Component[] { p, a, tf });
        tab.addListener(this);

        mainLayout.addComponent(sp);
        sp.addComponent(new Label("C 1"));
        // sp.addComponent(new Label("C 2"));
        // sp.setHeight("100px");

        sp.addComponent(tab);
View Full Code Here

*
*/
public class TestSelectAndDatefieldInDeepLayouts extends CustomComponent {

    public TestSelectAndDatefieldInDeepLayouts() {
        final AbstractOrderedLayout root = getOrderedLayout();
        setCompositionRoot(root);

        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

        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;

        final Button b = new Button("refresh view", new Button.ClickListener() {
            @Override
View Full Code Here

        p.setWidth("500px");
        p.setHeight("500px");
        pl.setWidth("100%");
        layout.addComponent(p);

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

        /* VERTICAL */

        ol = new HorizontalLayout();
        ol.setMargin(true);
        // ol.setCaption("Vertical");
        ol.setHeight("200px");
        addButtons(ol);
        // Button b = new Button("High button");
        // b.setHeight(200);
        // ol.addComponent(b);
        pl.addComponent(ol);
View Full Code Here

        Panel p = new Panel("ExpandLayout", panelLayout);
        layout.addComponent(p);
        panelLayout.setWidth("500");
        panelLayout.setHeight("400");

        AbstractOrderedLayout el = new VerticalLayout();
        // el.setCaption("Horizontal");
        // el.setSizeUndefined();
        // el.setWidth("100%");
        // ol.setWidth("100%");
        Button b;
View Full Code Here

*/
public class LayoutSettingsOnReplace {

    @Test
    public void testExpandRatio() {
        AbstractOrderedLayout layout = new AbstractOrderedLayout() {
        };

        AbstractComponent first = new AbstractComponent() {
        };
        AbstractComponent second = new AbstractComponent() {
        };

        layout.addComponent(first);
        layout.addComponent(second);

        int ratio = 2;
        layout.setExpandRatio(first, ratio);
        layout.setExpandRatio(second, 1);

        AbstractComponent replace = new AbstractComponent() {
        };
        layout.replaceComponent(first, replace);

        Assert.assertEquals("Expand ratio for replaced component is not "
                + "the same as for previous one", ratio,
                layout.getExpandRatio(replace), 0.0001);
    }
View Full Code Here

                layout.getExpandRatio(replace), 0.0001);
    }

    @Test
    public void testAlignment() {
        AbstractOrderedLayout layout = new AbstractOrderedLayout() {
        };

        AbstractComponent first = new AbstractComponent() {
        };
        AbstractComponent second = new AbstractComponent() {
        };

        layout.addComponent(first);
        layout.addComponent(second);

        Alignment alignment = Alignment.BOTTOM_RIGHT;
        layout.setComponentAlignment(first, alignment);
        layout.setComponentAlignment(second, Alignment.MIDDLE_CENTER);

        AbstractComponent replace = new AbstractComponent() {
        };
        layout.replaceComponent(first, replace);

        Assert.assertEquals("Alignment for replaced component is not "
                + "the same as for previous one", alignment,
                layout.getComponentAlignment(replace));
    }
View Full Code Here

    Component[] children = new Component[] { new Label("A"), new Label("B"),
            new Label("C"), new Label("D") };

    @Test
    public void moveComponentsBetweenLayouts() {
        AbstractOrderedLayout layout1 = new HorizontalLayout();
        AbstractOrderedLayout layout2 = new VerticalLayout();

        layout1.addComponent(children[0]);
        layout1.addComponent(children[1]);

        layout2.addComponent(children[2]);
        layout2.addComponent(children[3]);

        layout2.addComponent(children[1], 1);
        assertOrder(layout1, new int[] { 0 });
        assertOrder(layout2, new int[] { 2, 1, 3 });

        layout1.addComponent(children[3], 0);
        assertOrder(layout1, new int[] { 3, 0 });
        assertOrder(layout2, new int[] { 2, 1 });

        layout2.addComponent(children[0]);
        assertOrder(layout1, new int[] { 3 });
        assertOrder(layout2, new int[] { 2, 1, 0 });

        layout1.addComponentAsFirst(children[1]);
        assertOrder(layout1, new int[] { 1, 3 });
View Full Code Here

        assertOrder(layout, new int[] { 2, 3, 1, 0 });
    }

    @Test
    public void testConstructorsWithComponents() {
        AbstractOrderedLayout layout1 = new HorizontalLayout(children);
        assertOrder(layout1, new int[] { 0, 1, 2, 3 });
        shuffleChildComponents(layout1);

        AbstractOrderedLayout layout2 = new VerticalLayout(children);
        assertOrder(layout2, new int[] { 0, 1, 2, 3 });
        shuffleChildComponents(layout2);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.AbstractOrderedLayout

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.