19 package org.sleuthkit.autopsy.discovery.ui;
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 = 105),
42 @ActionReference(path =
"Toolbars/Case", position = 105)})
43 @ActionRegistration(displayName =
"#CTL_OpenDiscoveryAction", lazy =
false)
44 @NbBundle.Messages({
"CTL_OpenDiscoveryAction=Discovery"})
47 private static final String DISPLAY_NAME = Bundle.CTL_OpenDiscoveryAction();
48 private static final long serialVersionUID = 1L;
49 private final JButton toolbarButton =
new JButton();
56 this.setEnabled(
false);
66 SwingUtilities.invokeLater(() -> {
67 final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance();
68 discDialog.cancelSearch();
69 DiscoveryUiUtils.displayErrorMessage(discDialog);
70 discDialog.setVisible(
true);
81 ImageIcon icon =
new ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/discovery-icon-24.png"));
82 toolbarButton.setIcon(icon);
83 toolbarButton.setText(this.getName());
94 super.setEnabled(value);
95 toolbarButton.setEnabled(value);
105 return HelpCtx.DEFAULT_HELP;
Component getToolbarPresenter()
void setEnabled(boolean value)
static boolean isCaseOpen()