aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets/Ticket2329.java
blob: d2e5e39abddc342db7fbc1afa6febff73820ed24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.vaadin.tests.tickets;

import com.vaadin.LegacyApplication;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.ColumnGenerator;
import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;

public class Ticket2329 extends LegacyApplication {
    private Table table;
    private VerticalLayout mainLo;

    @Override
    public void init() {
        LegacyWindow mainw = new LegacyWindow();
        setMainWindow(mainw);
        mainLo = (VerticalLayout) mainw.getContent();
        table = new Table();
        for (int i = 0; i < 10000; i++) {
            table.addItem(i);
        }
        TestColumnGenerator cgen = new TestColumnGenerator();
        table.addGeneratedColumn("col1", cgen);
        table.addGeneratedColumn("col2", cgen);
        table.addGeneratedColumn("col3", cgen);
        table.addGeneratedColumn("col4", cgen);
        table.addGeneratedColumn("col5", cgen);
        table.addGeneratedColumn("col6", cgen);
        table.addGeneratedColumn("col7", cgen);
        table.setHeight("500px");
        mainLo.addComponent(table);
    }

    class TestColumnGenerator implements ColumnGenerator {
        @Override
        public Component generateCell(Table source, Object rowId,
                Object columnId) {
            return new Button("1");
        }
    }
}