use of java.awt.Menu in project cryptomator by cryptomator.
the class TrayMenuController method buildSubmenu.
private Menu buildSubmenu(Vault vault) {
Menu submenu = new Menu(vault.getDisplayName());
if (vault.isLocked()) {
MenuItem unlockItem = new MenuItem(resourceBundle.getString("traymenu.vault.unlock"));
unlockItem.addActionListener(createActionListenerForVault(vault, this::unlockVault));
submenu.add(unlockItem);
} else if (vault.isUnlocked()) {
MenuItem lockItem = new MenuItem(resourceBundle.getString("traymenu.vault.lock"));
lockItem.addActionListener(createActionListenerForVault(vault, this::lockVault));
submenu.add(lockItem);
MenuItem revealItem = new MenuItem(resourceBundle.getString("traymenu.vault.reveal"));
revealItem.addActionListener(createActionListenerForVault(vault, this::revealVault));
submenu.add(revealItem);
}
return submenu;
}
use of java.awt.Menu in project TrakEM2 by trakem2.
the class Utils method restoreMenuBar.
/**
*Restore ImageJ's MenuBar
*/
public static final void restoreMenuBar() {
final MenuBar menu_bar = Menus.getMenuBar();
final int n_menus = menu_bar.getMenuCount();
for (int i = 0; i < n_menus; i++) {
final Menu menu = menu_bar.getMenu(i);
restoreMenu(menu);
}
// make sure there isn't a null menu bar
// WindowManager.getCurrentWindow().setMenuBar(menu_bar);
}
Aggregations