mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
disable menus appropriately in timeline list view
This commit is contained in:
parent
b8364e91be
commit
a5f3f0fa9d
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2016 Basis Technology Corp.
|
||||
* Copyright 2011-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -31,10 +31,13 @@ import javax.swing.SwingUtilities;
|
||||
* Allows creation of JavaFX menus with the same structure as Swing menus and
|
||||
* which invoke the same actions.
|
||||
*/
|
||||
public class SwingFXMenuUtils extends MenuItem {
|
||||
class SwingFXMenuUtils {
|
||||
|
||||
private SwingFXMenuUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory method that creates a JavaFX MenuItem backed by a MenuElement
|
||||
* Factory method that creates a JavaFX MenuItem backed by a swing MenuElement
|
||||
*
|
||||
* @param jMenuElement The MenuElement to create a JavaFX menu for.
|
||||
*
|
||||
@ -60,6 +63,7 @@ public class SwingFXMenuUtils extends MenuItem {
|
||||
|
||||
private MenuItemAdapter(final JMenuItem jMenuItem) {
|
||||
super(jMenuItem.getText());
|
||||
setDisable(jMenuItem.isEnabled() == false);
|
||||
setOnAction(actionEvent -> SwingUtilities.invokeLater(jMenuItem::doClick));
|
||||
}
|
||||
}
|
||||
@ -77,6 +81,7 @@ public class SwingFXMenuUtils extends MenuItem {
|
||||
*/
|
||||
MenuAdapter(final JMenu jMenu) {
|
||||
super(jMenu.getText());
|
||||
setDisable(jMenu.isEnabled() == false);
|
||||
populateSubMenus(jMenu);
|
||||
}
|
||||
|
||||
@ -87,6 +92,7 @@ public class SwingFXMenuUtils extends MenuItem {
|
||||
*/
|
||||
MenuAdapter(JPopupMenu jPopupMenu) {
|
||||
super(jPopupMenu.getLabel());
|
||||
setDisable(jPopupMenu.isEnabled() == false);
|
||||
populateSubMenus(jPopupMenu);
|
||||
}
|
||||
|
||||
@ -114,4 +120,5 @@ public class SwingFXMenuUtils extends MenuItem {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user