WindowsLookAndFeel.setMnemonicHidden(true);
WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
return;
}
MenuSelectionManager msm =
MenuSelectionManager.defaultManager();
if (msm.getSelectedPath().length == 0) {
// if no menu is active, we try activating the menubar
JMenuBar mbar = root != null ? root.getJMenuBar() : null;
if(mbar == null && winAncestor instanceof JFrame) {
mbar = ((JFrame)winAncestor).getJMenuBar();
}
JMenu menu = mbar != null ? mbar.getMenu(0) : null;
if (menu != null) {
MenuElement[] path = new MenuElement[2];
path[0] = mbar;
path[1] = menu;
msm.setSelectedPath(path);
} else if(!WindowsLookAndFeel.isMnemonicHidden()) {
WindowsLookAndFeel.setMnemonicHidden(true);
WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
}
} else {
if((msm.getSelectedPath())[0] instanceof ComboPopup) {
WindowsLookAndFeel.setMnemonicHidden(true);
WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
}
}