package net.pterodactylus.jkeytool.gui.swing;
import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
import java.security.KeyStore;
-import javax.swing.AbstractAction;
-import javax.swing.Action;
import javax.swing.JPanel;
-import javax.swing.JToolBar;
-
-import net.pterodactylus.util.swing.StatusBar;
/**
* TODO
/** The displayed key store. */
private final KeyStore keyStore;
- /** The tool bar. */
- private final JToolBar toolBar = new JToolBar();
-
- /** The status bar. */
- private final StatusBar statusBar = new StatusBar();
-
- /** The action to create a new key. */
- private Action createKeyAction;
-
/**
* Creates a new key store panel that displays and controls the given key
* store.
public KeyStorePanel(KeyStore keyStore) {
super(new BorderLayout());
this.keyStore = keyStore;
- constructActions();
constructPanel();
- statusBar.setText(keyStore.getType() + " Key Store");
}
//
// PRIVATE ACTIONS
//
- /**
- * Executed by {@link #createKeyAction}.
- */
- private void createKey() {
- /* TODO */
- }
-
//
// PRIVATE METHODS
//
/**
- * Constructs all used actions.
- */
- private void constructActions() {
- createKeyAction = new AbstractAction("Create Key") {
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("synthetic-access")
- public void actionPerformed(ActionEvent actionEvent) {
- createKey();
- }
- };
- }
-
- /**
* Constructs the main panel.
*/
private void constructPanel() {
- toolBar.add(createKeyAction);
-
- add(toolBar, BorderLayout.PAGE_START);
- add(statusBar, BorderLayout.PAGE_END);
}
}