table.setWidget(1, 0, new PLabel("Name"));
table.setWidget(1, 1, nameTextBox = new PTextBox("PonySDK"));
table.setWidget(2, 0, new PLabel("Features"));
table.setWidget(2, 1, featuresTextBox = new PTextBox("width=1280,height=800,resizable,status=1"));
final PButton open = new PButton("Open new window");
open.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
final String url = urlTextBox.getText();
final String name = nameTextBox.getText();
final String features = featuresTextBox.getText();
final PWindow w = new PWindow(url, name, features);
w.open();
}
});
// Open popup that communicate with server
final PFlexTable table2 = new PFlexTable();
table2.setWidget(0, 0, new PLabel("Name"));
table2.setWidget(0, 1, popNameTextBox = new PTextBox("Popup"));
table2.setWidget(1, 0, new PLabel("Features"));
table2.setWidget(1, 1, popFeaturesTextBox = new PTextBox("width=500,height=300,resizable"));
final PButton open2 = new PButton("Open new window");
open2.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
final String disc = windows.size() == 0 ? "" : Integer.toString(windows.size());
final String name = popNameTextBox.getText();
final String features = popFeaturesTextBox.getText();
final MyWindow window = new MyWindow(name + disc, features);
window.open();
window.addCloseHandler(WindowPageActivity.this);
windows.add(window);
}
});
final PButton postHello = new PButton("Post message");
postHello.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
for (final PWindow window : windows) {
window.acquire();
try {
PNotificationManager.showHumanizedNotification("Hello from opener");
window.flush();
} finally {
window.release();
}
}
}
});
final PButton closeAllWindow = new PButton("Close all windows");
closeAllWindow.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
for (final PWindow window : windows) {
window.close();