+ /** The main frame. */
+ private JFrame mainFrame = new JFrame("jkeytool " + Main.getVersion());
+
+ /** The tab pane. */
+ private JTabbedPane tabPane = new JTabbedPane();
+
+ /** The status bar. */
+ private StatusBar statusBar = new StatusBar();
+
+ /** The “create key store” action. */
+ private Action createKeyStoreAction;
+
+ /** The “quit” action. */
+ private Action quitAction;
+
+ /** Loaded key stores and their panels. */
+ private final Map<KeyStore, KeyStorePanel> keyStores = new HashMap<KeyStore, KeyStorePanel>();
+
+ public SwingInterface() {
+ createActions();
+ createFrame();
+ }
+
+ //
+ // ACTIONS
+ //
+
+ private void createKeyStore() {
+ }
+
+ private void quit() {
+ System.exit(0);
+ }
+
+ //
+ // PRIVATE METHODS
+ //
+
+ private void createActions() {
+ createKeyStoreAction = new I18nAction("jkeytool.action.createKeyStore") {
+
+ @SuppressWarnings("synthetic-access")
+ public void actionPerformed(ActionEvent actionEvent) {
+ createKeyStore();
+ }
+ };
+ quitAction = new I18nAction("jkeytool.action.quit") {
+
+ /**
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @SuppressWarnings("synthetic-access")
+ public void actionPerformed(ActionEvent actionEvent) {
+ quit();
+ }
+ };
+ }
+
+ private void createFrame() {
+ mainFrame.setJMenuBar(createMenubar());
+ mainFrame.getContentPane().add(createCenterPanel(), BorderLayout.CENTER);
+ mainFrame.getContentPane().add(statusBar, BorderLayout.PAGE_END);
+ mainFrame.pack();
+ }
+
+ private JComponent createCenterPanel() {
+ JPanel centerPanel = new JPanel(new BorderLayout());
+ centerPanel.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
+
+ centerPanel.add(tabPane, BorderLayout.CENTER);
+
+ return centerPanel;
+ }
+
+ private JMenuBar createMenubar() {
+ JMenuBar menubar = new JMenuBar();
+
+ JMenu fileMenu = new I18nMenu("jkeytool.menu.file");
+ menubar.add(fileMenu);
+ fileMenu.add(createKeyStoreAction);
+ fileMenu.addSeparator();
+ fileMenu.add(quitAction);
+
+ return menubar;
+ }
+