+ * Creates the “Key Store” menu.
+ *
+ * @return The “Key Store” menu
+ */
+ private JMenu constructKeystoreMenu() {
+ JMenu keystoreMenu = new JMenu("Key Store");
+
+ keystoreMenu.add(constructNewKeystoreTypeMenu());
+ keystoreMenu.add(openKeystoreAction);
+
+ return keystoreMenu;
+ }
+
+ /**
+ * Creates a new menu containing all the types for new key stores.
+ *
+ * @return A menu containing all new key store types
+ */
+ private JMenu constructNewKeystoreTypeMenu() {
+ JMenu keystoreTypeMenu = new JMenu("New Key Store");
+ keystoreTypeMenu.setMnemonic(KeyEvent.VK_N);
+
+ for (final String keystoreType : new String[] { "JKS", "PKCS12" }) {
+ Action keystoreTypeAction = new AbstractAction(keystoreType) {
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("synthetic-access")
+ public void actionPerformed(ActionEvent actionEvent) {
+ actionNewKeystore(keystoreType);
+ }
+ };
+ keystoreTypeMenu.add(keystoreTypeAction);
+ }
+
+ return keystoreTypeMenu;
+ }
+
+ private void constructKeyStoreWindow(KeyStore keyStore) {
+ JInternalFrame internalFrame = new JInternalFrame("Key Store (" + keyStore.getType() + ")", true, true, true, true);
+ internalFrame.getContentPane().add(new ListKeyStorePanel(keyStore));
+ internalFrame.setBounds(10, 10, 200, 200);
+ desktop.add(internalFrame);
+ internalFrame.setVisible(true);
+ try {
+ internalFrame.setSelected(true);
+ } catch (PropertyVetoException pve1) {
+ pve1.printStackTrace();
+ }
+ }
+
+ //
+ // PRIVATE ACTIONS
+ //
+
+ /**
+ * Quits the program.
+ */
+ private void actionFileQuit() {
+ /* TODO - ask for confirmation. */
+ System.exit(0);
+ }
+
+ /**