19 package org.sleuthkit.autopsy.filesearch;
21 import java.awt.event.ActionEvent;
22 import java.beans.PropertyChangeEvent;
23 import java.util.EnumSet;
24 import org.openide.util.HelpCtx;
25 import org.openide.util.NbBundle;
26 import org.openide.util.actions.CallableSystemAction;
30 final class FileSearchAction
extends CallableSystemAction implements FileSearchProvider {
32 private static final long serialVersionUID = 1L;
33 private static FileSearchAction instance = null;
37 setEnabled(Case.isCaseOpen());
38 Case.addEventTypeSubscriber(EnumSet.of(Case.Events.CURRENT_CASE), (PropertyChangeEvent evt) -> {
39 if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
40 setEnabled(evt.getNewValue() != null);
45 public static FileSearchAction getDefault() {
46 if (instance == null) {
47 instance =
new FileSearchAction();
53 public void actionPerformed(ActionEvent e) {
54 new FileSearchDialog().setVisible(
true);
58 public void performAction() {
59 new FileSearchDialog().setVisible(
true);
63 public String getName() {
64 return NbBundle.getMessage(this.getClass(),
"FileSearchAction.getName.text");
68 public HelpCtx getHelpCtx() {
69 return HelpCtx.DEFAULT_HELP;
73 protected boolean asynchronous() {
78 public void showDialog() {