final ExternalResource r = new ExternalResource("http://www.google.com");
@Override
protected void setup() {
final LegacyWindow win = getMainWindow();
addComponent(new TestForWindowOpen());
addComponent(new Button("Window.open _blank always as popup",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
win.open(r, "_blank", true);
}
}));
addComponent(new Button("Window.open _blank NOT always as popup",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
win.open(r, "_blank", false);
}
}));
addComponent(new Button("Window.open _new always as popup",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
win.open(r, "_new", true);
}
}));
addComponent(new Button("Window.open _new NOT always as popup",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
win.open(r, "_new", false);
}
}));
addComponent(new Button(
"Window execute Javascript window.open(www.google.com, _blank)",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
win.executeJavaScript("window.open(\"http://www.google.com\", \"_blank\");");
}
}));
addComponent(new Button(
"Window execute Javascript window.open(www.google.com, _blank, resizable=yes,menubar=yes,toolbar=yes,directories=yes,location=yes,scrollbars=yes,status=yes)",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
win.executeJavaScript("window.open(\"http://www.google.com\", \"_blank\", \"resizable=yes,menubar=yes,toolbar=yes,directories=yes,location=yes,scrollbars=yes,status=yes\");");
}
}));
}