Search in sources :

Example 1 with JGeneralName

use of org.kse.gui.crypto.generalname.JGeneralName in project keystore-explorer by kaikramer.

the class DGeneralSubtreeChooser method initComponents.

private void initComponents(GeneralSubtree generalSubtree) {
    jlBase = new JLabel(res.getString("DGeneralSubtreeChooser.jlBase.text"));
    GridBagConstraints gbc_jlBase = new GridBagConstraints();
    gbc_jlBase.gridx = 0;
    gbc_jlBase.gridy = 0;
    gbc_jlBase.gridwidth = 1;
    gbc_jlBase.gridheight = 1;
    gbc_jlBase.insets = new Insets(5, 5, 0, 5);
    gbc_jlBase.anchor = GridBagConstraints.EAST;
    jgnBase = new JGeneralName(res.getString("DGeneralSubtreeChooser.Base.Title"));
    jgnBase.setToolTipText(res.getString("DGeneralSubtreeChooser.jgnBase.tooltip"));
    GridBagConstraints gbc_jgnBase = new GridBagConstraints();
    gbc_jgnBase.gridx = 1;
    gbc_jgnBase.gridy = 0;
    gbc_jgnBase.gridwidth = 1;
    gbc_jgnBase.gridheight = 1;
    gbc_jgnBase.insets = new Insets(5, 5, 0, 5);
    gbc_jgnBase.anchor = GridBagConstraints.WEST;
    jlMinimum = new JLabel(res.getString("DGeneralSubtreeChooser.jlMinimum.text"));
    GridBagConstraints gbc_jlMinimum = new GridBagConstraints();
    gbc_jlMinimum.gridx = 0;
    gbc_jlMinimum.gridy = 1;
    gbc_jlMinimum.gridwidth = 1;
    gbc_jlMinimum.gridheight = 1;
    gbc_jlMinimum.insets = new Insets(5, 5, 5, 5);
    gbc_jlMinimum.anchor = GridBagConstraints.EAST;
    jtfMinimum = new JTextField(3);
    jtfMinimum.setToolTipText(res.getString("DGeneralSubtreeChooser.jtfMinimum.tooltip"));
    GridBagConstraints gbc_jtfMinimum = new GridBagConstraints();
    gbc_jtfMinimum.gridx = 1;
    gbc_jtfMinimum.gridy = 1;
    gbc_jtfMinimum.gridwidth = 1;
    gbc_jtfMinimum.gridheight = 1;
    gbc_jtfMinimum.insets = new Insets(5, 5, 5, 5);
    gbc_jtfMinimum.anchor = GridBagConstraints.WEST;
    jlMaximum = new JLabel(res.getString("DGeneralSubtreeChooser.jlMaximum.text"));
    GridBagConstraints gbc_jlMaximum = new GridBagConstraints();
    gbc_jlMaximum.gridx = 0;
    gbc_jlMaximum.gridy = 2;
    gbc_jlMaximum.gridwidth = 1;
    gbc_jlMaximum.gridheight = 1;
    gbc_jlMaximum.insets = new Insets(5, 5, 5, 5);
    gbc_jlMaximum.anchor = GridBagConstraints.EAST;
    jtfMaximum = new JTextField(3);
    jtfMaximum.setToolTipText(res.getString("DGeneralSubtreeChooser.jtfMaximum.tooltip"));
    GridBagConstraints gbc_jtfMaximum = new GridBagConstraints();
    gbc_jtfMaximum.gridx = 1;
    gbc_jtfMaximum.gridy = 2;
    gbc_jtfMaximum.gridwidth = 1;
    gbc_jtfMaximum.gridheight = 1;
    gbc_jtfMaximum.insets = new Insets(5, 5, 5, 5);
    gbc_jtfMaximum.anchor = GridBagConstraints.WEST;
    jpGeneralSubtree = new JPanel(new GridBagLayout());
    jpGeneralSubtree.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
    jpGeneralSubtree.add(jlBase, gbc_jlBase);
    jpGeneralSubtree.add(jgnBase, gbc_jgnBase);
    jpGeneralSubtree.add(jlMinimum, gbc_jlMinimum);
    jpGeneralSubtree.add(jtfMinimum, gbc_jtfMinimum);
    jpGeneralSubtree.add(jlMaximum, gbc_jlMaximum);
    jpGeneralSubtree.add(jtfMaximum, gbc_jtfMaximum);
    jbOK = new JButton(res.getString("DGeneralSubtreeChooser.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DGeneralSubtreeChooser.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(BorderLayout.CENTER, jpGeneralSubtree);
    getContentPane().add(BorderLayout.SOUTH, jpButtons);
    populate(generalSubtree);
    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) JGeneralName(org.kse.gui.crypto.generalname.JGeneralName) JTextField(javax.swing.JTextField) EtchedBorder(javax.swing.border.EtchedBorder) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction)

Example 2 with JGeneralName

use of org.kse.gui.crypto.generalname.JGeneralName in project keystore-explorer by kaikramer.

the class DAccessDescriptionChooser method initComponents.

private void initComponents(AccessDescription accessDescription) {
    jlAccessMethod = new JLabel(res.getString("DAccessDescriptionChooser.jlAccessMethod.text"));
    GridBagConstraints gbc_jlAccessMethod = new GridBagConstraints();
    gbc_jlAccessMethod.gridx = 0;
    gbc_jlAccessMethod.gridy = 0;
    gbc_jlAccessMethod.gridwidth = 1;
    gbc_jlAccessMethod.gridheight = 1;
    gbc_jlAccessMethod.insets = new Insets(5, 5, 5, 5);
    gbc_jlAccessMethod.anchor = GridBagConstraints.EAST;
    joiAccessMethod = new JObjectId(res.getString("DAccessDescriptionChooser.AccessMethod.Text"));
    joiAccessMethod.setToolTipText(res.getString("DAccessDescriptionChooser.joiAccessMethod.tooltip"));
    GridBagConstraints gbc_joiAccessMethod = new GridBagConstraints();
    gbc_joiAccessMethod.gridx = 1;
    gbc_joiAccessMethod.gridy = 0;
    gbc_joiAccessMethod.gridwidth = 1;
    gbc_joiAccessMethod.gridheight = 1;
    gbc_joiAccessMethod.insets = new Insets(5, 5, 5, 5);
    gbc_joiAccessMethod.anchor = GridBagConstraints.WEST;
    jlAccessLocation = new JLabel(res.getString("DAccessDescriptionChooser.jlAccessLocation.text"));
    GridBagConstraints gbc_jlAccessLocation = new GridBagConstraints();
    gbc_jlAccessLocation.gridx = 0;
    gbc_jlAccessLocation.gridy = 1;
    gbc_jlAccessLocation.gridwidth = 1;
    gbc_jlAccessLocation.gridheight = 1;
    gbc_jlAccessLocation.insets = new Insets(5, 5, 5, 5);
    gbc_jlAccessLocation.anchor = GridBagConstraints.EAST;
    jgnAccessLocation = new JGeneralName(res.getString("DAccessDescriptionChooser.AccessLocation.Title"));
    jgnAccessLocation.setToolTipText(res.getString("DAccessDescriptionChooser.jgnAccessLocation.tooltip"));
    GridBagConstraints gbc_jgnAccessLocation = new GridBagConstraints();
    gbc_jgnAccessLocation.gridx = 1;
    gbc_jgnAccessLocation.gridy = 1;
    gbc_jgnAccessLocation.gridwidth = 1;
    gbc_jgnAccessLocation.gridheight = 1;
    gbc_jgnAccessLocation.insets = new Insets(5, 5, 5, 5);
    gbc_jgnAccessLocation.anchor = GridBagConstraints.WEST;
    jpAccessDescription = new JPanel(new GridBagLayout());
    jpAccessDescription.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
    jpAccessDescription.add(jlAccessMethod, gbc_jlAccessMethod);
    jpAccessDescription.add(joiAccessMethod, gbc_joiAccessMethod);
    jpAccessDescription.add(jlAccessLocation, gbc_jlAccessLocation);
    jpAccessDescription.add(jgnAccessLocation, gbc_jgnAccessLocation);
    jbOK = new JButton(res.getString("DAccessDescriptionChooser.jbOK.text"));
    jbOK.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });
    jbCancel = new JButton(res.getString("DAccessDescriptionChooser.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(BorderLayout.CENTER, jpAccessDescription);
    getContentPane().add(BorderLayout.SOUTH, jpButtons);
    populate(accessDescription);
    setResizable(false);
    getRootPane().setDefaultButton(jbOK);
    pack();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) JObjectId(org.kse.gui.oid.JObjectId) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JGeneralName(org.kse.gui.crypto.generalname.JGeneralName) EtchedBorder(javax.swing.border.EtchedBorder) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) AbstractAction(javax.swing.AbstractAction)

Aggregations

BorderLayout (java.awt.BorderLayout)2 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 Insets (java.awt.Insets)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 AbstractAction (javax.swing.AbstractAction)2 JButton (javax.swing.JButton)2 JLabel (javax.swing.JLabel)2 JPanel (javax.swing.JPanel)2 CompoundBorder (javax.swing.border.CompoundBorder)2 EmptyBorder (javax.swing.border.EmptyBorder)2 EtchedBorder (javax.swing.border.EtchedBorder)2 JGeneralName (org.kse.gui.crypto.generalname.JGeneralName)2 JTextField (javax.swing.JTextField)1 JObjectId (org.kse.gui.oid.JObjectId)1