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

import com.vaadin.Application;
import com.vaadin.server.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.UI.LegacyWindow;

public class Ticket2007 extends Application {

    int childs = 0;

    @Override
    public void init() {

        final LegacyWindow main = new LegacyWindow("Main window for #2007");
        setMainWindow(main);
        main.addComponent(new Button("Open another (non-main) window",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        LegacyWindow c = new LegacyWindow(
                                "Non-main browser window " + (++childs));
                        addWindow(c);
                        main.open(new ExternalResource(c.getURL()), "_new");
                    }
                }));
    }
}