if(cores.size() == 0) {
throw new ReportException("Нет доступных типов выборок");
}
QCore core = null;
if(cores.size() == 1) {
core = factory.createCore(0, reportQuery.getReportContext(new NoNeedAtom()));
} else {
Object title = JOptionPane.showInputDialog(parent, "Выберите тип нового запроса",
"", JOptionPane.QUESTION_MESSAGE, null, cores.toArray(), null);
int index = cores.indexOf(title);
if(index == -1) {
return;
}
core = factory.createCore(index, reportQuery.getReportContext(new NoNeedAtom()));
}
reportQuery.getCores().add(core);
CorePanel panel = new CorePanel(parent, core);
tabs.put(core, panel);