19package org.sleuthkit.autopsy.modules.hashdatabase;
21import java.awt.event.ActionEvent;
22import java.awt.event.ActionListener;
23import java.awt.event.WindowAdapter;
24import java.awt.event.WindowEvent;
25import java.beans.PropertyChangeEvent;
26import java.util.EnumSet;
27import org.openide.util.HelpCtx;
28import org.openide.util.NbBundle;
29import org.openide.util.actions.CallableSystemAction;
30import org.sleuthkit.autopsy.casemodule.Case;
31import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationCleanDialog;
37class HashDbPanelSearchAction
extends CallableSystemAction {
39 private static final long serialVersionUID = 1L;
40 static final String ACTION_NAME = NbBundle.getMessage(HashDbPanelSearchAction.class,
"HashDbPanelSearchAction.actionName");
41 private static HashDbPanelSearchAction instance =
null;
43 HashDbPanelSearchAction() {
45 setEnabled(Case.isCaseOpen());
46 Case.addEventTypeSubscriber(EnumSet.of(Case.Events.CURRENT_CASE), (PropertyChangeEvent evt) -> {
47 if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
48 setEnabled(evt.getNewValue() != null);
53 public static HashDbPanelSearchAction getDefault() {
54 if (instance ==
null) {
55 instance =
new HashDbPanelSearchAction();
61 public void performAction() {
62 final HashDbSearchPanel panel = HashDbSearchPanel.getDefault();
65 dialog.addWindowListener(
new WindowAdapter() {
67 public void windowClosing(WindowEvent e) {
73 panel.addSearchActionListener(
new ActionListener() {
75 public void actionPerformed(ActionEvent e) {
83 panel.addCancelActionListener(
new ActionListener() {
85 public void actionPerformed(ActionEvent e) {
91 dialog.display(panel);
95 public String getName() {
100 public HelpCtx getHelpCtx() {
101 return HelpCtx.DEFAULT_HELP;
105 protected boolean asynchronous() {