blob: 5f1c8b4283a0fabd411434c0272ed09aa1ad62ac (
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.components.table;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.CheckBox;
import com.vaadin.v7.ui.Table;
public class TableScrollOnFocus extends TestBase {
@Override
protected void setup() {
final Table table = new Table();
final CheckBox chkSelectable = new CheckBox("selectable");
chkSelectable.addValueChangeListener(
event -> table.setSelectable(chkSelectable.getValue()));
table.addContainerProperty("row #", String.class, "-");
table.setColumnWidth("row #", 150);
for (int i = 1; i < 200; i++) {
table.addItem(new String[] { "" + i }, null);
}
table.setSortDisabled(true);
chkSelectable.setValue(true);
addComponent(chkSelectable);
addComponent(table);
}
@Override
protected String getDescription() {
return "The table scrolls up 2 pages after loosing and regaining the focus!</b><p>"
+ "Drag scrollbar to top then to the bottom of the table.<br>"
+ "Click somewhere beside the table to take away the focus,<br>"
+ "then click back on the table (header or scrollbar) to give back the focus<br>"
+ "(Pressing Tab and Shift-Tab does the same job).<p>"
+ "If the table is set to non-selectable-mode, no self-scrolling occurs.";
}
@Override
protected Integer getTicketNumber() {
return 6774;
}
}
|