blob: 3437ca5d2a73bae531512bf65126b8c77c107089 (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;
public class Ticket1465ModalNotification extends Application {
@Override
public void init() {
final Window mainWin = new Window("ButtonPanel containing a table test");
setMainWindow(mainWin);
final Window modal = new Window("Modal window");
modal.setModal(true);
Button b = new Button("click to show notification",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
modal.showNotification(
"Try clicking the button in main window!",
Window.Notification.TYPE_ERROR_MESSAGE);
}
});
modal.addComponent(b);
b = new Button("click to warning notification",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
modal.showNotification(
"Try clicking the button in main window!",
Window.Notification.TYPE_WARNING_MESSAGE);
}
});
modal.addComponent(b);
b = new Button("click to Humanized notification",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
modal.showNotification(
"Try clicking the button in main window!",
Window.Notification.TYPE_HUMANIZED_MESSAGE);
}
});
modal.addComponent(b);
b = new Button("click to test modality!", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
mainWin.addComponent(new Label("clicked"));
}
});
modal.addComponent(b);
mainWin.addWindow(modal);
b = new Button("click to test modality!", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
mainWin.addComponent(new Label("clicked"));
}
});
mainWin.addComponent(b);
}
}
|