closeButton.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
while (!windows.isEmpty()) {
Window window = windows.pop();
removeWindow(window);
}
}
});
Button regularButton = new Button("Regular");
regularButton.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
Window regularWindow = new Window("Regular window");
openWindow(regularWindow);
}
});
Button alertButton = new Button("Alert");
alertButton.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
Window alertWindow = new Window("Alert window");
alertWindow.setAssistiveRole(WindowRole.ALERTDIALOG);
openWindow(alertWindow);
}
});
addComponent(closeButton);
addComponent(regularButton);