mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-08 22:29:33 +00:00
Disable file search action when Case closed
This commit is contained in:
parent
17e1381645
commit
a1c3e1e9f5
@ -19,11 +19,31 @@
|
|||||||
package org.sleuthkit.autopsy.filesearch;
|
package org.sleuthkit.autopsy.filesearch;
|
||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.beans.PropertyChangeEvent;
|
||||||
|
import java.beans.PropertyChangeListener;
|
||||||
import org.openide.util.HelpCtx;
|
import org.openide.util.HelpCtx;
|
||||||
import org.openide.util.actions.CallableSystemAction;
|
import org.openide.util.actions.CallableSystemAction;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
|
||||||
public final class FileSearchAction extends CallableSystemAction {
|
public final class FileSearchAction extends CallableSystemAction {
|
||||||
|
|
||||||
|
FileSearchAction() {
|
||||||
|
super();
|
||||||
|
setEnabled(false);
|
||||||
|
|
||||||
|
Case.addPropertyChangeListener(new PropertyChangeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
|
if(evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)){
|
||||||
|
setEnabled(evt.getNewValue() != null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
new FileSearchDialog().setVisible(true);
|
new FileSearchDialog().setVisible(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user