aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets/Ticket2106.java
blob: a57a20cdc326c0719a70e2b0321cffd30f67ac9a (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
package com.vaadin.tests.tickets;

import java.util.Date;

import com.vaadin.Application;
import com.vaadin.server.CustomizedSystemMessages;
import com.vaadin.server.SystemMessages;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI.LegacyWindow;

public class Ticket2106 extends Application.LegacyApplication {

    private static CustomizedSystemMessages msgs = new CustomizedSystemMessages();
    static {
        // We will forward the user to www.vaadin.com when the session expires
        msgs.setSessionExpiredURL("http://www.vaadin.com");
        msgs.setSessionExpiredMessage(null);
        msgs.setSessionExpiredCaption(null);
    }

    public static SystemMessages getSystemMessages() {
        return msgs;
    }

    @Override
    public void init() {
        setMainWindow(new LegacyWindow("#2106"));
        getMainWindow().addComponent(
                new Button("Do nothing", new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        getMainWindow().addComponent(
                                new Label("Last time did nothing: "
                                        + new Date()));
                    }
                }));
    }

}