Search in sources :

Example 1 with JPolicyMappings

use of org.kse.gui.crypto.policymapping.JPolicyMappings in project keystore-explorer by kaikramer.

the class DPolicyMappings method initComponents.

private void initComponents() {
    jlPolicyMappings = new JLabel(res.getString("DPolicyMappings.jlPolicyMappings.text"));
    GridBagConstraints gbc_jlPolicyMappings = new GridBagConstraints();
    gbc_jlPolicyMappings.gridx = 0;
    gbc_jlPolicyMappings.gridy = 0;
    gbc_jlPolicyMappings.gridwidth = 1;
    gbc_jlPolicyMappings.gridheight = 1;
    gbc_jlPolicyMappings.insets = new Insets(5, 5, 5, 5);
    gbc_jlPolicyMappings.anchor = GridBagConstraints.NORTHEAST;
    jpmPolicyMappings = new JPolicyMappings(res.getString("DPolicyMappings.PolicyMapping.Title"));
    GridBagConstraints gbc_jadPolicyMappings = new GridBagConstraints();
    gbc_jadPolicyMappings.gridx = 1;
    gbc_jadPolicyMappings.gridy = 0;
    gbc_jadPolicyMappings.gridwidth = 1;
    gbc_jadPolicyMappings.gridheight = 1;
    gbc_jadPolicyMappings.insets = new Insets(5, 5, 5, 5);
    gbc_jadPolicyMappings.anchor = GridBagConstraints.WEST;
    jpPolicyMappings = new JPanel(new GridBagLayout());
    jpPolicyMappings.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
    jpPolicyMappings.add(jlPolicyMappings, gbc_jlPolicyMappings);
    jpPolicyMappings.add(jpmPolicyMappings, gbc_jadPolicyMappings);
    jbOK = new JButton(res.getString("DPolicyMappings.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DPolicyMappings.jbCancel.text"));
    jbCancel.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            cancelPressed();
        }
    });
    jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY);
    jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() {

        private static final long serialVersionUID = 1L;

        @Override
        public void actionPerformed(ActionEvent evt) {
            cancelPressed();
        }
    });
    jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, jbCancel, false);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(jpPolicyMappings, BorderLayout.CENTER);
    getContentPane().add(jpButtons, BorderLayout.SOUTH);
    addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent evt) {
            closeDialog();
        }
    });
    setResizable(false);
    getRootPane().setDefaultButton(jbOK);
    pack();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) WindowAdapter(java.awt.event.WindowAdapter) EtchedBorder(javax.swing.border.EtchedBorder) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) WindowEvent(java.awt.event.WindowEvent) JPolicyMappings(org.kse.gui.crypto.policymapping.JPolicyMappings) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction)

Aggregations

BorderLayout (java.awt.BorderLayout)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 AbstractAction (javax.swing.AbstractAction)1 JButton (javax.swing.JButton)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 CompoundBorder (javax.swing.border.CompoundBorder)1 EmptyBorder (javax.swing.border.EmptyBorder)1 EtchedBorder (javax.swing.border.EtchedBorder)1 JPolicyMappings (org.kse.gui.crypto.policymapping.JPolicyMappings)1