19 package org.sleuthkit.autopsy.filequery;
21 import java.awt.Component;
22 import java.util.HashMap;
24 import java.util.logging.Level;
25 import javax.swing.ImageIcon;
26 import javax.swing.JButton;
27 import javax.swing.JOptionPane;
28 import org.openide.awt.ActionID;
29 import org.openide.awt.ActionReference;
30 import org.openide.awt.ActionReferences;
31 import org.openide.awt.ActionRegistration;
32 import org.openide.util.HelpCtx;
33 import org.openide.util.NbBundle;
34 import org.openide.util.actions.CallableSystemAction;
35 import org.openide.util.actions.Presenter;
48 @ActionID(category =
"Tools",
id =
"org.sleuthkit.autopsy.newpackage.OpenFileDiscoveryAction")
49 @ActionReferences(value = {
50 @ActionReference(path =
"Menu/Tools", position = 103)
52 @ActionReference(path =
"Toolbars/Case", position = 105)})
53 @ActionRegistration(displayName =
"#CTL_OpenFileDiscoveryAction", lazy =
false)
54 @NbBundle.Messages({
"CTL_OpenFileDiscoveryAction=File Discovery"})
59 private static final String DISPLAY_NAME = Bundle.CTL_OpenFileDiscoveryAction();
60 private static final long serialVersionUID = 1L;
61 private final JButton toolbarButton =
new JButton();
65 this.setEnabled(
false);
73 @NbBundle.Messages({
"OpenFileDiscoveryAction.resultsIncomplete.text=Results may be incomplete"})
76 @SuppressWarnings(
"fallthrough")
80 if (tc.isOpened() ==
false) {
82 tc.updateSearchSettings();
83 displayErrorMessage(tc);
101 Map<Long, DataSourceModulesWrapper> dataSourceIngestModules =
new HashMap<>();
102 for (DataSource dataSource : skCase.getDataSources()) {
103 dataSourceIngestModules.put(dataSource.getId(),
new DataSourceModulesWrapper(dataSource.getName()));
106 for (IngestJobInfo jobInfo : skCase.getIngestJobs()) {
107 dataSourceIngestModules.get(jobInfo.getObjectId()).updateModulesRun(jobInfo);
110 for (DataSourceModulesWrapper dsmodulesWrapper : dataSourceIngestModules.values()) {
111 message += dsmodulesWrapper.getMessage();
113 if (!message.isEmpty()) {
114 JOptionPane.showMessageDialog(tc, message, Bundle.OpenFileDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE);
117 logger.log(Level.WARNING,
"Exception while determining which modules have been run for File Discovery", ex);
128 ImageIcon icon =
new ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/discovery-icon-24.png"));
129 toolbarButton.setIcon(icon);
130 toolbarButton.setText(this.getName());
131 return toolbarButton;
141 super.setEnabled(value);
142 toolbarButton.setEnabled(value);
152 return HelpCtx.DEFAULT_HELP;
Component getToolbarPresenter()
void displayErrorMessage(DiscoveryTopComponent tc)
OpenFileDiscoveryAction()
SleuthkitCase getSleuthkitCase()
static DiscoveryTopComponent getTopComponent()
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
void setEnabled(boolean value)
static boolean isCaseOpen()