19 package org.sleuthkit.autopsy.discovery;
21 import java.awt.Component;
22 import javax.swing.ImageIcon;
23 import javax.swing.JButton;
24 import javax.swing.SwingUtilities;
25 import org.openide.awt.ActionID;
26 import org.openide.awt.ActionReference;
27 import org.openide.awt.ActionReferences;
28 import org.openide.awt.ActionRegistration;
29 import org.openide.util.HelpCtx;
30 import org.openide.util.NbBundle;
31 import org.openide.util.actions.CallableSystemAction;
32 import org.openide.util.actions.Presenter;
39 @ActionID(category =
"Tools",
id =
"org.sleuthkit.autopsy.newpackage.OpenDiscoveryAction")
40 @ActionReferences(value = {
41 @ActionReference(path =
"Menu/Tools", position = 103)
43 @ActionReference(path =
"Toolbars/Case", position = 105)})
44 @ActionRegistration(displayName =
"#CTL_OpenDiscoveryAction", lazy =
false)
45 @NbBundle.Messages({
"CTL_OpenDiscoveryAction=Discovery"})
48 private static final String DISPLAY_NAME = Bundle.CTL_OpenDiscoveryAction();
49 private static final long serialVersionUID = 1L;
50 private final JButton toolbarButton =
new JButton();
57 this.setEnabled(
false);
65 @NbBundle.Messages({
"OpenDiscoveryAction.resultsIncomplete.text=Discovery results may be incomplete"})
69 SwingUtilities.invokeLater(() -> {
70 final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance();
71 discDialog.cancelSearch();
72 DiscoveryUiUtils.displayErrorMessage(discDialog);
73 discDialog.setVisible(
true);
84 ImageIcon icon =
new ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/discovery-icon-24.png"));
85 toolbarButton.setIcon(icon);
86 toolbarButton.setText(this.getName());
97 super.setEnabled(value);
98 toolbarButton.setEnabled(value);
108 return HelpCtx.DEFAULT_HELP;
Component getToolbarPresenter()
void setEnabled(boolean value)
static boolean isCaseOpen()