blob: 35ad3abf03a7f812cf8002245107f699e1058dbf (
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
|
package com.vaadin.tests.components.window;
import com.vaadin.server.ThemeResource;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
public class ExtraWindowShown extends AbstractReindeerTestUI {
@Override
protected void setup(VaadinRequest request) {
Button b = new Button("Open window", event -> {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
final Window w = new Window("Sub window", layout);
w.center();
layout.addComponent(new Button("Close", clickEvent -> w.close()));
Button iconButton = new Button("A button with icon");
iconButton.setIcon(new ThemeResource("../runo/icons/16/ok.png"));
layout.addComponent(iconButton);
event.getButton().getUI().addWindow(w);
});
getLayout().getParent().setSizeFull();
getLayout().setSizeFull();
getLayout().addComponent(b);
getLayout().setComponentAlignment(b, Alignment.MIDDLE_CENTER);
}
@Override
protected String getTestDescription() {
return "Sub window shouldn't reappear after closing.";
}
@Override
protected Integer getTicketNumber() {
return 5987;
}
}
|