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