X-Git-Url: https://git.pterodactylus.net/?p=jkeytool.git;a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjkeytool%2Fgui%2Fswing%2FKeyStorePanel.java;h=9367221e1f5c000805a1d8f6ba6215763e5b021e;hp=48ea691d8af9a780a3c665b10d4aed49c9c81efc;hb=caae8a8c82efbd16ae5a45ee352a761e445d5de5;hpb=b3362a471e12733c973779e7091db1a9e751220a diff --git a/src/net/pterodactylus/jkeytool/gui/swing/KeyStorePanel.java b/src/net/pterodactylus/jkeytool/gui/swing/KeyStorePanel.java index 48ea691..9367221 100644 --- a/src/net/pterodactylus/jkeytool/gui/swing/KeyStorePanel.java +++ b/src/net/pterodactylus/jkeytool/gui/swing/KeyStorePanel.java @@ -19,10 +19,17 @@ 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 @@ -31,6 +38,9 @@ import javax.swing.JPanel; */ public class KeyStorePanel extends JPanel { + /** The I18n container. */ + private final I18n i18n; + /** The displayed key store. */ private final KeyStore keyStore; @@ -38,13 +48,15 @@ public class KeyStorePanel extends JPanel { * 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(); } @@ -52,27 +64,23 @@ public class KeyStorePanel extends JPanel { // 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)); } }