ItemSelectorEditable<TableFormat> fields = query.getTableFormats();
int index = formatsTable.getSelectionModel().getLeadSelectionIndex();
if(index == -1) {
return;
}
TableFormat tfOrigin = fields.get(index);
Element stream = tfOrigin.toXML();
final LinkedList<Atom> atoms = new LinkedList<Atom>();
Context context = query.getContext3Stage(new AtomRegistrar() {
@Override
public void registerAtom(Atom atom) {
atoms.add(atom);
}
});
try {
TableFormat tf = new TableFormat(stream, context);
for(Atom a:atoms) {
a.refresh();
}
TableFormatDlg dlg = new TableFormatDlg(parent, tf);