X-Git-Url: https://git.pterodactylus.net/?p=jkeytool.git;a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjkeytool%2Fgui%2FListKeyStorePanel.java;fp=src%2Fnet%2Fpterodactylus%2Fjkeytool%2Fgui%2FListKeyStorePanel.java;h=0000000000000000000000000000000000000000;hp=d935b0191055b328212a2687dd6a0e19f2d064d2;hb=890be90f28fe14e240f86a14a1660cb526f14db1;hpb=f5562e6160082ea771d5cf4cfe28e7e2f4077a33 diff --git a/src/net/pterodactylus/jkeytool/gui/ListKeyStorePanel.java b/src/net/pterodactylus/jkeytool/gui/ListKeyStorePanel.java deleted file mode 100644 index d935b01..0000000 --- a/src/net/pterodactylus/jkeytool/gui/ListKeyStorePanel.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * jkeytool - ListKeyStorePanel.java - - * Copyright © 2009 David Roden - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -package net.pterodactylus.jkeytool.gui; - -import java.awt.BorderLayout; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.util.Collections; - -import javax.swing.DefaultListModel; -import javax.swing.JList; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -/** - * TODO - * - * @author David Roden <droden@gmail.com> - */ -public class ListKeyStorePanel extends AbstractKeyStorePanel implements ListSelectionListener { - - /** The list model containing all aliases. */ - private final DefaultListModel listModel = new DefaultListModel(); - - /** The list. */ - private final JList entryList = new JList(listModel); - - /** - * Creates a new key store panel that displays all entry aliases in a list. - * - * @param keyStore - * The key store to display - */ - public ListKeyStorePanel(KeyStore keyStore) { - super(keyStore); - try { - for (String alias : Collections.list(keyStore.aliases())) { - listModel.addElement(alias); - } - } catch (KeyStoreException kse1) { - kse1.printStackTrace(); - } - construct(); - entryList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - entryList.addListSelectionListener(this); - } - - /** - * {@inheritDoc} - */ - @Override - protected void createEntryPanel() { - add(entryList, BorderLayout.WEST); - } - - // - // INTERFACE ListSelectionListener - // - - /** - * {@inheritDoc} - */ - public void valueChanged(ListSelectionEvent listSelectionEvent) { - if (listSelectionEvent.getValueIsAdjusting()) { - return; - } - Object object = entryList.getSelectedValue(); - selectedEntry((String) object); - } - -}