if (!(query instanceof ProcedureQuery)) {
setVisible(false);
return;
}
ProcedureQuery procedureQuery = (ProcedureQuery) query;
properties.setEnabled(true);
name.setText(procedureQuery.getName());
// init root choices and title label..
// - ProcedureQuery supports Procedure roots
// TODO: now we only allow roots from the current map,
// since query root is fully resolved during map loading,
// making it impossible to reference other DataMaps.
DataMap map = mediator.getCurrentDataMap();
Object[] roots = map.getProcedures().toArray();
if (roots.length > 1) {
Arrays.sort(roots, Comparators.getDataMapChildrenComparator());
}
DefaultComboBoxModel model = new DefaultComboBoxModel(roots);
model.setSelectedItem(procedureQuery.getRoot());
queryRoot.setModel(model);
properties.initFromModel(procedureQuery);
setVisible(true);
}