import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
+import java.beans.PropertyVetoException;
import java.io.File;
import java.security.KeyStore;
import javax.swing.AbstractAction;
import javax.swing.Action;
+import javax.swing.JDesktopPane;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
/** The main frame. */
private final JFrame mainFrame;
+ /** The main frame’s desktop. */
+ private final JDesktopPane desktop;
+
/** The jkeytool core. */
private final Core core;
constructActions();
mainFrame.setJMenuBar(constructMenuBar());
mainFrame.addWindowListener(this);
+ desktop = new JDesktopPane();
+ mainFrame.setContentPane(desktop);
mainFrame.pack();
}
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
//
* {@inheritDoc}
*/
public void keyStoreCreated(KeyStore keyStore) {
- /* TODO */
+ constructKeyStoreWindow(keyStore);
}
/**
* {@inheritDoc}
*/
public void keyStoreLoaded(File keyStoreFile, KeyStore keyStore) {
- /* TODO - create keystore frame. */
+ constructKeyStoreWindow(keyStore);
}
/**