final String target = open.getStringAttribute("name");
if (target == null) {
// source will be opened to this browser window, but we may have
// to finish rendering this window in case this is a download
// (and window stays open).
Scheduler.get().scheduleDeferred(new Command() {
@Override
public void execute() {
VUI.goTo(url);
}
});
} else if ("_self".equals(target)) {
// This window is closing (for sure). Only other opens are
// relevant in this change. See #3558, #2144
isClosed = true;
VUI.goTo(url);
} else {
String options;
boolean alwaysAsPopup = true;
if (open.hasAttribute("popup")) {
alwaysAsPopup = open.getBooleanAttribute("popup");
}
if (alwaysAsPopup) {
if (open.hasAttribute("border")) {
if (open.getStringAttribute("border").equals("minimal")) {
options = "menubar=yes,location=no,status=no";
} else {
options = "menubar=no,location=no,status=no";
}
} else {
options = "resizable=yes,menubar=yes,toolbar=yes,directories=yes,location=yes,scrollbars=yes,status=yes";
}
if (open.hasAttribute("width")) {
int w = open.getIntAttribute("width");
options += ",width=" + w;
}
if (open.hasAttribute("height")) {
int h = open.getIntAttribute("height");
options += ",height=" + h;
}
Window.open(url, target, options);
} else {
open(url, target);
}
}
childIndex++;
}
if (isClosed) {
// We're navigating away, so stop the application.
client.setApplicationRunning(false);
return;
}
// Handle other UIDL children
UIDL childUidl;
while ((childUidl = uidl.getChildUIDL(childIndex++)) != null) {
String tag = childUidl.getTag().intern();
if (tag == "actions") {
if (getWidget().actionHandler == null) {
getWidget().actionHandler = new ShortcutActionHandler(
getWidget().id, client);
}
getWidget().actionHandler.updateActionMap(childUidl);
} else if (tag == "notifications") {
for (final Iterator<?> it = childUidl.getChildIterator(); it
.hasNext();) {
final UIDL notification = (UIDL) it.next();
VNotification.showNotification(client, notification);
}
} else if (tag == "css-injections") {
injectCSS(childUidl);
}
}
if (uidl.hasAttribute("focused")) {
// set focused component when render phase is finished
Scheduler.get().scheduleDeferred(new Command() {
@Override
public void execute() {
ComponentConnector paintable = (ComponentConnector) uidl
.getPaintableAttribute("focused", getConnection());