19 package org.sleuthkit.autopsy.casemodule;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.util.logging.Level;
24 import javax.swing.JOptionPane;
25 import javax.swing.SwingUtilities;
26 import org.openide.util.NbBundle;
27 import org.openide.windows.WindowManager;
37 class RecentItems
implements ActionListener {
39 private static final Logger logger = Logger.
getLogger(RecentItems.class.getName());
40 private final String caseMetaDataFilePath;
50 RecentItems(String caseName, String caseMetaDataFilePath) {
51 this.caseMetaDataFilePath = caseMetaDataFilePath;
60 public void actionPerformed(ActionEvent e) {
61 String optionsDlgTitle = NbBundle.getMessage(Case.class,
"CloseCaseWhileIngesting.Warning.title");
62 String optionsDlgMessage = NbBundle.getMessage(Case.class,
"CloseCaseWhileIngesting.Warning");
63 if (IngestRunningCheck.checkAndConfirmProceed(optionsDlgTitle, optionsDlgMessage)) {
66 Case.openAsCurrentCase(caseMetaDataFilePath);
67 StartupWindowProvider.getInstance().close();
68 }
catch (CaseActionException ex) {
69 SwingUtilities.invokeLater(() -> {
70 if (!(ex instanceof CaseActionCancelledException)) {
71 logger.log(Level.SEVERE, String.format(
"Error opening case with metadata file path %s", caseMetaDataFilePath), ex);
72 JOptionPane.showMessageDialog(
73 WindowManager.getDefault().getMainWindow(),
75 NbBundle.getMessage(RecentItems.this.getClass(),
"CaseOpenAction.msgDlg.cantOpenCase.title"),
76 JOptionPane.ERROR_MESSAGE);
78 StartupWindowProvider.getInstance().open();
synchronized static Logger getLogger(String name)