Package com.vaadin.tests.components.table

Source Code of com.vaadin.tests.components.table.WideSelectableTable

package com.vaadin.tests.components.table;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;

public class WideSelectableTable extends TestBase {

    @Override
    protected void setup() {
        final int NUMBER_OF_COLS = 50;

        // mainWindow.setSizeFull();
        // setMainWindow(mainWindow);

        Table ptable = new Table();
        for (int colcount = 0; colcount < NUMBER_OF_COLS; colcount++) {
            String col = "COL_" + colcount + "";
            ptable.addContainerProperty(col, String.class, "--");
            ptable.addItem(colcount + "-").getItemProperty(col)
                    .setValue("--" + colcount + "");
        }
        ptable.setSelectable(true);
        ptable.setMultiSelect(true);
        ptable.setColumnReorderingAllowed(false);
        ptable.setImmediate(true);

        ptable.setWidth("100%");
        ptable.setPageLength(5);

        VerticalLayout vl = new VerticalLayout();
        vl.addComponent(ptable);
        addComponent(vl);
    }

    @Override
    protected String getDescription() {
        return "A wide table scrolls to the beginning when sorting a column at  the beginning when sorting a column at the end";
    }

    @Override
    protected Integer getTicketNumber() {
        return 6788;
    }
}
TOP

Related Classes of com.vaadin.tests.components.table.WideSelectableTable

TOP
Copyright © 2018 www.massapi.com. 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.