Package uk.gov.nationalarchives.droid.gui.export

Examples of uk.gov.nationalarchives.droid.gui.export.ExportAction


                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);
            }
        }
    }
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.gui.export.ExportAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.