use of de.alpharogroup.bundle.app.actions.ShowLicenseFrameAction in project bundle-app-ui by astrapi69.
the class DesktopMenu method newHelpMenu.
/**
* Factory method for create new {@link JMenu} for the help menu.
*
* @param listener
* the listener
* @return the j menu
*/
private JMenu newHelpMenu(final ActionListener listener) {
// Help menu
// $NON-NLS-1$
final JMenu menuHelp = new JMenu("Help");
menuHelp.setMnemonic('H');
// Help JMenuItems
// Help content
// $NON-NLS-1$
final JMenuItem mihHelpContent = new JMenuItem("Content", 'c');
MenuExtensions.setCtrlAccelerator(mihHelpContent, 'H');
menuHelp.add(mihHelpContent);
// found bug with the javax.help
// Exception in thread "main" java.lang.SecurityException: no manifiest
// section for signature file entry
// com/sun/java/help/impl/TagProperties.class
// Solution is to remove the rsa files from the jar
final HelpSet hs = getHelpSet();
final DefaultHelpBroker helpBroker = (DefaultHelpBroker) hs.createHelpBroker();
final WindowPresentation pres = helpBroker.getWindowPresentation();
pres.createHelpWindow();
helpWindow = pres.getHelpWindow();
helpWindow.setLocationRelativeTo(null);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (final Exception e1) {
log.error(e1.getLocalizedMessage(), e1);
}
SwingUtilities.updateComponentTreeUI(helpWindow);
// 2. assign help to components
CSH.setHelpIDString(mihHelpContent, "Overview");
// 3. handle events
final CSH.DisplayHelpFromSource displayHelpFromSource = new CSH.DisplayHelpFromSource(helpBroker);
mihHelpContent.addActionListener(displayHelpFromSource);
mihHelpContent.addActionListener(new ShowHelpDialogAction("Content"));
// Donate
final JMenuItem mihDonate = new JMenuItem(// $NON-NLS-1$
Messages.getString("com.find.duplicate.files.menu.item.donate"));
mihDonate.addActionListener(new OpenBrowserToDonateAction("Donate"));
menuHelp.add(mihDonate);
// Licence
// $NON-NLS-1$
final JMenuItem mihLicence = new JMenuItem("Licence");
mihLicence.addActionListener(new ShowLicenseFrameAction("Licence"));
menuHelp.add(mihLicence);
// Info
// $NON-NLS-1$
final JMenuItem mihInfo = new JMenuItem("Info", 'i');
MenuExtensions.setCtrlAccelerator(mihInfo, 'I');
mihInfo.addActionListener(new ShowInfoDialogAction("Info"));
menuHelp.add(mihInfo);
return menuHelp;
}
Aggregations