19 package org.sleuthkit.autopsy.timeline.ui.listvew;
21 import javafx.scene.control.Menu;
22 import javafx.scene.control.MenuItem;
23 import javafx.scene.control.SeparatorMenuItem;
24 import javax.swing.JMenu;
25 import javax.swing.JMenuItem;
26 import javax.swing.JPopupMenu;
27 import javax.swing.MenuElement;
28 import javax.swing.SwingUtilities;
44 if (jMenuElement == null) {
46 return new SeparatorMenuItem();
47 }
else if (jMenuElement instanceof JMenu) {
49 }
else if (jMenuElement instanceof JPopupMenu) {
62 super(jMenuItem.getText());
63 setOnAction(actionEvent -> SwingUtilities.invokeLater(jMenuItem::doClick));
79 super(jMenu.getText());
89 super(jPopupMenu.getLabel());
100 for (MenuElement menuElement : menu.getSubElements()) {
101 if (menuElement == null) {
103 getItems().add(
new SeparatorMenuItem());
105 }
else if (menuElement instanceof JMenuItem) {
108 }
else if (menuElement instanceof JPopupMenu) {
112 throw new UnsupportedOperationException(
"Unown MenuElement subclass: " + menuElement.getClass().getName());