19 package org.sleuthkit.autopsy.actions;
21 import java.awt.Cursor;
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
24 import java.util.concurrent.ExecutionException;
25 import java.util.logging.Level;
26 import javax.swing.SwingWorker;
27 import org.openide.LifecycleManager;
28 import org.openide.awt.ActionID;
29 import org.openide.awt.ActionReference;
30 import org.openide.awt.ActionRegistration;
31 import org.openide.util.NbBundle;
32 import org.openide.windows.WindowManager;
43 @ActionRegistration(displayName =
"Exit", iconInMenu =
true)
44 @ActionReference(path =
"Menu/Case", position = 1000, separatorBefore = 999)
45 @ActionID(
id =
"org.sleuthkit.autopsy.casemodule.ExitAction", category =
"Case")
46 final public class
ExitAction implements ActionListener {
51 "ExitAction.confirmationDialog.title=Ingest is Running",
52 "ExitAction.confirmationDialog.message=Ingest is running, are you sure you want to exit?",
53 "# {0} - exception message",
"ExitAction.messageBox.caseCloseExceptionMessage=Error closing case: {0}"
58 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
59 new SwingWorker<Void, Void>() {
62 protected Void doInBackground()
throws Exception {
68 protected void done() {
71 }
catch (InterruptedException ex) {
72 logger.log(Level.SEVERE,
"Unexpected interrupt closing the current case", ex);
73 }
catch (ExecutionException ex) {
74 logger.log(Level.SEVERE,
"Error closing the current case", ex);
77 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
78 LifecycleManager.getDefault().exit();
static void closeCurrentCase()
static boolean checkAndConfirmProceed(String optionsDlgTitle, String optionsDlgMessage)
void actionPerformed(ActionEvent e)
synchronized static Logger getLogger(String name)
static void error(String message)