Search in sources :

Example 1 with JGeneralSubtrees

use of org.kse.gui.crypto.generalsubtree.JGeneralSubtrees in project keystore-explorer by kaikramer.

the class DNameConstraints method initComponents.

private void initComponents() {
    jlPermittedSubtrees = new JLabel(res.getString("DNameConstraints.jlPermittedSubtrees.text"));
    GridBagConstraints gbc_jlPermittedSubtrees = new GridBagConstraints();
    gbc_jlPermittedSubtrees.gridx = 0;
    gbc_jlPermittedSubtrees.gridy = 0;
    gbc_jlPermittedSubtrees.gridwidth = 1;
    gbc_jlPermittedSubtrees.gridheight = 1;
    gbc_jlPermittedSubtrees.insets = new Insets(5, 5, 5, 5);
    gbc_jlPermittedSubtrees.anchor = GridBagConstraints.NORTHEAST;
    jgsPermittedSubtrees = new JGeneralSubtrees(res.getString("DNameConstraints.PermittedSubtrees.Title"));
    jgsPermittedSubtrees.setToolTipText(res.getString("DNameConstraints.jgsPermittedSubtrees.tooltip"));
    GridBagConstraints gbc_jgsPermittedSubtrees = new GridBagConstraints();
    gbc_jgsPermittedSubtrees.gridx = 1;
    gbc_jgsPermittedSubtrees.gridy = 0;
    gbc_jgsPermittedSubtrees.gridwidth = 1;
    gbc_jgsPermittedSubtrees.gridheight = 1;
    gbc_jgsPermittedSubtrees.insets = new Insets(5, 5, 5, 5);
    gbc_jgsPermittedSubtrees.anchor = GridBagConstraints.WEST;
    jlExcludedSubtrees = new JLabel(res.getString("DNameConstraints.jlExcludedSubtrees.text"));
    GridBagConstraints gbc_jlExcludedSubtrees = new GridBagConstraints();
    gbc_jlExcludedSubtrees.gridx = 0;
    gbc_jlExcludedSubtrees.gridy = 1;
    gbc_jlExcludedSubtrees.gridwidth = 1;
    gbc_jlExcludedSubtrees.gridheight = 1;
    gbc_jlExcludedSubtrees.insets = new Insets(5, 5, 5, 5);
    gbc_jlExcludedSubtrees.anchor = GridBagConstraints.NORTHEAST;
    jgsExcludedSubtrees = new JGeneralSubtrees(res.getString("DNameConstraints.ExcludedSubtrees.Title"));
    jgsExcludedSubtrees.setToolTipText(res.getString("DNameConstraints.jgsExcludedSubtrees.tooltip"));
    GridBagConstraints gbc_jgsExcludedSubtrees = new GridBagConstraints();
    gbc_jgsExcludedSubtrees.gridx = 1;
    gbc_jgsExcludedSubtrees.gridy = 1;
    gbc_jgsExcludedSubtrees.gridwidth = 1;
    gbc_jgsExcludedSubtrees.gridheight = 1;
    gbc_jgsExcludedSubtrees.insets = new Insets(5, 5, 5, 5);
    gbc_jgsExcludedSubtrees.anchor = GridBagConstraints.WEST;
    jpNameConstraints = new JPanel(new GridBagLayout());
    jpNameConstraints.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
    jpNameConstraints.add(jlPermittedSubtrees, gbc_jlPermittedSubtrees);
    jpNameConstraints.add(jgsPermittedSubtrees, gbc_jgsPermittedSubtrees);
    jpNameConstraints.add(jlExcludedSubtrees, gbc_jlExcludedSubtrees);
    jpNameConstraints.add(jgsExcludedSubtrees, gbc_jgsExcludedSubtrees);
    jbOK = new JButton(res.getString("DNameConstraints.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DNameConstraints.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(jpNameConstraints, 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) JGeneralSubtrees(org.kse.gui.crypto.generalsubtree.JGeneralSubtrees) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) WindowEvent(java.awt.event.WindowEvent) 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 JGeneralSubtrees (org.kse.gui.crypto.generalsubtree.JGeneralSubtrees)1