19 package org.sleuthkit.autopsy.modules.hashdatabase;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.awt.event.WindowAdapter;
24 import java.awt.event.WindowEvent;
25 import java.beans.PropertyChangeEvent;
26 import java.util.EnumSet;
27 import org.openide.util.HelpCtx;
28 import org.openide.util.NbBundle;
29 import org.openide.util.actions.CallableSystemAction;
37 class 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();
63 final AdvancedConfigurationCleanDialog dialog =
new AdvancedConfigurationCleanDialog();
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() {