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;
40 @ActionID(category =
"Tools",
id =
"org.sleuthkit.autopsy.newpackage.OpenDiscoveryAction")
41 @ActionReferences(value = {
42 @ActionReference(path =
"Menu/Tools", position = 105),
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);
67 SwingUtilities.invokeLater(() -> {
68 final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance();
69 discDialog.cancelSearch();
70 DiscoveryUiUtils.displayErrorMessage(discDialog);
71 discDialog.setVisible(
true);
83 ImageIcon icon =
new ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/discovery-icon-24.png"));
84 toolbarButton.setIcon(icon);
85 toolbarButton.setText(this.getName());
96 super.setEnabled(value);
97 toolbarButton.setEnabled(value);
107 return HelpCtx.DEFAULT_HELP;
Component getToolbarPresenter()
void setEnabled(boolean value)
static boolean isCaseOpen()