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.beans.PropertyChangeListener;
 
   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.addPropertyChangeListener(
new PropertyChangeListener() {
 
   49             public void propertyChange(PropertyChangeEvent evt) {
 
   50                 if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
 
   51                     setEnabled(evt.getNewValue() != null);
 
   57     public static HashDbPanelSearchAction getDefault() {
 
   58         if (instance == null) {
 
   59             instance = 
new HashDbPanelSearchAction();
 
   65     public void performAction() {
 
   66         final HashDbSearchPanel panel = HashDbSearchPanel.getDefault();
 
   67         final AdvancedConfigurationCleanDialog dialog = 
new AdvancedConfigurationCleanDialog();
 
   69         dialog.addWindowListener(
new WindowAdapter() {
 
   71             public void windowClosing(WindowEvent e) {
 
   77         panel.addSearchActionListener(
new ActionListener() {
 
   79             public void actionPerformed(ActionEvent e) {
 
   87         panel.addCancelActionListener(
new ActionListener() {
 
   89             public void actionPerformed(ActionEvent e) {
 
   95         dialog.display(panel);
 
   99     public String getName() {
 
  104     public HelpCtx getHelpCtx() {
 
  105         return HelpCtx.DEFAULT_HELP;
 
  109     protected boolean asynchronous() {