package net.pterodactylus.jkeytool.gui.swing;
-import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
import java.security.KeyStore;
+import javax.swing.BorderFactory;
import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import net.pterodactylus.util.i18n.I18n;
+import net.pterodactylus.util.i18n.gui.I18nLabel;
/**
* TODO
*/
public class KeyStorePanel extends JPanel {
+ /** The I18n container. */
+ private final I18n i18n;
+
/** The displayed key store. */
private final KeyStore keyStore;
* Creates a new key store panel that displays and controls the given key
* store.
*
+ * @param i18n
+ * The I18n container
* @param keyStore
* The key store to display
*/
- public KeyStorePanel(KeyStore keyStore) {
- super(new BorderLayout());
+ public KeyStorePanel(I18n i18n, KeyStore keyStore) {
+ super(new GridBagLayout());
+ this.i18n = i18n;
this.keyStore = keyStore;
- constructActions();
constructPanel();
}
// PRIVATE ACTIONS
//
- /**
- * Executed by {@link #createKeyAction}.
- */
- private void createKey() {
- /* TODO */
- }
-
//
// PRIVATE METHODS
//
/**
- * Constructs all used actions.
- */
- private void constructActions() {
- }
-
- /**
* Constructs the main panel.
*/
private void constructPanel() {
+ setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
+ I18nLabel keyStoreTypeLabel = new I18nLabel(i18n, "jkeytool.keyStorePanel.keyStoreTypeLabel");
+ JTextField keyStoreTypeTextField = new JTextField(keyStore.getType());
+ keyStoreTypeTextField.setEditable(false);
+
+ i18n.registerI18nable(keyStoreTypeLabel);
+
+ add(keyStoreTypeLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
+ add(keyStoreTypeTextField, new GridBagConstraints(1, 0, 1, 1, 1.0, 1.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 12, 0, 0), 0, 0));
}
}