public SshToolsConnectionProtocolTab() {
super();
// Keys
JPanel keysPanel = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.NONE;
gbc.anchor = GridBagConstraints.WEST;
gbc.insets = new Insets(2, 2, 2, 2);
gbc.weightx = 1.0;
// Public key
UIUtil.jGridBagAdd(keysPanel, new JLabel("Public key"), gbc,
GridBagConstraints.REMAINDER);
gbc.fill = GridBagConstraints.HORIZONTAL;
UIUtil.jGridBagAdd(keysPanel, jComboPK, gbc,
GridBagConstraints.REMAINDER);
gbc.fill = GridBagConstraints.NONE;
// Public key
UIUtil.jGridBagAdd(keysPanel, new JLabel("Key exchange"), gbc,
GridBagConstraints.REMAINDER);
gbc.fill = GridBagConstraints.HORIZONTAL;
UIUtil.jGridBagAdd(keysPanel, jComboKex, gbc,
GridBagConstraints.REMAINDER);
gbc.fill = GridBagConstraints.NONE;
//
IconWrapperPanel iconKeysPanel = new IconWrapperPanel(new ResourceIcon(
KEYS_ICON), keysPanel);
// Preferences
JPanel prefPanel = new JPanel(new GridBagLayout());
prefPanel.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0));
gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.NONE;
gbc.anchor = GridBagConstraints.WEST;
gbc.insets = new Insets(2, 2, 2, 2);
gbc.weightx = 1.0;
// Public key
gbc.fill = GridBagConstraints.HORIZONTAL;
UIUtil.jGridBagAdd(prefPanel, new JLabel("Client - > Server"), gbc,
GridBagConstraints.RELATIVE);
UIUtil.jGridBagAdd(prefPanel, new JLabel("Server - > Client"), gbc,
GridBagConstraints.REMAINDER);
// Separator
gbc.weightx = 2.0;
UIUtil.jGridBagAdd(prefPanel, new JSeparator(JSeparator.HORIZONTAL),
gbc, GridBagConstraints.REMAINDER);
// Cipher
UIUtil.jGridBagAdd(prefPanel, new JLabel("Cipher"), gbc,
GridBagConstraints.RELATIVE);
UIUtil.jGridBagAdd(prefPanel, new JLabel("Cipher"), gbc,
GridBagConstraints.REMAINDER);
UIUtil.jGridBagAdd(prefPanel, jComboCipherCS, gbc,
GridBagConstraints.RELATIVE);
UIUtil.jGridBagAdd(prefPanel, jComboCipherSC, gbc,
GridBagConstraints.REMAINDER);
// Mac
UIUtil.jGridBagAdd(prefPanel, new JLabel("Mac"), gbc,
GridBagConstraints.RELATIVE);
UIUtil.jGridBagAdd(prefPanel, new JLabel("Mac"), gbc,
GridBagConstraints.REMAINDER);
UIUtil.jGridBagAdd(prefPanel, jComboMacCS, gbc,
GridBagConstraints.RELATIVE);
UIUtil.jGridBagAdd(prefPanel, jComboMacSC, gbc,
GridBagConstraints.REMAINDER);
// Compression
UIUtil.jGridBagAdd(prefPanel, new JLabel("Compression"), gbc,
GridBagConstraints.RELATIVE);
UIUtil.jGridBagAdd(prefPanel, new JLabel("Compression"), gbc,
GridBagConstraints.REMAINDER);
UIUtil.jGridBagAdd(prefPanel, jComboCompCS, gbc,
GridBagConstraints.RELATIVE);
UIUtil.jGridBagAdd(prefPanel, jComboCompSC, gbc,
GridBagConstraints.REMAINDER);
//
IconWrapperPanel iconPrefPanel = new IconWrapperPanel(new ResourceIcon(
PROTOCOL_ICON), prefPanel);
// This tab
setLayout(new GridBagLayout());
setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.NONE;
gbc.anchor = GridBagConstraints.WEST;
gbc.insets = new Insets(2, 2, 2, 2);
gbc.weightx = 1.0;
UIUtil.jGridBagAdd(this, iconKeysPanel, gbc,
GridBagConstraints.REMAINDER);
gbc.weighty = 1.0;
UIUtil.jGridBagAdd(this, iconPrefPanel, gbc,
GridBagConstraints.REMAINDER);
//
loadList(SshCipherFactory.getSupportedCiphers(), jComboCipherCS, true);
loadList(SshCipherFactory.getSupportedCiphers(), jComboCipherSC, true);
loadList(SshHmacFactory.getSupportedMacs(), jComboMacCS, true);
loadList(SshHmacFactory.getSupportedMacs(), jComboMacSC, true);
loadList(SshCompressionFactory.getSupportedCompression(), jComboCompCS,
true);
loadList(SshCompressionFactory.getSupportedCompression(), jComboCompSC,
true);
loadList(SshKeyExchangeFactory.getSupportedKeyExchanges(), jComboKex,
true);
loadList(SshKeyPairFactory.getSupportedKeys(), jComboPK, true);
}