Package com.vaadin.ui

Examples of com.vaadin.ui.GridLayout


    @Override
    protected void setup() {
        date.set(2011, 0, 1);

        GridLayout layout = new GridLayout(2, 3);
        layout.setWidth("600px");
        layout.setSpacing(true);

        final DateField[] fields = new DateField[6];

        Locale fi = new Locale("fi", "FI");
        Locale us = new Locale("en", "US");

        fields[0] = makeDateField(true, fi, "Finnish locale");
        fields[1] = makeDateField(false, fi, "Finnish locale");

        fields[2] = makeDateField(true, us, "US English locale");
        fields[3] = makeDateField(false, us, "US English locale");

        fields[4] = makeDateField(true, fi, "Finnish locale with week numbers");
        fields[4].setShowISOWeekNumbers(true);
        fields[5] = makeDateField(false, fi, "Finnish locale with week numbers");
        fields[5].setShowISOWeekNumbers(true);

        for (DateField f : fields) {
            layout.addComponent(f);
        }

        addComponent(layout);

        addComponent(new Button("Change date", new ClickListener() {
View Full Code Here


        customFormats = n;

    }

    private GridLayout getCustomFormats(Locale locale) {
        GridLayout gridLayout = createGridLayout();
        usedDebugIds.clear();
        addDateFields(gridLayout, locale);

        return gridLayout;
    }
View Full Code Here

        return gridLayout;
    }

    private GridLayout createGridLayout() {
        GridLayout gridLayout = new GridLayout(4, 4);
        gridLayout.setMargin(true);
        gridLayout.addComponent(new Label("FORMAT"));
        gridLayout.addComponent(new Label("DATEFIELD"));
        gridLayout.addComponent(new Label("SERVER SIDE VALUE"));
        gridLayout.addComponent(new Label("EXPECTED"));

        return gridLayout;
    }
View Full Code Here

public class GridLayoutSpanExpansion extends TestBase {

    @Override
    protected void setup() {
        GridLayout heightSpan = new GridLayout(2, 2);
        heightSpan.setHeight("200px");
        heightSpan.setWidth("200px");
        heightSpan.addComponent(new Label("1"), 0, 0);
        heightSpan.addComponent(new Label("2"), 0, 1);
        heightSpan.addComponent(new Label(
                "This is a somewhat long text that spans over a few lines."),
                1, 0, 1, 1);
        heightSpan.setRowExpandRatio(1, 1);
        addComponent(heightSpan);

        GridLayout widthSpan = new GridLayout(2, 2);
        widthSpan.setHeight("100px");
        widthSpan.setWidth("200px");
        widthSpan.addComponent(new Label(
                "This is a somewhat long text that spans over both columns."),
                0, 0, 1, 0);
        Label label1 = new Label("1");
        label1.setSizeUndefined();
        widthSpan.addComponent(label1, 0, 1);
        widthSpan.addComponent(new Label("2"), 1, 1);
        widthSpan.setColumnExpandRatio(1, 1);
        addComponent(widthSpan);

        GridLayout multipleSpans = new GridLayout(3, 3);
        multipleSpans.setWidth("400px");
        multipleSpans.addComponent(new Button("Button 0,0"), 0, 0);
        multipleSpans.addComponent(new Button("Button 1,0"), 1, 0);
        multipleSpans.addComponent(
                makeWideButton("A wide spanning button at 0,1"), 0, 1, 1, 1);
        multipleSpans.addComponent(
                makeWideButton("Another wide spanning button at 1,2"), 1, 2, 2,
                2);
        multipleSpans.setColumnExpandRatio(0, 1);
        multipleSpans.setColumnExpandRatio(1, 3);
        multipleSpans.setColumnExpandRatio(2, 2);
        addComponent(multipleSpans);
    }
View Full Code Here

        });

        expectedSize.setId("expected");
        receivedSize.setId("received");

        GridLayout grid = new GridLayout(2, 2);
        grid.addComponent(new Label("Expected size:"), 0, 0);
        grid.addComponent(new Label("Received size:"), 0, 1);
        grid.addComponent(expectedSize, 1, 0);
        grid.addComponent(receivedSize, 1, 1);

        addComponent(label);
        addComponent(grid);
        addComponent(u);
    }
View Full Code Here

    }

    private void testGridLayout() {
        content.removeAllComponents();

        final GridLayout g = new GridLayout(4, 4);
        g.setWidth("300px");
        g.setHeight("300px");
        g.setHideEmptyRowsAndColumns(true);
        g.addComponentAttachListener(new ComponentAttachListener() {
            @Override
            public void componentAttachedToContainer(ComponentAttachEvent event) {
                GridLayout layout = (GridLayout) event.getContainer();
                GridLayout.Area area = layout.getComponentArea(event
                        .getAttachedComponent());
                getMainWindow().showNotification(
                        "Attached to " + area.getColumn1() + ","
                                + area.getRow1(),
                        Notification.TYPE_ERROR_MESSAGE);
View Full Code Here

        WindowsCssTest windows = new WindowsCssTest(this);
        createComponentLayout("Windows", windows);
    }

    private void createAccordions() {
        GridLayout grid = createGridLayoutBase();
        createComponentLayout("Accordions", grid);
        new AccordionsCssTest(this);
    }
View Full Code Here

        createComponentLayout("Accordions", grid);
        new AccordionsCssTest(this);
    }

    private void createTabSheets() {
        GridLayout grid = createGridLayoutBase();
        createComponentLayout("TabSheets", grid);
        new TabSheetsCssTest(this);
    }
View Full Code Here

        createComponentLayout("TabSheets", grid);
        new TabSheetsCssTest(this);
    }

    private GridLayout createGridLayoutBase() {
        GridLayout grid = new GridLayout();
        grid.setColumns(3);
        grid.setWidth("100%");
        return grid;
    }
View Full Code Here

        grid.setWidth("100%");
        return grid;
    }

    private void createLayouts() {
        GridLayout grid = new LayoutsCssTest(this);
        createComponentLayout("Layouts", grid);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.GridLayout

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.