20 package org.sleuthkit.autopsy.menuactions;
22 import java.util.Collection;
23 import javax.swing.JComponent;
24 import javax.swing.JMenuItem;
25 import org.openide.awt.DynamicMenuContent;
26 import org.openide.util.Lookup;
27 import org.openide.windows.TopComponent;
36 class DataExplorerDynamicMenu
extends JMenuItem implements DynamicMenuContent{
37 DataExplorerDynamicMenu(){
41 public JComponent[] getMenuPresenters() {
42 Collection<? extends DataExplorer> dataExplorers = Lookup.getDefault().lookupAll(DataExplorer.class);
44 int totalItem = dataExplorers.size();
45 JComponent[] comps =
new JComponent[totalItem];
49 for(DataExplorer dx : dataExplorers){
50 if (! dx.hasMenuOpenAction())
53 JMenuItem item =
new JMenuItem(explorerWin.getName());
54 item.addActionListener(
new OpenTopComponentAction(explorerWin));
56 if(!Case.existsCurrentCase() || Case.getCurrentCase().hasData() ==
false){
57 item.setEnabled(
false);
60 item.setEnabled(
true);
70 public JComponent[] synchMenuPresenters(JComponent[] jcs) {
71 return getMenuPresenters();
TopComponent getTopComponent()