profileIds.addAll(exportOptions.getSelectedProfileIds());
//for (ProfileForm profileForm : droidContext.allProfiles()) {
// profileIds.add(profileForm.getProfile().getUuid());
// }
final ExportAction exportAction = globalContext.getActionFactory().newExportAction();
final ExportProgressDialog exportDialog = new ExportProgressDialog(this, exportAction);
exportAction.setDestination(exportFileChooser.getSelectedFile());
exportAction.setProfileIds(profileIds);
exportAction.setExportOptions(exportOptions.getExportOptions());
exportAction.setOutputEncoding(exportOptions.getOutputEncoding());
exportAction.setCallback(new ActionDoneCallback<ExportAction>() {
@Override
public void done(ExportAction action) {
try {
exportDialog.setVisible(false);
action.get();
JOptionPane.showMessageDialog(DroidMainFrame.this, "Export Complete.", "Export Complete",
JOptionPane.INFORMATION_MESSAGE);
} catch (ExecutionException e) {
DialogUtils.showGeneralErrorDialog(DroidMainFrame.this, "Export Error", e.getCause()
.getMessage());
} catch (InterruptedException e) {
DialogUtils.showGeneralErrorDialog(DroidMainFrame.this, "Export Interrupted", e.getCause()
.getMessage());
} catch (CancellationException e) {
log.info("Export cancelled");
}
}
});
exportAction.execute();
exportDialog.setVisible(true);
}
}
}