20 package org.sleuthkit.autopsy.menuactions;
22 import java.beans.PropertyChangeEvent;
23 import java.beans.PropertyChangeListener;
24 import javax.swing.JMenu;
25 import javax.swing.JMenuItem;
26 import org.openide.util.HelpCtx;
27 import org.openide.util.NbBundle;
28 import org.openide.util.actions.CallableSystemAction;
29 import org.openide.util.actions.Presenter;
35 class DataResultMenu
extends CallableSystemAction implements Presenter.Menu, PropertyChangeListener {
37 JMenu menu =
new JMenu(NbBundle.getMessage(
this.getClass(),
"DataResultMenu.menu.dataResWin.text"));
43 public JMenuItem getMenuPresenter() {
44 return new SearchResultMenu();
48 public void propertyChange(PropertyChangeEvent evt) {
49 String changed = evt.getPropertyName();
50 Object oldValue = evt.getOldValue();
51 Object newValue = evt.getNewValue();
53 if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
54 if (newValue != null) {
56 int totalMenus = menu.getItemCount();
57 for (
int i = 0; i < totalMenus; i++) {
58 menu.getItem(i).setEnabled(
true);
62 int totalMenus = menu.getItemCount();
63 for (
int i = 0; i < totalMenus; i++) {
64 menu.getItem(i).setEnabled(
false);
71 public void performAction() {
76 public String getName() {
77 return NbBundle.getMessage(this.getClass(),
"DataResultMenu.getName.text");
81 public HelpCtx getHelpCtx() {
82 return HelpCtx.DEFAULT_HELP;