.noErrorHandling()
.sendNowWith(ErraiBus.get());
return;
} else {
WSModalDialog dialog = new WSModalDialog();
dialog.getOkButton().setText("Open New");
dialog.getCancelButton().setText("Goto");
final WorkspaceLayout layout = this;
AcceptsCallback openCallback = new AcceptsCallback() {
public void callback(Object message, Object data) {
if (MESSAGE_OK.equals(message)) {
String newId;
String newName;
int idx = 1;
while (tabInstances.containsKey(newId = (componentId + "-" + idx))) idx++;
newName = name + " (" + idx + ")";
_openTab(DOMID, initSubject, componentId, newName, newId, icon);
} else if (!"WindowClosed".equals(message)) {
Set<String> s = layout.getActiveByType(componentId);
if (s.size() > 1) {
WSTabSelectorDialog wsd = new WSTabSelectorDialog(s);
wsd.ask("Select an open instance.", new AcceptsCallback() {
public void callback(Object message, Object data) {
}
});
wsd.showModal();
} else {
createMessage()
.toSubject(getInstanceSubject(componentId))
.command(LayoutCommands.ActivateTool)
.noErrorHandling()
.sendNowWith(ErraiBus.get());
}
}
}
};
dialog.ask("A panel is already open for '" + name + "'. What do you want to do?", openCallback);
dialog.showModal();
return;
}
}
_openTab(DOMID, initSubject, componentId, name, componentId, icon);