List of usage examples for com.jgoodies.looks Options NO_ICONS_KEY
String NO_ICONS_KEY
To view the source code for com.jgoodies.looks Options NO_ICONS_KEY.
Click Source Link
From source file:etomica.virial.cluster2.mvc.view.MenuBarView.java
License:Mozilla Public License
/** * Builds and returns the file menu./* www .j av a 2s . c om*/ */ private JMenu buildFileMenu() { JMenuItem item; JMenu menu = createMenu("File", 'F'); // Build a submenu that has the noIcons hint set. JMenu submenu = createMenu("New", 'N'); submenu.putClientProperty(Options.NO_ICONS_KEY, Boolean.TRUE); submenu.add(createMenuItem("Project\u2026", 'P')); submenu.add(createMenuItem("Folder\u2026", 'F')); submenu.add(createMenuItem("Document\u2026", 'D', KeyStroke.getKeyStroke("ctrl F8"))); submenu.addSeparator(); submenu.add(createMenuItem("No icon hint set", 'N', KeyStroke.getKeyStroke("ctrl F9"))); menu.add(submenu); menu.addSeparator(); item = createMenuItem("Close", 'C', KeyStroke.getKeyStroke("ctrl F4")); menu.add(item); item = createMenuItem("Close All", 'o', KeyStroke.getKeyStroke("ctrl shift F4")); menu.add(item); menu.addSeparator(); item = createMenuItem("Save", ApplicationUI.readImageIcon("save_edit.gif"), 'S', KeyStroke.getKeyStroke("ctrl S")); item.setEnabled(false); menu.add(item); item = createMenuItem("Save As\u2026", ApplicationUI.readImageIcon("saveas_edit.gif"), 'A'); item.setDisplayedMnemonicIndex(5); menu.add(item); item = createMenuItem("Save All", 'e', KeyStroke.getKeyStroke("ctrl shift S")); item.setEnabled(false); menu.add(item); menu.addSeparator(); item = createMenuItem("Print\u2026", ApplicationUI.readImageIcon("print.gif"), 'P', KeyStroke.getKeyStroke("ctrl P")); menu.add(item); menu.addSeparator(); menu.add(createMenuItem("1 WinXPMenuItemUI.java", '1')); menu.add(createMenuItem("2 WinXPUtils.java", '2')); menu.add(createMenuItem("3 WinXPBorders.java", '3')); menu.add(createMenuItem("4 WinXPLookAndFeel.java", '4')); if (!isQuitInOSMenu()) { menu.addSeparator(); menu.add(createMenuItem("Exit", 'x')); } return menu; }
From source file:net.sf.keystore_explorer.gui.KseFrame.java
License:Open Source License
private void initMenu() { JMenuBar jmbMenuBar = new JMenuBar(); jmFile = new JMenu(res.getString("KseFrame.jmFile.text")); PlatformUtil.setMnemonic(jmFile, res.getString("KseFrame.jmFile.mnemonic").charAt(0)); jmiNew = new JMenuItem(newAction); PlatformUtil.setMnemonic(jmiNew, res.getString("KseFrame.jmiNew.mnemonic").charAt(0)); jmiNew.setToolTipText(null);/*from ww w . jav a 2 s.com*/ new StatusBarChangeHandler(jmiNew, (String) newAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiNew); jmiOpen = new JMenuItem(openAction); PlatformUtil.setMnemonic(jmiOpen, res.getString("KseFrame.jmiOpen.mnemonic").charAt(0)); jmiOpen.setToolTipText(null); new StatusBarChangeHandler(jmiOpen, (String) openAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiOpen); jmOpenSpecial = new JMenu(res.getString("KseFrame.jmOpenSpecial.text")); jmOpenSpecial.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmOpenSpecial.image"))))); PlatformUtil.setMnemonic(jmOpenSpecial, res.getString("KseFrame.jmOpenSpecial.mnemonic").charAt(0)); jmFile.add(jmOpenSpecial); jmiOpenDefaultKeyStore = new JMenuItem(openDefaultKeyStoreAction); PlatformUtil.setMnemonic(jmiOpenDefaultKeyStore, res.getString("KseFrame.jmiOpenDefaultKeyStore.mnemonic").charAt(0)); jmiOpenDefaultKeyStore.setToolTipText(null); new StatusBarChangeHandler(jmiOpenDefaultKeyStore, (String) openDefaultKeyStoreAction.getValue(Action.LONG_DESCRIPTION), this); jmOpenSpecial.add(jmiOpenDefaultKeyStore); jmiOpenCaCertificatesKeyStore = new JMenuItem(openCaCertificatesKeyStoreAction); PlatformUtil.setMnemonic(jmiOpenCaCertificatesKeyStore, res.getString("KseFrame.jmiOpenCaCertificatesKeyStore.mnemonic").charAt(0)); jmiOpenCaCertificatesKeyStore.setToolTipText(null); new StatusBarChangeHandler(jmiOpenCaCertificatesKeyStore, (String) openCaCertificatesKeyStoreAction.getValue(Action.LONG_DESCRIPTION), this); jmOpenSpecial.add(jmiOpenCaCertificatesKeyStore); jmiOpenPkcs11KeyStore = new JMenuItem(openPkcs11KeyStoreAction); PlatformUtil.setMnemonic(jmiOpenPkcs11KeyStore, res.getString("KseFrame.jmiOpenPkcs11KeyStore.mnemonic").charAt(0)); jmiOpenPkcs11KeyStore.setToolTipText(null); new StatusBarChangeHandler(jmiOpenPkcs11KeyStore, (String) openPkcs11KeyStoreAction.getValue(Action.LONG_DESCRIPTION), this); jmOpenSpecial.add(jmiOpenPkcs11KeyStore); jmiOpenMsCapiKeyStore = new JMenuItem(openMsCapiAction); PlatformUtil.setMnemonic(jmiOpenMsCapiKeyStore, res.getString("KseFrame.jmiOpenPkcs11KeyStore.mnemonic").charAt(0)); jmiOpenMsCapiKeyStore.setToolTipText(null); new StatusBarChangeHandler(jmiOpenMsCapiKeyStore, (String) openMsCapiAction.getValue(Action.LONG_DESCRIPTION), this); // show menu item for MSCAPI Windows-MY only on Windows if (OperatingSystem.isWindows()) { jmOpenSpecial.add(jmiOpenMsCapiKeyStore); } jmFile.addSeparator(); jmiClose = new JMenuItem(closeAction); PlatformUtil.setMnemonic(jmiClose, res.getString("KseFrame.jmiClose.mnemonic").charAt(0)); jmiClose.setToolTipText(null); new StatusBarChangeHandler(jmiClose, (String) closeAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiClose); jmiCloseAll = new JMenuItem(closeAllAction); PlatformUtil.setMnemonic(jmiCloseAll, res.getString("KseFrame.jmiCloseAll.mnemonic").charAt(0)); jmiCloseAll.setToolTipText(null); new StatusBarChangeHandler(jmiCloseAll, (String) closeAllAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiCloseAll); jmFile.addSeparator(); jmiSave = new JMenuItem(saveAction); PlatformUtil.setMnemonic(jmiSave, res.getString("KseFrame.jmiSave.mnemonic").charAt(0)); jmiSave.setToolTipText(null); new StatusBarChangeHandler(jmiSave, (String) saveAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiSave); jmiSaveAs = new JMenuItem(saveAsAction); PlatformUtil.setMnemonic(jmiSaveAs, res.getString("KseFrame.jmiSaveAs.mnemonic").charAt(0)); jmiSaveAs.setDisplayedMnemonicIndex(5); jmiSaveAs.setToolTipText(null); new StatusBarChangeHandler(jmiSaveAs, (String) saveAsAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiSaveAs); jmiSaveAll = new JMenuItem(saveAllAction); PlatformUtil.setMnemonic(jmiSaveAll, res.getString("KseFrame.jmiSaveAll.mnemonic").charAt(0)); jmiSaveAll.setToolTipText(null); new StatusBarChangeHandler(jmiSaveAll, (String) saveAllAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiSaveAll); jmFile.addSeparator(); jmrfRecentFiles = new JMenuRecentFiles(res.getString("KseFrame.jmrfRecentFiles.text"), RECENT_FILES_SIZE); jmrfRecentFiles.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmrfRecentFiles.image"))))); PlatformUtil.setMnemonic(jmrfRecentFiles, res.getString("KseFrame.jmrfRecentFiles.mnemonic").charAt(0)); jmrfRecentFiles.putClientProperty(Options.NO_ICONS_KEY, Boolean.TRUE); // For the benefit of the plastic L&F jmFile.add(jmrfRecentFiles); File[] recentFiles = applicationSettings.getRecentFiles(); for (int i = recentFiles.length - 1; i >= 0; i--) { jmrfRecentFiles.add(createRecentFileMenuItem(jmrfRecentFiles, recentFiles[i])); } if (!OperatingSystem.isMacOs()) { jmFile.addSeparator(); jmiExit = new JMenuItem(exitAction); PlatformUtil.setMnemonic(jmiExit, res.getString("KseFrame.jmiExit.mnemonic").charAt(0)); jmiExit.setToolTipText(null); new StatusBarChangeHandler(jmiExit, (String) exitAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiExit); } jmEdit = new JMenu(res.getString("KseFrame.jmEdit.text")); PlatformUtil.setMnemonic(jmEdit, res.getString("KseFrame.jmEdit.mnemonic").charAt(0)); jmiUndo = new JMenuItem(undoAction); PlatformUtil.setMnemonic(jmiUndo, res.getString("KseFrame.jmiUndo.mnemonic").charAt(0)); jmiUndo.setToolTipText(null); new StatusBarChangeHandler(jmiUndo, (String) undoAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiUndo); jmiRedo = new JMenuItem(redoAction); PlatformUtil.setMnemonic(jmiRedo, res.getString("KseFrame.jmiRedo.mnemonic").charAt(0)); jmiRedo.setToolTipText(null); new StatusBarChangeHandler(jmiRedo, (String) redoAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiRedo); jmEdit.addSeparator(); jmiCut = new JMenuItem(cutAction); PlatformUtil.setMnemonic(jmiCut, res.getString("KseFrame.jmiCut.mnemonic").charAt(0)); jmiCut.setToolTipText(null); new StatusBarChangeHandler(jmiCut, (String) cutAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiCut); jmiCopy = new JMenuItem(copyAction); PlatformUtil.setMnemonic(jmiCopy, res.getString("KseFrame.jmiCopy.mnemonic").charAt(0)); jmiCopy.setToolTipText(null); new StatusBarChangeHandler(jmiCopy, (String) copyAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiCopy); jmiPaste = new JMenuItem(pasteAction); PlatformUtil.setMnemonic(jmiPaste, res.getString("KseFrame.jmiPaste.mnemonic").charAt(0)); jmiPaste.setToolTipText(null); new StatusBarChangeHandler(jmiPaste, (String) pasteAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiPaste); jmView = new JMenu(res.getString("KseFrame.jmView.text")); PlatformUtil.setMnemonic(jmView, res.getString("KseFrame.jmView.mnemonic").charAt(0)); boolean showToolBar = applicationSettings.getShowToolBar(); jcbmiShowHideToolBar = new JCheckBoxMenuItem(showHideToolBarAction); jcbmiShowHideToolBar.setState(showToolBar); PlatformUtil.setMnemonic(jcbmiShowHideToolBar, res.getString("KseFrame.jcbmiShowHideToolBar.mnemonic").charAt(0)); jcbmiShowHideToolBar.setToolTipText(null); new StatusBarChangeHandler(jcbmiShowHideToolBar, (String) showHideToolBarAction.getValue(Action.LONG_DESCRIPTION), this); jmView.add(jcbmiShowHideToolBar); jcbmiShowHideStatusBar = new JCheckBoxMenuItem(showHideStatusBarAction); jcbmiShowHideStatusBar.setState(applicationSettings.getShowStatusBar()); PlatformUtil.setMnemonic(jcbmiShowHideStatusBar, res.getString("KseFrame.jcbmiShowHideStatusBar.mnemonic").charAt(0)); jcbmiShowHideStatusBar.setToolTipText(null); new StatusBarChangeHandler(jcbmiShowHideStatusBar, (String) showHideStatusBarAction.getValue(Action.LONG_DESCRIPTION), this); jmView.add(jcbmiShowHideStatusBar); jmView.addSeparator(); jmTabStyle = new JMenu(res.getString("KseFrame.jmTabStyle.text")); jmTabStyle.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmTabStyle.image"))))); PlatformUtil.setMnemonic(jmTabStyle, res.getString("KseFrame.jmTabStyle.mnemonic").charAt(0)); jmView.add(jmTabStyle); jrbmiTabStyleWrap = new JRadioButtonMenuItem(tabStyleWrapAction); PlatformUtil.setMnemonic(jrbmiTabStyleWrap, res.getString("KseFrame.jrbmiTabStyleWrap.mnemonic").charAt(0)); jrbmiTabStyleWrap.setToolTipText(null); new StatusBarChangeHandler(jrbmiTabStyleWrap, (String) tabStyleWrapAction.getValue(Action.LONG_DESCRIPTION), this); jmTabStyle.add(jrbmiTabStyleWrap); jrbmiTabStyleScroll = new JRadioButtonMenuItem(tabStyleScrollAction); PlatformUtil.setMnemonic(jrbmiTabStyleScroll, res.getString("KseFrame.jrbmiTabStyleScroll.mnemonic").charAt(0)); jrbmiTabStyleScroll.setToolTipText(null); new StatusBarChangeHandler(jrbmiTabStyleScroll, (String) tabStyleScrollAction.getValue(Action.LONG_DESCRIPTION), this); jmTabStyle.add(jrbmiTabStyleScroll); ButtonGroup bgTabStyles = new ButtonGroup(); bgTabStyles.add(jrbmiTabStyleWrap); bgTabStyles.add(jrbmiTabStyleScroll); int tabLayout = applicationSettings.getTabLayout(); if (tabLayout == JTabbedPane.WRAP_TAB_LAYOUT) { jrbmiTabStyleWrap.setSelected(true); } else { jrbmiTabStyleScroll.setSelected(true); } jmTools = new JMenu(res.getString("KseFrame.jmTools.text")); PlatformUtil.setMnemonic(jmTools, res.getString("KseFrame.jmTools.mnemonic").charAt(0)); jmiGenerateKeyPair = new JMenuItem(generateKeyPairAction); PlatformUtil.setMnemonic(jmiGenerateKeyPair, res.getString("KseFrame.jmiGenerateKeyPair.mnemonic").charAt(0)); jmiGenerateKeyPair.setToolTipText(null); new StatusBarChangeHandler(jmiGenerateKeyPair, (String) generateKeyPairAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiGenerateKeyPair); jmiGenerateSecretKey = new JMenuItem(generateSecretKeyAction); PlatformUtil.setMnemonic(jmiGenerateSecretKey, res.getString("KseFrame.jmiGenerateSecretKey.mnemonic").charAt(0)); jmiGenerateSecretKey.setToolTipText(null); new StatusBarChangeHandler(jmiGenerateSecretKey, (String) generateSecretKeyAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiGenerateSecretKey); jmiImportTrustedCertificate = new JMenuItem(importTrustedCertificateAction); PlatformUtil.setMnemonic(jmiImportTrustedCertificate, res.getString("KseFrame.jmiImportTrustedCertificate.mnemonic").charAt(0)); jmiImportTrustedCertificate.setToolTipText(null); new StatusBarChangeHandler(jmiImportTrustedCertificate, (String) importTrustedCertificateAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiImportTrustedCertificate); jmiImportKeyPair = new JMenuItem(importKeyPairAction); PlatformUtil.setMnemonic(jmiImportKeyPair, res.getString("KseFrame.jmiImportKeyPair.mnemonic").charAt(0)); jmiImportKeyPair.setToolTipText(null); new StatusBarChangeHandler(jmiImportKeyPair, (String) importKeyPairAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiImportKeyPair); jmTools.addSeparator(); jmiSetPassword = new JMenuItem(setPasswordAction); PlatformUtil.setMnemonic(jmiSetPassword, res.getString("KseFrame.jmiSetPassword.mnemonic").charAt(0)); jmiSetPassword.setToolTipText(null); new StatusBarChangeHandler(jmiSetPassword, (String) setPasswordAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiSetPassword); jmChangeType = new JMenu(res.getString("KseFrame.jmChangeType.text")); jmChangeType.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmChangeType.image"))))); PlatformUtil.setMnemonic(jmChangeType, res.getString("KseFrame.jmChangeType.mnemonic").charAt(0)); jmChangeType.setEnabled(false); jmChangeType.putClientProperty(Options.NO_ICONS_KEY, Boolean.TRUE); // For the benefit of the plastic L&F jmTools.add(jmChangeType); jrbmiChangeTypeJks = new JRadioButtonMenuItem(changeTypeJksAction); PlatformUtil.setMnemonic(jrbmiChangeTypeJks, res.getString("KseFrame.jrbmiChangeTypeJks.mnemonic").charAt(0)); jrbmiChangeTypeJks.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeJks, (String) changeTypeJksAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeJks); jrbmiChangeTypeHTks = new JRadioButtonMenuItem(changeTypeHTksAction); PlatformUtil.setMnemonic(jrbmiChangeTypeHTks, res.getString("KseFrame.jrbmiChangeTypeJks.mnemonic").charAt(0)); jrbmiChangeTypeHTks.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeHTks, (String) changeTypeHTksAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeHTks); jrbmiChangeTypeJceks = new JRadioButtonMenuItem(changeTypeJceksAction); PlatformUtil.setMnemonic(jrbmiChangeTypeJceks, res.getString("KseFrame.jrbmiChangeTypeJceks.mnemonic").charAt(0)); jrbmiChangeTypeJceks.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeJceks, (String) changeTypeJceksAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeJceks); jrbmiChangeTypePkcs12 = new JRadioButtonMenuItem(changeTypePkcs12Action); PlatformUtil.setMnemonic(jrbmiChangeTypePkcs12, res.getString("KseFrame.jrbmiChangeTypePkcs12.mnemonic").charAt(0)); jrbmiChangeTypePkcs12.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypePkcs12, (String) changeTypePkcs12Action.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypePkcs12); jrbmiChangeTypeBksV1 = new JRadioButtonMenuItem(changeTypeBksV1Action); PlatformUtil.setMnemonic(jrbmiChangeTypeBksV1, res.getString("KseFrame.jrbmiChangeTypeBksV1.mnemonic").charAt(0)); jrbmiChangeTypeBksV1.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeBksV1, (String) changeTypeBksV1Action.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeBksV1); jrbmiChangeTypeBks = new JRadioButtonMenuItem(changeTypeBksAction); PlatformUtil.setMnemonic(jrbmiChangeTypeBks, res.getString("KseFrame.jrbmiChangeTypeBks.mnemonic").charAt(0)); jrbmiChangeTypeBks.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeBks, (String) changeTypeBksAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeBks); jrbmiChangeTypeUber = new JRadioButtonMenuItem(changeTypeUberAction); PlatformUtil.setMnemonic(jrbmiChangeTypeUber, res.getString("KseFrame.jrbmiChangeTypeUber.mnemonic").charAt(0)); jrbmiChangeTypeUber.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeUber, (String) changeTypeUberAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeUber); ButtonGroup changeTypeGroup = new ButtonGroup(); changeTypeGroup.add(jrbmiChangeTypeJks); changeTypeGroup.add(jrbmiChangeTypeJceks); changeTypeGroup.add(jrbmiChangeTypePkcs12); changeTypeGroup.add(jrbmiChangeTypeBks); changeTypeGroup.add(jrbmiChangeTypeBksV1); changeTypeGroup.add(jrbmiChangeTypeUber); jmiProperties = new JMenuItem(propertiesAction); PlatformUtil.setMnemonic(jmiProperties, res.getString("KseFrame.jmiProperties.mnemonic").charAt(0)); jmiProperties.setToolTipText(null); new StatusBarChangeHandler(jmiProperties, (String) propertiesAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiProperties); if (!OperatingSystem.isMacOs()) { jmTools.addSeparator(); jmiPreferences = new JMenuItem(preferencesAction); PlatformUtil.setMnemonic(jmiPreferences, res.getString("KseFrame.jmiPreferences.mnemonic").charAt(0)); jmiPreferences.setToolTipText(null); new StatusBarChangeHandler(jmiPreferences, (String) preferencesAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiPreferences); } jmExamine = new JMenu(res.getString("KseFrame.jmExamine.text")); PlatformUtil.setMnemonic(jmExamine, res.getString("KseFrame.jmExamine.mnemonic").charAt(0)); jmiExamineFile = new JMenuItem(examineFileAction); PlatformUtil.setMnemonic(jmiExamineFile, res.getString("KseFrame.jmiExamineFile.mnemonic").charAt(0)); jmiExamineFile.setToolTipText(null); new StatusBarChangeHandler(jmiExamineFile, (String) examineFileAction.getValue(Action.LONG_DESCRIPTION), this); jmExamine.add(jmiExamineFile); jmiExamineClipboard = new JMenuItem(examineClipboardAction); PlatformUtil.setMnemonic(jmiExamineClipboard, res.getString("KseFrame.jmiExamineClipboard.mnemonic").charAt(0)); jmiExamineClipboard.setToolTipText(null); new StatusBarChangeHandler(jmiExamineClipboard, (String) examineClipboardAction.getValue(Action.LONG_DESCRIPTION), this); jmExamine.add(jmiExamineClipboard); jmiExamineSsl = new JMenuItem(examineSslAction); PlatformUtil.setMnemonic(jmiExamineSsl, res.getString("KseFrame.jmiExamineSsl.mnemonic").charAt(0)); jmiExamineSsl.setToolTipText(null); new StatusBarChangeHandler(jmiExamineSsl, (String) examineSslAction.getValue(Action.LONG_DESCRIPTION), this); jmExamine.add(jmiExamineSsl); jmExamine.addSeparator(); jmiDetectFileType = new JMenuItem(detectFileTypeAction); PlatformUtil.setMnemonic(jmiDetectFileType, res.getString("KseFrame.jmiDetectFileType.mnemonic").charAt(0)); jmiDetectFileType.setToolTipText(null); new StatusBarChangeHandler(jmiDetectFileType, (String) detectFileTypeAction.getValue(Action.LONG_DESCRIPTION), this); jmExamine.add(jmiDetectFileType); jmHelp = new JMenu(res.getString("KseFrame.jmHelp.text")); PlatformUtil.setMnemonic(jmHelp, res.getString("KseFrame.jmHelp.mnemonic").charAt(0)); jmiHelp = new JMenuItem(helpAction); PlatformUtil.setMnemonic(jmiHelp, res.getString("KseFrame.jmiHelp.mnemonic").charAt(0)); jmiHelp.setToolTipText(null); new StatusBarChangeHandler(jmiHelp, (String) helpAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiHelp); jmiTipOfTheDay = new JMenuItem(tipOfTheDayAction); PlatformUtil.setMnemonic(jmiTipOfTheDay, res.getString("KseFrame.jmiTipOfTheDay.mnemonic").charAt(0)); jmiTipOfTheDay.setToolTipText(null); new StatusBarChangeHandler(jmiTipOfTheDay, (String) tipOfTheDayAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiTipOfTheDay); jmHelp.addSeparator(); jmOnlineResources = new JMenu(res.getString("KseFrame.jmOnlineResources.text")); jmOnlineResources.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmOnlineResources.image"))))); PlatformUtil.setMnemonic(jmOnlineResources, res.getString("KseFrame.jmOnlineResources.mnemonic").charAt(0)); jmHelp.add(jmOnlineResources); jmiWebsite = new JMenuItem(websiteAction); PlatformUtil.setMnemonic(jmiWebsite, res.getString("KseFrame.jmiWebsite.mnemonic").charAt(0)); jmiWebsite.setToolTipText(null); new StatusBarChangeHandler(jmiWebsite, (String) websiteAction.getValue(Action.LONG_DESCRIPTION), this); jmOnlineResources.add(jmiWebsite); jmiSourceforge = new JMenuItem(gitHubProjectSiteAction); PlatformUtil.setMnemonic(jmiSourceforge, res.getString("KseFrame.jmiSourceforge.mnemonic").charAt(0)); jmiSourceforge.setToolTipText(null); new StatusBarChangeHandler(jmiSourceforge, (String) gitHubProjectSiteAction.getValue(Action.LONG_DESCRIPTION), this); jmOnlineResources.add(jmiSourceforge); jmiSfBugs = new JMenuItem(gitHubIssueTrackerAction); PlatformUtil.setMnemonic(jmiSfBugs, res.getString("KseFrame.jmiSfBugs.mnemonic").charAt(0)); jmiSfBugs.setToolTipText(null); new StatusBarChangeHandler(jmiSfBugs, (String) gitHubIssueTrackerAction.getValue(Action.LONG_DESCRIPTION), this); jmOnlineResources.add(jmiSfBugs); jmiCheckUpdate = new JMenuItem(checkUpdateAction); PlatformUtil.setMnemonic(jmiCheckUpdate, res.getString("KseFrame.jmiCheckUpdate.mnemonic").charAt(0)); jmiCheckUpdate.setToolTipText(null); new StatusBarChangeHandler(jmiCheckUpdate, (String) checkUpdateAction.getValue(Action.LONG_DESCRIPTION), this); // no update checks if KSE was packaged as rpm if (!Boolean.getBoolean(KSE_UPDATE_CHECK_DISABLED)) { jmOnlineResources.add(jmiCheckUpdate); } jmiSecurityProviders = new JMenuItem(securityProvidersAction); PlatformUtil.setMnemonic(jmiSecurityProviders, res.getString("KseFrame.jmiSecurityProviders.mnemonic").charAt(0)); jmiSecurityProviders.setToolTipText(null); new StatusBarChangeHandler(jmiSecurityProviders, (String) securityProvidersAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiSecurityProviders); jmiCryptographyStrength = new JMenuItem(cryptographyStrengthAction); PlatformUtil.setMnemonic(jmiCryptographyStrength, res.getString("KseFrame.jmiCryptographyStrength.mnemonic").charAt(0)); jmiCryptographyStrength.setToolTipText(null); new StatusBarChangeHandler(jmiCryptographyStrength, (String) cryptographyStrengthAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiCryptographyStrength); jmiJars = new JMenuItem(jarsAction); PlatformUtil.setMnemonic(jmiJars, res.getString("KseFrame.jmiJars.mnemonic").charAt(0)); jmiJars.setToolTipText(null); new StatusBarChangeHandler(jmiJars, (String) jarsAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiJars); jmiSystemInformation = new JMenuItem(systemInformationAction); PlatformUtil.setMnemonic(jmiSystemInformation, res.getString("KseFrame.jmiSystemInformation.mnemonic").charAt(0)); jmiSystemInformation.setToolTipText(null); new StatusBarChangeHandler(jmiSystemInformation, (String) systemInformationAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiSystemInformation); if (!OperatingSystem.isMacOs()) { jmHelp.addSeparator(); jmiAbout = new JMenuItem(aboutAction); PlatformUtil.setMnemonic(jmiAbout, res.getString("KseFrame.jmiAbout.mnemonic").charAt(0)); jmiAbout.setToolTipText(null); new StatusBarChangeHandler(jmiAbout, (String) aboutAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiAbout); } jmbMenuBar.add(jmFile); jmbMenuBar.add(jmEdit); jmbMenuBar.add(jmView); jmbMenuBar.add(jmTools); jmbMenuBar.add(jmExamine); jmbMenuBar.add(jmHelp); jmbMenuBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH); frame.setJMenuBar(jmbMenuBar); }
From source file:net.sf.keystore_explorer.gui.KseFrame.java
License:Open Source License
private void initKeyStorePopupMenu() { jpmKeyStore = new JPopupMenu(); jmiKeyStoreGenerateKeyPair = new JMenuItem(generateKeyPairAction); PlatformUtil.setMnemonic(jmiGenerateKeyPair, res.getString("KseFrame.jmiGenerateKeyPair.mnemonic").charAt(0)); jmiKeyStoreGenerateKeyPair.setToolTipText(null); new StatusBarChangeHandler(jmiKeyStoreGenerateKeyPair, (String) generateKeyPairAction.getValue(Action.LONG_DESCRIPTION), this); jpmKeyStore.add(jmiKeyStoreGenerateKeyPair); jmiKeyStoreGenerateSecretKey = new JMenuItem(generateSecretKeyAction); PlatformUtil.setMnemonic(jmiKeyStoreGenerateSecretKey, res.getString("KseFrame.jmiGenerateSecretKey.mnemonic").charAt(0)); jmiKeyStoreGenerateSecretKey.setToolTipText(null); new StatusBarChangeHandler(jmiKeyStoreGenerateSecretKey, (String) generateSecretKeyAction.getValue(Action.LONG_DESCRIPTION), this); jpmKeyStore.add(jmiKeyStoreGenerateSecretKey); jmiKeyStoreImportTrustedCertificate = new JMenuItem(importTrustedCertificateAction); PlatformUtil.setMnemonic(jmiKeyStoreImportTrustedCertificate, res.getString("KseFrame.jmiImportTrustedCertificate.mnemonic").charAt(0)); jmiKeyStoreImportTrustedCertificate.setToolTipText(null); new StatusBarChangeHandler(jmiKeyStoreImportTrustedCertificate, (String) importTrustedCertificateAction.getValue(Action.LONG_DESCRIPTION), this); jpmKeyStore.add(jmiKeyStoreImportTrustedCertificate); jmiKeyStoreImportKeyPair = new JMenuItem(importKeyPairAction); PlatformUtil.setMnemonic(jmiKeyStoreImportKeyPair, res.getString("KseFrame.jmiImportKeyPair.mnemonic").charAt(0)); jmiKeyStoreImportKeyPair.setToolTipText(null); new StatusBarChangeHandler(jmiKeyStoreImportKeyPair, (String) importKeyPairAction.getValue(Action.LONG_DESCRIPTION), this); jpmKeyStore.add(jmiKeyStoreImportKeyPair); jpmKeyStore.addSeparator();//from w w w. j av a 2 s. c o m jmiKeyStoreSetPassword = new JMenuItem(setPasswordAction); PlatformUtil.setMnemonic(jmiKeyStoreSetPassword, res.getString("KseFrame.jmiSetPassword.mnemonic").charAt(0)); jmiKeyStoreSetPassword.setToolTipText(null); new StatusBarChangeHandler(jmiKeyStoreSetPassword, (String) setPasswordAction.getValue(Action.LONG_DESCRIPTION), this); jpmKeyStore.add(jmiKeyStoreSetPassword); jmKeyStoreChangeType = new JMenu(res.getString("KseFrame.jmChangeType.text")); jmKeyStoreChangeType.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmChangeType.image"))))); PlatformUtil.setMnemonic(jmKeyStoreChangeType, res.getString("KseFrame.jmChangeType.mnemonic").charAt(0)); jmKeyStoreChangeType.putClientProperty(Options.NO_ICONS_KEY, Boolean.TRUE); // For the benefit of the plastic L&F jpmKeyStore.add(jmKeyStoreChangeType); jrbmiKeyStoreChangeTypeJks = new JRadioButtonMenuItem(changeTypeJksAction); PlatformUtil.setMnemonic(jrbmiKeyStoreChangeTypeJks, res.getString("KseFrame.jrbmiChangeTypeJks.mnemonic").charAt(0)); jrbmiKeyStoreChangeTypeJks.setToolTipText(null); new StatusBarChangeHandler(jrbmiKeyStoreChangeTypeJks, (String) changeTypeJksAction.getValue(Action.LONG_DESCRIPTION), this); jmKeyStoreChangeType.add(jrbmiKeyStoreChangeTypeJks); jrbmiKeyStoreChangeTypeJceks = new JRadioButtonMenuItem(changeTypeJceksAction); PlatformUtil.setMnemonic(jrbmiKeyStoreChangeTypeJceks, res.getString("KseFrame.jrbmiChangeTypeJceks.mnemonic").charAt(0)); jrbmiKeyStoreChangeTypeJceks.setToolTipText(null); new StatusBarChangeHandler(jrbmiKeyStoreChangeTypeJceks, (String) changeTypeJceksAction.getValue(Action.LONG_DESCRIPTION), this); jmKeyStoreChangeType.add(jrbmiKeyStoreChangeTypeJceks); jrbmiKeyStoreChangeTypePkcs12 = new JRadioButtonMenuItem(changeTypePkcs12Action); PlatformUtil.setMnemonic(jrbmiKeyStoreChangeTypePkcs12, res.getString("KseFrame.jrbmiChangeTypePkcs12.mnemonic").charAt(0)); jrbmiKeyStoreChangeTypePkcs12.setToolTipText(null); new StatusBarChangeHandler(jrbmiKeyStoreChangeTypePkcs12, (String) changeTypePkcs12Action.getValue(Action.LONG_DESCRIPTION), this); jmKeyStoreChangeType.add(jrbmiKeyStoreChangeTypePkcs12); jrbmiKeyStoreChangeTypeBksV1 = new JRadioButtonMenuItem(changeTypeBksV1Action); PlatformUtil.setMnemonic(jrbmiKeyStoreChangeTypeBksV1, res.getString("KseFrame.jrbmiChangeTypeBksV1.mnemonic").charAt(0)); jrbmiKeyStoreChangeTypeBksV1.setToolTipText(null); new StatusBarChangeHandler(jrbmiKeyStoreChangeTypeBksV1, (String) changeTypeBksV1Action.getValue(Action.LONG_DESCRIPTION), this); jmKeyStoreChangeType.add(jrbmiKeyStoreChangeTypeBksV1); jrbmiKeyStoreChangeTypeBks = new JRadioButtonMenuItem(changeTypeBksAction); PlatformUtil.setMnemonic(jrbmiKeyStoreChangeTypeBks, res.getString("KseFrame.jrbmiChangeTypeBks.mnemonic").charAt(0)); jrbmiKeyStoreChangeTypeBks.setToolTipText(null); new StatusBarChangeHandler(jrbmiKeyStoreChangeTypeBks, (String) changeTypeBksAction.getValue(Action.LONG_DESCRIPTION), this); jmKeyStoreChangeType.add(jrbmiKeyStoreChangeTypeBks); jrbmiKeyStoreChangeTypeUber = new JRadioButtonMenuItem(changeTypeUberAction); PlatformUtil.setMnemonic(jrbmiKeyStoreChangeTypeUber, res.getString("KseFrame.jrbmiChangeTypeUber.mnemonic").charAt(0)); jrbmiKeyStoreChangeTypeUber.setToolTipText(null); new StatusBarChangeHandler(jrbmiKeyStoreChangeTypeUber, (String) changeTypeUberAction.getValue(Action.LONG_DESCRIPTION), this); jmKeyStoreChangeType.add(jrbmiKeyStoreChangeTypeUber); ButtonGroup changeTypeGroup = new ButtonGroup(); changeTypeGroup.add(jrbmiKeyStoreChangeTypeJks); changeTypeGroup.add(jrbmiKeyStoreChangeTypeJceks); changeTypeGroup.add(jrbmiKeyStoreChangeTypePkcs12); changeTypeGroup.add(jrbmiKeyStoreChangeTypeBks); changeTypeGroup.add(jrbmiKeyStoreChangeTypeBksV1); changeTypeGroup.add(jrbmiKeyStoreChangeTypeUber); jmiKeyStoreProperties = new JMenuItem(propertiesAction); PlatformUtil.setMnemonic(jmiKeyStoreProperties, res.getString("KseFrame.jmiProperties.mnemonic").charAt(0)); jmiKeyStoreProperties.setToolTipText(null); new StatusBarChangeHandler(jmiKeyStoreProperties, (String) propertiesAction.getValue(Action.LONG_DESCRIPTION), this); jpmKeyStore.add(jmiKeyStoreProperties); }
From source file:org.kse.gui.KseFrame.java
License:Open Source License
private void initMenu() { JMenuBar jmbMenuBar = new JMenuBar(); jmFile = new JMenu(res.getString("KseFrame.jmFile.text")); PlatformUtil.setMnemonic(jmFile, res.getString("KseFrame.jmFile.mnemonic").charAt(0)); jmiNew = new JMenuItem(newAction); PlatformUtil.setMnemonic(jmiNew, res.getString("KseFrame.jmiNew.mnemonic").charAt(0)); jmiNew.setToolTipText(null);/*from w w w .j a v a2 s. c o m*/ new StatusBarChangeHandler(jmiNew, (String) newAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiNew); jmiOpen = new JMenuItem(openAction); PlatformUtil.setMnemonic(jmiOpen, res.getString("KseFrame.jmiOpen.mnemonic").charAt(0)); jmiOpen.setToolTipText(null); new StatusBarChangeHandler(jmiOpen, (String) openAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiOpen); jmOpenSpecial = new JMenu(res.getString("KseFrame.jmOpenSpecial.text")); jmOpenSpecial.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmOpenSpecial.image"))))); PlatformUtil.setMnemonic(jmOpenSpecial, res.getString("KseFrame.jmOpenSpecial.mnemonic").charAt(0)); jmFile.add(jmOpenSpecial); jmiOpenDefaultKeyStore = new JMenuItem(openDefaultKeyStoreAction); PlatformUtil.setMnemonic(jmiOpenDefaultKeyStore, res.getString("KseFrame.jmiOpenDefaultKeyStore.mnemonic").charAt(0)); jmiOpenDefaultKeyStore.setToolTipText(null); new StatusBarChangeHandler(jmiOpenDefaultKeyStore, (String) openDefaultKeyStoreAction.getValue(Action.LONG_DESCRIPTION), this); jmOpenSpecial.add(jmiOpenDefaultKeyStore); jmiOpenCaCertificatesKeyStore = new JMenuItem(openCaCertificatesKeyStoreAction); PlatformUtil.setMnemonic(jmiOpenCaCertificatesKeyStore, res.getString("KseFrame.jmiOpenCaCertificatesKeyStore.mnemonic").charAt(0)); jmiOpenCaCertificatesKeyStore.setToolTipText(null); new StatusBarChangeHandler(jmiOpenCaCertificatesKeyStore, (String) openCaCertificatesKeyStoreAction.getValue(Action.LONG_DESCRIPTION), this); jmOpenSpecial.add(jmiOpenCaCertificatesKeyStore); jmiOpenPkcs11KeyStore = new JMenuItem(openPkcs11KeyStoreAction); PlatformUtil.setMnemonic(jmiOpenPkcs11KeyStore, res.getString("KseFrame.jmiOpenPkcs11KeyStore.mnemonic").charAt(0)); jmiOpenPkcs11KeyStore.setToolTipText(null); new StatusBarChangeHandler(jmiOpenPkcs11KeyStore, (String) openPkcs11KeyStoreAction.getValue(Action.LONG_DESCRIPTION), this); jmOpenSpecial.add(jmiOpenPkcs11KeyStore); jmiOpenMsCapiKeyStore = new JMenuItem(openMsCapiAction); PlatformUtil.setMnemonic(jmiOpenMsCapiKeyStore, res.getString("KseFrame.jmiOpenPkcs11KeyStore.mnemonic").charAt(0)); jmiOpenMsCapiKeyStore.setToolTipText(null); new StatusBarChangeHandler(jmiOpenMsCapiKeyStore, (String) openMsCapiAction.getValue(Action.LONG_DESCRIPTION), this); // show menu item for MSCAPI Windows-MY only on Windows if (OperatingSystem.isWindows()) { jmOpenSpecial.add(jmiOpenMsCapiKeyStore); } jmFile.addSeparator(); jmiClose = new JMenuItem(closeAction); PlatformUtil.setMnemonic(jmiClose, res.getString("KseFrame.jmiClose.mnemonic").charAt(0)); jmiClose.setToolTipText(null); new StatusBarChangeHandler(jmiClose, (String) closeAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiClose); jmiCloseAll = new JMenuItem(closeAllAction); PlatformUtil.setMnemonic(jmiCloseAll, res.getString("KseFrame.jmiCloseAll.mnemonic").charAt(0)); jmiCloseAll.setToolTipText(null); new StatusBarChangeHandler(jmiCloseAll, (String) closeAllAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiCloseAll); jmFile.addSeparator(); jmiSave = new JMenuItem(saveAction); PlatformUtil.setMnemonic(jmiSave, res.getString("KseFrame.jmiSave.mnemonic").charAt(0)); jmiSave.setToolTipText(null); new StatusBarChangeHandler(jmiSave, (String) saveAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiSave); jmiSaveAs = new JMenuItem(saveAsAction); PlatformUtil.setMnemonic(jmiSaveAs, res.getString("KseFrame.jmiSaveAs.mnemonic").charAt(0)); jmiSaveAs.setDisplayedMnemonicIndex(5); jmiSaveAs.setToolTipText(null); new StatusBarChangeHandler(jmiSaveAs, (String) saveAsAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiSaveAs); jmiSaveAll = new JMenuItem(saveAllAction); PlatformUtil.setMnemonic(jmiSaveAll, res.getString("KseFrame.jmiSaveAll.mnemonic").charAt(0)); jmiSaveAll.setToolTipText(null); new StatusBarChangeHandler(jmiSaveAll, (String) saveAllAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiSaveAll); jmFile.addSeparator(); jmrfRecentFiles = new JMenuRecentFiles(res.getString("KseFrame.jmrfRecentFiles.text"), RECENT_FILES_SIZE); jmrfRecentFiles.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmrfRecentFiles.image"))))); PlatformUtil.setMnemonic(jmrfRecentFiles, res.getString("KseFrame.jmrfRecentFiles.mnemonic").charAt(0)); jmrfRecentFiles.putClientProperty(Options.NO_ICONS_KEY, Boolean.TRUE); // For the benefit of the plastic L&F jmFile.add(jmrfRecentFiles); File[] recentFiles = applicationSettings.getRecentFiles(); for (int i = recentFiles.length - 1; i >= 0; i--) { jmrfRecentFiles.add(createRecentFileMenuItem(jmrfRecentFiles, recentFiles[i])); } if (!OperatingSystem.isMacOs()) { jmFile.addSeparator(); jmiExit = new JMenuItem(exitAction); PlatformUtil.setMnemonic(jmiExit, res.getString("KseFrame.jmiExit.mnemonic").charAt(0)); jmiExit.setToolTipText(null); new StatusBarChangeHandler(jmiExit, (String) exitAction.getValue(Action.LONG_DESCRIPTION), this); jmFile.add(jmiExit); } jmEdit = new JMenu(res.getString("KseFrame.jmEdit.text")); PlatformUtil.setMnemonic(jmEdit, res.getString("KseFrame.jmEdit.mnemonic").charAt(0)); jmiUndo = new JMenuItem(undoAction); PlatformUtil.setMnemonic(jmiUndo, res.getString("KseFrame.jmiUndo.mnemonic").charAt(0)); jmiUndo.setToolTipText(null); new StatusBarChangeHandler(jmiUndo, (String) undoAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiUndo); jmiRedo = new JMenuItem(redoAction); PlatformUtil.setMnemonic(jmiRedo, res.getString("KseFrame.jmiRedo.mnemonic").charAt(0)); jmiRedo.setToolTipText(null); new StatusBarChangeHandler(jmiRedo, (String) redoAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiRedo); jmEdit.addSeparator(); jmiCut = new JMenuItem(cutAction); PlatformUtil.setMnemonic(jmiCut, res.getString("KseFrame.jmiCut.mnemonic").charAt(0)); jmiCut.setToolTipText(null); new StatusBarChangeHandler(jmiCut, (String) cutAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiCut); jmiCopy = new JMenuItem(copyAction); PlatformUtil.setMnemonic(jmiCopy, res.getString("KseFrame.jmiCopy.mnemonic").charAt(0)); jmiCopy.setToolTipText(null); new StatusBarChangeHandler(jmiCopy, (String) copyAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiCopy); jmiPaste = new JMenuItem(pasteAction); PlatformUtil.setMnemonic(jmiPaste, res.getString("KseFrame.jmiPaste.mnemonic").charAt(0)); jmiPaste.setToolTipText(null); new StatusBarChangeHandler(jmiPaste, (String) pasteAction.getValue(Action.LONG_DESCRIPTION), this); jmEdit.add(jmiPaste); jmView = new JMenu(res.getString("KseFrame.jmView.text")); PlatformUtil.setMnemonic(jmView, res.getString("KseFrame.jmView.mnemonic").charAt(0)); boolean showToolBar = applicationSettings.getShowToolBar(); jcbmiShowHideToolBar = new JCheckBoxMenuItem(showHideToolBarAction); jcbmiShowHideToolBar.setState(showToolBar); PlatformUtil.setMnemonic(jcbmiShowHideToolBar, res.getString("KseFrame.jcbmiShowHideToolBar.mnemonic").charAt(0)); jcbmiShowHideToolBar.setToolTipText(null); new StatusBarChangeHandler(jcbmiShowHideToolBar, (String) showHideToolBarAction.getValue(Action.LONG_DESCRIPTION), this); jmView.add(jcbmiShowHideToolBar); jcbmiShowHideStatusBar = new JCheckBoxMenuItem(showHideStatusBarAction); jcbmiShowHideStatusBar.setState(applicationSettings.getShowStatusBar()); PlatformUtil.setMnemonic(jcbmiShowHideStatusBar, res.getString("KseFrame.jcbmiShowHideStatusBar.mnemonic").charAt(0)); jcbmiShowHideStatusBar.setToolTipText(null); new StatusBarChangeHandler(jcbmiShowHideStatusBar, (String) showHideStatusBarAction.getValue(Action.LONG_DESCRIPTION), this); jmView.add(jcbmiShowHideStatusBar); jmView.addSeparator(); jmTabStyle = new JMenu(res.getString("KseFrame.jmTabStyle.text")); jmTabStyle.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmTabStyle.image"))))); PlatformUtil.setMnemonic(jmTabStyle, res.getString("KseFrame.jmTabStyle.mnemonic").charAt(0)); jmView.add(jmTabStyle); jrbmiTabStyleWrap = new JRadioButtonMenuItem(tabStyleWrapAction); PlatformUtil.setMnemonic(jrbmiTabStyleWrap, res.getString("KseFrame.jrbmiTabStyleWrap.mnemonic").charAt(0)); jrbmiTabStyleWrap.setToolTipText(null); new StatusBarChangeHandler(jrbmiTabStyleWrap, (String) tabStyleWrapAction.getValue(Action.LONG_DESCRIPTION), this); jmTabStyle.add(jrbmiTabStyleWrap); jrbmiTabStyleScroll = new JRadioButtonMenuItem(tabStyleScrollAction); PlatformUtil.setMnemonic(jrbmiTabStyleScroll, res.getString("KseFrame.jrbmiTabStyleScroll.mnemonic").charAt(0)); jrbmiTabStyleScroll.setToolTipText(null); new StatusBarChangeHandler(jrbmiTabStyleScroll, (String) tabStyleScrollAction.getValue(Action.LONG_DESCRIPTION), this); jmTabStyle.add(jrbmiTabStyleScroll); ButtonGroup bgTabStyles = new ButtonGroup(); bgTabStyles.add(jrbmiTabStyleWrap); bgTabStyles.add(jrbmiTabStyleScroll); int tabLayout = applicationSettings.getTabLayout(); if (tabLayout == JTabbedPane.WRAP_TAB_LAYOUT) { jrbmiTabStyleWrap.setSelected(true); } else { jrbmiTabStyleScroll.setSelected(true); } jmTools = new JMenu(res.getString("KseFrame.jmTools.text")); PlatformUtil.setMnemonic(jmTools, res.getString("KseFrame.jmTools.mnemonic").charAt(0)); jmiGenerateKeyPair = new JMenuItem(generateKeyPairAction); PlatformUtil.setMnemonic(jmiGenerateKeyPair, res.getString("KseFrame.jmiGenerateKeyPair.mnemonic").charAt(0)); jmiGenerateKeyPair.setToolTipText(null); new StatusBarChangeHandler(jmiGenerateKeyPair, (String) generateKeyPairAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiGenerateKeyPair); jmiGenerateSecretKey = new JMenuItem(generateSecretKeyAction); PlatformUtil.setMnemonic(jmiGenerateSecretKey, res.getString("KseFrame.jmiGenerateSecretKey.mnemonic").charAt(0)); jmiGenerateSecretKey.setToolTipText(null); new StatusBarChangeHandler(jmiGenerateSecretKey, (String) generateSecretKeyAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiGenerateSecretKey); jmiImportTrustedCertificate = new JMenuItem(importTrustedCertificateAction); PlatformUtil.setMnemonic(jmiImportTrustedCertificate, res.getString("KseFrame.jmiImportTrustedCertificate.mnemonic").charAt(0)); jmiImportTrustedCertificate.setToolTipText(null); new StatusBarChangeHandler(jmiImportTrustedCertificate, (String) importTrustedCertificateAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiImportTrustedCertificate); jmiImportKeyPair = new JMenuItem(importKeyPairAction); PlatformUtil.setMnemonic(jmiImportKeyPair, res.getString("KseFrame.jmiImportKeyPair.mnemonic").charAt(0)); jmiImportKeyPair.setToolTipText(null); new StatusBarChangeHandler(jmiImportKeyPair, (String) importKeyPairAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiImportKeyPair); jmTools.addSeparator(); jmiSetPassword = new JMenuItem(setPasswordAction); PlatformUtil.setMnemonic(jmiSetPassword, res.getString("KseFrame.jmiSetPassword.mnemonic").charAt(0)); jmiSetPassword.setToolTipText(null); new StatusBarChangeHandler(jmiSetPassword, (String) setPasswordAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiSetPassword); jmChangeType = new JMenu(res.getString("KseFrame.jmChangeType.text")); jmChangeType.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmChangeType.image"))))); PlatformUtil.setMnemonic(jmChangeType, res.getString("KseFrame.jmChangeType.mnemonic").charAt(0)); jmChangeType.setEnabled(false); jmChangeType.putClientProperty(Options.NO_ICONS_KEY, Boolean.TRUE); // For the benefit of the plastic L&F jmTools.add(jmChangeType); jrbmiChangeTypeJks = new JRadioButtonMenuItem(changeTypeJksAction); PlatformUtil.setMnemonic(jrbmiChangeTypeJks, res.getString("KseFrame.jrbmiChangeTypeJks.mnemonic").charAt(0)); jrbmiChangeTypeJks.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeJks, (String) changeTypeJksAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeJks); jrbmiChangeTypeJceks = new JRadioButtonMenuItem(changeTypeJceksAction); PlatformUtil.setMnemonic(jrbmiChangeTypeJceks, res.getString("KseFrame.jrbmiChangeTypeJceks.mnemonic").charAt(0)); jrbmiChangeTypeJceks.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeJceks, (String) changeTypeJceksAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeJceks); jrbmiChangeTypePkcs12 = new JRadioButtonMenuItem(changeTypePkcs12Action); PlatformUtil.setMnemonic(jrbmiChangeTypePkcs12, res.getString("KseFrame.jrbmiChangeTypePkcs12.mnemonic").charAt(0)); jrbmiChangeTypePkcs12.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypePkcs12, (String) changeTypePkcs12Action.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypePkcs12); jrbmiChangeTypeBksV1 = new JRadioButtonMenuItem(changeTypeBksV1Action); PlatformUtil.setMnemonic(jrbmiChangeTypeBksV1, res.getString("KseFrame.jrbmiChangeTypeBksV1.mnemonic").charAt(0)); jrbmiChangeTypeBksV1.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeBksV1, (String) changeTypeBksV1Action.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeBksV1); jrbmiChangeTypeBks = new JRadioButtonMenuItem(changeTypeBksAction); PlatformUtil.setMnemonic(jrbmiChangeTypeBks, res.getString("KseFrame.jrbmiChangeTypeBks.mnemonic").charAt(0)); jrbmiChangeTypeBks.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeBks, (String) changeTypeBksAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeBks); jrbmiChangeTypeUber = new JRadioButtonMenuItem(changeTypeUberAction); PlatformUtil.setMnemonic(jrbmiChangeTypeUber, res.getString("KseFrame.jrbmiChangeTypeUber.mnemonic").charAt(0)); jrbmiChangeTypeUber.setToolTipText(null); new StatusBarChangeHandler(jrbmiChangeTypeUber, (String) changeTypeUberAction.getValue(Action.LONG_DESCRIPTION), this); jmChangeType.add(jrbmiChangeTypeUber); ButtonGroup changeTypeGroup = new ButtonGroup(); changeTypeGroup.add(jrbmiChangeTypeJks); changeTypeGroup.add(jrbmiChangeTypeJceks); changeTypeGroup.add(jrbmiChangeTypePkcs12); changeTypeGroup.add(jrbmiChangeTypeBks); changeTypeGroup.add(jrbmiChangeTypeBksV1); changeTypeGroup.add(jrbmiChangeTypeUber); jmiProperties = new JMenuItem(propertiesAction); PlatformUtil.setMnemonic(jmiProperties, res.getString("KseFrame.jmiProperties.mnemonic").charAt(0)); jmiProperties.setToolTipText(null); new StatusBarChangeHandler(jmiProperties, (String) propertiesAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiProperties); if (!OperatingSystem.isMacOs()) { jmTools.addSeparator(); jmiPreferences = new JMenuItem(preferencesAction); PlatformUtil.setMnemonic(jmiPreferences, res.getString("KseFrame.jmiPreferences.mnemonic").charAt(0)); jmiPreferences.setToolTipText(null); new StatusBarChangeHandler(jmiPreferences, (String) preferencesAction.getValue(Action.LONG_DESCRIPTION), this); jmTools.add(jmiPreferences); } jmExamine = new JMenu(res.getString("KseFrame.jmExamine.text")); PlatformUtil.setMnemonic(jmExamine, res.getString("KseFrame.jmExamine.mnemonic").charAt(0)); jmiExamineFile = new JMenuItem(examineFileAction); PlatformUtil.setMnemonic(jmiExamineFile, res.getString("KseFrame.jmiExamineFile.mnemonic").charAt(0)); jmiExamineFile.setToolTipText(null); new StatusBarChangeHandler(jmiExamineFile, (String) examineFileAction.getValue(Action.LONG_DESCRIPTION), this); jmExamine.add(jmiExamineFile); jmiExamineClipboard = new JMenuItem(examineClipboardAction); PlatformUtil.setMnemonic(jmiExamineClipboard, res.getString("KseFrame.jmiExamineClipboard.mnemonic").charAt(0)); jmiExamineClipboard.setToolTipText(null); new StatusBarChangeHandler(jmiExamineClipboard, (String) examineClipboardAction.getValue(Action.LONG_DESCRIPTION), this); jmExamine.add(jmiExamineClipboard); jmiExamineSsl = new JMenuItem(examineSslAction); PlatformUtil.setMnemonic(jmiExamineSsl, res.getString("KseFrame.jmiExamineSsl.mnemonic").charAt(0)); jmiExamineSsl.setToolTipText(null); new StatusBarChangeHandler(jmiExamineSsl, (String) examineSslAction.getValue(Action.LONG_DESCRIPTION), this); jmExamine.add(jmiExamineSsl); jmExamine.addSeparator(); jmiDetectFileType = new JMenuItem(detectFileTypeAction); PlatformUtil.setMnemonic(jmiDetectFileType, res.getString("KseFrame.jmiDetectFileType.mnemonic").charAt(0)); jmiDetectFileType.setToolTipText(null); new StatusBarChangeHandler(jmiDetectFileType, (String) detectFileTypeAction.getValue(Action.LONG_DESCRIPTION), this); jmExamine.add(jmiDetectFileType); jmHelp = new JMenu(res.getString("KseFrame.jmHelp.text")); PlatformUtil.setMnemonic(jmHelp, res.getString("KseFrame.jmHelp.mnemonic").charAt(0)); jmiHelp = new JMenuItem(helpAction); PlatformUtil.setMnemonic(jmiHelp, res.getString("KseFrame.jmiHelp.mnemonic").charAt(0)); jmiHelp.setToolTipText(null); new StatusBarChangeHandler(jmiHelp, (String) helpAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiHelp); jmiTipOfTheDay = new JMenuItem(tipOfTheDayAction); PlatformUtil.setMnemonic(jmiTipOfTheDay, res.getString("KseFrame.jmiTipOfTheDay.mnemonic").charAt(0)); jmiTipOfTheDay.setToolTipText(null); new StatusBarChangeHandler(jmiTipOfTheDay, (String) tipOfTheDayAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiTipOfTheDay); jmHelp.addSeparator(); jmOnlineResources = new JMenu(res.getString("KseFrame.jmOnlineResources.text")); jmOnlineResources.setIcon(new ImageIcon(Toolkit.getDefaultToolkit() .createImage(getClass().getResource(res.getString("KseFrame.jmOnlineResources.image"))))); PlatformUtil.setMnemonic(jmOnlineResources, res.getString("KseFrame.jmOnlineResources.mnemonic").charAt(0)); jmHelp.add(jmOnlineResources); jmiWebsite = new JMenuItem(websiteAction); PlatformUtil.setMnemonic(jmiWebsite, res.getString("KseFrame.jmiWebsite.mnemonic").charAt(0)); jmiWebsite.setToolTipText(null); new StatusBarChangeHandler(jmiWebsite, (String) websiteAction.getValue(Action.LONG_DESCRIPTION), this); jmOnlineResources.add(jmiWebsite); jmiSourceforge = new JMenuItem(gitHubProjectSiteAction); PlatformUtil.setMnemonic(jmiSourceforge, res.getString("KseFrame.jmiSourceforge.mnemonic").charAt(0)); jmiSourceforge.setToolTipText(null); new StatusBarChangeHandler(jmiSourceforge, (String) gitHubProjectSiteAction.getValue(Action.LONG_DESCRIPTION), this); jmOnlineResources.add(jmiSourceforge); jmiSfBugs = new JMenuItem(gitHubIssueTrackerAction); PlatformUtil.setMnemonic(jmiSfBugs, res.getString("KseFrame.jmiSfBugs.mnemonic").charAt(0)); jmiSfBugs.setToolTipText(null); new StatusBarChangeHandler(jmiSfBugs, (String) gitHubIssueTrackerAction.getValue(Action.LONG_DESCRIPTION), this); jmOnlineResources.add(jmiSfBugs); jmiCheckUpdate = new JMenuItem(checkUpdateAction); PlatformUtil.setMnemonic(jmiCheckUpdate, res.getString("KseFrame.jmiCheckUpdate.mnemonic").charAt(0)); jmiCheckUpdate.setToolTipText(null); new StatusBarChangeHandler(jmiCheckUpdate, (String) checkUpdateAction.getValue(Action.LONG_DESCRIPTION), this); // no update checks if KSE was packaged as rpm if (!Boolean.getBoolean(KSE_UPDATE_CHECK_DISABLED)) { jmOnlineResources.add(jmiCheckUpdate); } jmiSecurityProviders = new JMenuItem(securityProvidersAction); PlatformUtil.setMnemonic(jmiSecurityProviders, res.getString("KseFrame.jmiSecurityProviders.mnemonic").charAt(0)); jmiSecurityProviders.setToolTipText(null); new StatusBarChangeHandler(jmiSecurityProviders, (String) securityProvidersAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiSecurityProviders); jmiCryptographyStrength = new JMenuItem(cryptographyStrengthAction); PlatformUtil.setMnemonic(jmiCryptographyStrength, res.getString("KseFrame.jmiCryptographyStrength.mnemonic").charAt(0)); jmiCryptographyStrength.setToolTipText(null); new StatusBarChangeHandler(jmiCryptographyStrength, (String) cryptographyStrengthAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiCryptographyStrength); jmiJars = new JMenuItem(jarsAction); PlatformUtil.setMnemonic(jmiJars, res.getString("KseFrame.jmiJars.mnemonic").charAt(0)); jmiJars.setToolTipText(null); new StatusBarChangeHandler(jmiJars, (String) jarsAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiJars); jmiSystemInformation = new JMenuItem(systemInformationAction); PlatformUtil.setMnemonic(jmiSystemInformation, res.getString("KseFrame.jmiSystemInformation.mnemonic").charAt(0)); jmiSystemInformation.setToolTipText(null); new StatusBarChangeHandler(jmiSystemInformation, (String) systemInformationAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiSystemInformation); if (!OperatingSystem.isMacOs()) { jmHelp.addSeparator(); jmiAbout = new JMenuItem(aboutAction); PlatformUtil.setMnemonic(jmiAbout, res.getString("KseFrame.jmiAbout.mnemonic").charAt(0)); jmiAbout.setToolTipText(null); new StatusBarChangeHandler(jmiAbout, (String) aboutAction.getValue(Action.LONG_DESCRIPTION), this); jmHelp.add(jmiAbout); } jmbMenuBar.add(jmFile); jmbMenuBar.add(jmEdit); jmbMenuBar.add(jmView); jmbMenuBar.add(jmTools); jmbMenuBar.add(jmExamine); jmbMenuBar.add(jmHelp); jmbMenuBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH); frame.setJMenuBar(jmbMenuBar); }