📄 certificatedialog.java
字号:
/*** $Id: CertificateDialog.java,v 1.3 2001/05/07 12:37:22 kunugi Exp $**** Copyright (c) 2000-2001 Jeff Gay** on behalf of ICEMail.org <http://www.icemail.org>** Copyright (c) 1998-2000 by Timothy Gerard Endres** ** This program is free software.** ** You may redistribute it and/or modify it under the terms of the GNU** General Public License as published by the Free Software Foundation.** Version 2 of the license should be included with this distribution in** the file LICENSE, as well as License.html. If the license is not** included with this distribution, you may find a copy at the FSF web** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the** Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.**** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR** REDISTRIBUTION OF THIS SOFTWARE. */package org.icemail.mail.smime;import java.awt.*;import java.awt.event.*;import java.net.InetAddress;import javax.swing.*;import javax.swing.border.*;import javax.swing.tree.*;import javax.mail.*;import iaik.asn1.ObjectID;import iaik.asn1.structures.Name;import iaik.x509.X509Certificate;import org.icemail.util.AWTUtilities;public class CertificateDialog extends JDialog implements ActionListener{ private JSplitPane split; private X509Certificate[] certChain; private CertificateTreePanel certPanel; private CertificateInfoPanel infoPanel; public CertificateDialog( Frame parent, String title, X509Certificate[] certChain, boolean showImportPanel ) { super( parent, title, true ); this.certChain = certChain; this.establishContents( certChain, showImportPanel ); this.pack(); Dimension sz = this.getSize(); if ( sz.width < 580 ) sz.width = 580; if ( sz.height < 360 ) sz.height = 360; this.setSize( sz ); this.split.setDividerLocation( 0.25 ); this.addWindowListener( new WindowAdapter() { public void windowActivated( WindowEvent e ) { certPanel.expandAllNodes(); } } ); } public void actionPerformed( ActionEvent event ) { String command = event.getActionCommand(); if ( command.equals( "DISMISS" ) ) { this.dispose(); } } protected void establishContents( X509Certificate[] certChain, boolean showImportPanel ) { int row = 0; JLabel lbl = null; Container contentPane = this.getContentPane(); contentPane.setLayout( new BorderLayout() ); this.infoPanel = new CertificateInfoPanel( certChain, showImportPanel ); this.certPanel = new CertificateTreePanel( certChain, infoPanel ); this.split = new JSplitPane( JSplitPane.VERTICAL_SPLIT, certPanel, infoPanel ); JPanel ctlPan = new JPanel(); ctlPan.setLayout( new BorderLayout() ); JPanel btnPanel = new JPanel(); btnPanel.setLayout( new GridLayout( 1, 2, 25, 7 ) ); btnPanel.setBorder( new EmptyBorder( 8, 5, 5, 5 ) ); JButton canBtn = new JButton( "Dismiss" ); canBtn.setActionCommand( "DISMISS" ); canBtn.addActionListener( this ); btnPanel.add( canBtn ); ctlPan.add( BorderLayout.EAST, btnPanel ); contentPane.add( BorderLayout.CENTER, split ); contentPane.add( BorderLayout.SOUTH, ctlPan ); } private class NoFocusLabel extends JLabel { public NoFocusLabel( String text ) { super( text ); } public boolean isFocusTraversable() { return false; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -