blob: 774ac3c8788bfdcf4204192fdb5153d1db7725c5 (
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
44
|
package com.vaadin.tests.components.window;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Layout;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
public class RepaintWindowContents extends AbstractReindeerTestUI {
private static final long serialVersionUID = 1L;
@SuppressWarnings("serial")
@Override
protected void setup(VaadinRequest request) {
final Window window = new Window("Test window");
addWindow(window);
final Layout layout1 = new VerticalLayout();
Button button1 = new Button("Button 1");
layout1.addComponent(button1);
final Layout layout2 = new VerticalLayout();
Button button2 = new Button("Button 2");
layout2.addComponent(button2);
window.setContent(layout1);
button1.addClickListener(event -> window.setContent(layout2));
button2.addClickListener(event -> window.setContent(layout1));
}
@Override
protected String getTestDescription() {
return "Clicking the button switches the content between content1 and content2";
}
@Override
protected Integer getTicketNumber() {
return 8832;
}
}
|