final String name = "Child " + (++childs);
LegacyWindow c = new LegacyWindow(name);
addWindow(c);
main.open(new ExternalResource(c.getURL()), "_new");
main.addComponent(new Label(name + " opened"));
final TextField tf = new TextField("Non immediate textfield");
c.addComponent(tf);
tf.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
main.addComponent(new Label(name + " send text:"
+ tf.getValue()));
}
});
for (int i = 0; i < 3; i++) {
final String caption = "Slow button " + i;
c.addComponent(new Button(caption,
new Button.ClickListener() {
@Override
public synchronized void buttonClick(
ClickEvent event) {
try {
this.wait(2000);
} catch (InterruptedException e) {
}
main.addComponent(new Label(caption
+ " pressed"));
}
}));
}