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
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2016 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* 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
|
* Allows creation of JavaFX menus with the same structure as Swing menus and
|
||||||
* which invoke the same actions.
|
* 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.
|
* @param jMenuElement The MenuElement to create a JavaFX menu for.
|
||||||
*
|
*
|
||||||
@ -60,6 +63,7 @@ public class SwingFXMenuUtils extends MenuItem {
|
|||||||
|
|
||||||
private MenuItemAdapter(final JMenuItem jMenuItem) {
|
private MenuItemAdapter(final JMenuItem jMenuItem) {
|
||||||
super(jMenuItem.getText());
|
super(jMenuItem.getText());
|
||||||
|
setDisable(jMenuItem.isEnabled() == false);
|
||||||
setOnAction(actionEvent -> SwingUtilities.invokeLater(jMenuItem::doClick));
|
setOnAction(actionEvent -> SwingUtilities.invokeLater(jMenuItem::doClick));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,6 +81,7 @@ public class SwingFXMenuUtils extends MenuItem {
|
|||||||
*/
|
*/
|
||||||
MenuAdapter(final JMenu jMenu) {
|
MenuAdapter(final JMenu jMenu) {
|
||||||
super(jMenu.getText());
|
super(jMenu.getText());
|
||||||
|
setDisable(jMenu.isEnabled() == false);
|
||||||
populateSubMenus(jMenu);
|
populateSubMenus(jMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,6 +92,7 @@ public class SwingFXMenuUtils extends MenuItem {
|
|||||||
*/
|
*/
|
||||||
MenuAdapter(JPopupMenu jPopupMenu) {
|
MenuAdapter(JPopupMenu jPopupMenu) {
|
||||||
super(jPopupMenu.getLabel());
|
super(jPopupMenu.getLabel());
|
||||||
|
setDisable(jPopupMenu.isEnabled() == false);
|
||||||
populateSubMenus(jPopupMenu);
|
populateSubMenus(jPopupMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,4 +120,5 @@ public class SwingFXMenuUtils extends MenuItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user