use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DAddExtensions method initComponents.
private void initComponents() {
jbAdd = new JButton(new ImageIcon(Toolkit.getDefaultToolkit().createImage(getClass().getResource(res.getString("DAddExtensions.jbAdd.image")))));
jbAdd.setMargin(new Insets(2, 2, 0, 0));
jbAdd.setToolTipText(res.getString("DAddExtensions.jbAdd.tooltip"));
jbAdd.setMnemonic(res.getString("DAddExtensions.jbAdd.mnemonic").charAt(0));
jbAdd.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
addPressed();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
});
jbEdit = new JButton(new ImageIcon(Toolkit.getDefaultToolkit().createImage(getClass().getResource(res.getString("DAddExtensions.jbEdit.image")))));
jbEdit.setMargin(new Insets(2, 2, 0, 0));
jbEdit.setToolTipText(res.getString("DAddExtensions.jbEdit.tooltip"));
jbEdit.setMnemonic(res.getString("DAddExtensions.jbEdit.mnemonic").charAt(0));
jbEdit.setEnabled(false);
jbEdit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
editPressed();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
});
jbToggleCriticality = new JButton(new ImageIcon(Toolkit.getDefaultToolkit().createImage(getClass().getResource(res.getString("DAddExtensions.jbToggleCriticality.image")))));
jbToggleCriticality.setMargin(new Insets(2, 2, 0, 0));
jbToggleCriticality.setToolTipText(res.getString("DAddExtensions.jbToggleCriticality.tooltip"));
jbToggleCriticality.setMnemonic(res.getString("DAddExtensions.jbToggleCriticality.mnemonic").charAt(0));
jbToggleCriticality.setEnabled(false);
jbToggleCriticality.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
toggleCriticalityPressed();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
});
jbRemove = new JButton(new ImageIcon(Toolkit.getDefaultToolkit().createImage(getClass().getResource(res.getString("DAddExtensions.jbRemove.image")))));
jbRemove.setMargin(new Insets(2, 2, 0, 0));
jbRemove.setToolTipText(res.getString("DAddExtensions.jbRemove.tooltip"));
jbRemove.setMnemonic(res.getString("DAddExtensions.jbRemove.mnemonic").charAt(0));
jbRemove.setEnabled(false);
jbRemove.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
removePressed();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
});
jpExtensionButtons = new JPanel();
jpExtensionButtons.setLayout(new BoxLayout(jpExtensionButtons, BoxLayout.Y_AXIS));
jpExtensionButtons.add(Box.createVerticalGlue());
jpExtensionButtons.add(jbAdd);
jpExtensionButtons.add(Box.createVerticalStrut(3));
jpExtensionButtons.add(jbEdit);
jpExtensionButtons.add(Box.createVerticalStrut(3));
jpExtensionButtons.add(jbToggleCriticality);
jpExtensionButtons.add(Box.createVerticalStrut(3));
jpExtensionButtons.add(jbRemove);
jpExtensionButtons.add(Box.createVerticalGlue());
ExtensionsTableModel extensionsTableModel = new ExtensionsTableModel();
jtExtensions = new JKseTable(extensionsTableModel);
TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(extensionsTableModel);
sorter.setComparator(2, new ObjectIdComparator());
jtExtensions.setRowSorter(sorter);
jtExtensions.setShowGrid(false);
jtExtensions.setRowMargin(0);
jtExtensions.getColumnModel().setColumnMargin(0);
jtExtensions.getTableHeader().setReorderingAllowed(false);
jtExtensions.setAutoResizeMode(JKseTable.AUTO_RESIZE_ALL_COLUMNS);
jtExtensions.setRowHeight(Math.max(18, jtExtensions.getRowHeight()));
for (int i = 0; i < jtExtensions.getColumnCount(); i++) {
TableColumn column = jtExtensions.getColumnModel().getColumn(i);
column.setHeaderRenderer(new ExtensionsTableHeadRend(jtExtensions.getTableHeader().getDefaultRenderer()));
column.setCellRenderer(new ExtensionsTableCellRend());
}
TableColumn criticalCol = jtExtensions.getColumnModel().getColumn(0);
criticalCol.setResizable(false);
criticalCol.setMinWidth(28);
criticalCol.setMaxWidth(28);
criticalCol.setPreferredWidth(28);
ListSelectionModel selectionModel = jtExtensions.getSelectionModel();
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
selectionModel.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent evt) {
if (!evt.getValueIsAdjusting()) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
updateButtonControls();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
}
});
jtExtensions.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent evt) {
maybeEditExtension(evt);
}
});
jtExtensions.addKeyListener(new KeyAdapter() {
boolean deleteLastPressed = false;
@Override
public void keyPressed(KeyEvent evt) {
// Record delete pressed on non-Macs
if (!OperatingSystem.isMacOs()) {
deleteLastPressed = evt.getKeyCode() == KeyEvent.VK_DELETE;
}
}
@Override
public void keyReleased(KeyEvent evt) {
// Delete on non-Mac if delete was pressed and is now released
if (!OperatingSystem.isMacOs() && deleteLastPressed && evt.getKeyCode() == KeyEvent.VK_DELETE) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
deleteLastPressed = false;
removeSelectedExtension();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
}
@Override
public void keyTyped(KeyEvent evt) {
// Delete on Mac if back space typed
if (OperatingSystem.isMacOs() && evt.getKeyChar() == 0x08) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
removeSelectedExtension();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
}
});
jspExtensionsTable = PlatformUtil.createScrollPane(jtExtensions, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jspExtensionsTable.getViewport().setBackground(jtExtensions.getBackground());
jbLoadTemplate = new JButton(res.getString("DAddExtensions.jbLoadTemplate.text"));
jbLoadTemplate.setMnemonic(res.getString("DAddExtensions.jbLoadTemplate.mnemonic").charAt(0));
jbLoadTemplate.setToolTipText(res.getString("DAddExtensions.jbLoadTemplate.tooltip"));
jbLoadTemplate.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
loadTemplatePressed();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
});
jbSaveTemplate = new JButton(res.getString("DAddExtensions.jbSaveTemplate.text"));
jbSaveTemplate.setMnemonic(res.getString("DAddExtensions.jbSaveTemplate.mnemonic").charAt(0));
jbSaveTemplate.setToolTipText(res.getString("DAddExtensions.jbSaveTemplate.tooltip"));
jbSaveTemplate.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DAddExtensions.this);
saveTemplatePressed();
} finally {
CursorUtil.setCursorFree(DAddExtensions.this);
}
}
});
jpLoadSaveTemplate = new JPanel();
jpLoadSaveTemplate.setLayout(new BoxLayout(jpLoadSaveTemplate, BoxLayout.X_AXIS));
jpLoadSaveTemplate.add(Box.createHorizontalGlue());
jpLoadSaveTemplate.add(jbLoadTemplate);
jpLoadSaveTemplate.add(Box.createHorizontalStrut(5));
jpLoadSaveTemplate.add(jbSaveTemplate);
jpExtensions = new JPanel(new BorderLayout(5, 5));
jpExtensions.setPreferredSize(new Dimension(450, 200));
jpExtensions.add(jspExtensionsTable, BorderLayout.CENTER);
jpExtensions.add(jpExtensionButtons, BorderLayout.EAST);
jpExtensions.add(jpLoadSaveTemplate, BorderLayout.SOUTH);
jpExtensions.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
jbOK = new JButton(res.getString("DAddExtensions.jbOK.text"));
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jbCancel = new JButton(res.getString("DAddExtensions.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);
reloadExtensionsTable();
selectFirstExtensionInTable();
updateButtonControls();
getContentPane().setLayout(new BorderLayout());
getContentPane().add(jpExtensions, BorderLayout.CENTER);
getContentPane().add(jpButtons, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
setResizable(false);
getRootPane().setDefaultButton(jbOK);
pack();
}
use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DAuthorityInformationAccess method initComponents.
private void initComponents() {
jlAccessDescriptions = new JLabel(res.getString("DAuthorityInformationAccess.jlAccessDescriptions.text"));
GridBagConstraints gbc_jlAccessDescriptions = new GridBagConstraints();
gbc_jlAccessDescriptions.gridx = 0;
gbc_jlAccessDescriptions.gridy = 0;
gbc_jlAccessDescriptions.gridwidth = 1;
gbc_jlAccessDescriptions.gridheight = 1;
gbc_jlAccessDescriptions.insets = new Insets(5, 5, 5, 5);
gbc_jlAccessDescriptions.anchor = GridBagConstraints.NORTHEAST;
jadAccessDescriptions = new JAccessDescriptions(res.getString("DAuthorityInformationAccess.AccessDescription.Title"));
GridBagConstraints gbc_jadAccessDescriptions = new GridBagConstraints();
gbc_jadAccessDescriptions.gridx = 1;
gbc_jadAccessDescriptions.gridy = 0;
gbc_jadAccessDescriptions.gridwidth = 1;
gbc_jadAccessDescriptions.gridheight = 1;
gbc_jadAccessDescriptions.insets = new Insets(5, 5, 5, 5);
gbc_jadAccessDescriptions.anchor = GridBagConstraints.WEST;
jpAccessDescriptions = new JPanel(new GridBagLayout());
jpAccessDescriptions.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
jpAccessDescriptions.add(jlAccessDescriptions, gbc_jlAccessDescriptions);
jpAccessDescriptions.add(jadAccessDescriptions, gbc_jadAccessDescriptions);
jbOK = new JButton(res.getString("DAuthorityInformationAccess.jbOK.text"));
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jbCancel = new JButton(res.getString("DAuthorityInformationAccess.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(jpAccessDescriptions, BorderLayout.CENTER);
getContentPane().add(jpButtons, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
setResizable(false);
getRootPane().setDefaultButton(jbOK);
pack();
}
use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DCertificatePolicies method initComponents.
private void initComponents() {
jlCertificatePolicies = new JLabel(res.getString("DCertificatePolicies.jlCertificatePolicies.text"));
GridBagConstraints gbc_jlCertificatePolicies = new GridBagConstraints();
gbc_jlCertificatePolicies.gridx = 0;
gbc_jlCertificatePolicies.gridy = 1;
gbc_jlCertificatePolicies.gridwidth = 1;
gbc_jlCertificatePolicies.gridheight = 1;
gbc_jlCertificatePolicies.insets = new Insets(5, 5, 5, 5);
gbc_jlCertificatePolicies.anchor = GridBagConstraints.NORTHEAST;
jpiCertificatePolicies = new JPolicyInformation(res.getString("DCertificatePolicies.PolicyInformation.Title"));
jpiCertificatePolicies.setPreferredSize(new Dimension(400, 150));
GridBagConstraints gbc_jpiCertificatePolicies = new GridBagConstraints();
gbc_jpiCertificatePolicies.gridx = 1;
gbc_jpiCertificatePolicies.gridy = 1;
gbc_jpiCertificatePolicies.gridwidth = 1;
gbc_jpiCertificatePolicies.gridheight = 1;
gbc_jpiCertificatePolicies.insets = new Insets(5, 5, 5, 5);
gbc_jpiCertificatePolicies.anchor = GridBagConstraints.WEST;
jpCertificatePolicies = new JPanel(new GridBagLayout());
jpCertificatePolicies.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()));
jpCertificatePolicies.add(jlCertificatePolicies, gbc_jlCertificatePolicies);
jpCertificatePolicies.add(jpiCertificatePolicies, gbc_jpiCertificatePolicies);
jbOK = new JButton(res.getString("DCertificatePolicies.jbOK.text"));
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jbCancel = new JButton(res.getString("DCertificatePolicies.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(jpCertificatePolicies, BorderLayout.CENTER);
getContentPane().add(jpButtons, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
setResizable(false);
getRootPane().setDefaultButton(jbOK);
pack();
}
use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DInhibitAnyPolicy method initComponents.
private void initComponents() {
jlInhibitAnyPolicy = new JLabel(res.getString("DInhibitAnyPolicy.jlInhibitAnyPolicy.text"));
jlInhibitAnyPolicy.setBorder(new EmptyBorder(5, 5, 0, 5));
jlSkipCertificates = new JLabel(res.getString("DInhibitAnyPolicy.jlSkipCertificates.text"));
jtfSkipCertificates = new JTextField(3);
jpSkipCertificates = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5));
jpSkipCertificates.add(jlSkipCertificates);
jpSkipCertificates.add(jtfSkipCertificates);
jpInhibitAnyPolicy = new JPanel(new BorderLayout(5, 5));
jpInhibitAnyPolicy.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
jpInhibitAnyPolicy.add(jlInhibitAnyPolicy, BorderLayout.NORTH);
jpInhibitAnyPolicy.add(jpSkipCertificates, BorderLayout.CENTER);
jbOK = new JButton(res.getString("DInhibitAnyPolicy.jbOK.text"));
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jbCancel = new JButton(res.getString("DInhibitAnyPolicy.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(jpInhibitAnyPolicy, BorderLayout.CENTER);
getContentPane().add(jpButtons, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
setResizable(false);
getRootPane().setDefaultButton(jbOK);
pack();
}
use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DIssuerAlternativeName method initComponents.
private void initComponents() {
jlAlternativeName = new JLabel(res.getString("DIssuerAlternativeName.jlAlternativeName.text"));
GridBagConstraints gbc_jlAlternativeName = new GridBagConstraints();
gbc_jlAlternativeName.gridx = 0;
gbc_jlAlternativeName.gridy = 1;
gbc_jlAlternativeName.gridwidth = 1;
gbc_jlAlternativeName.gridheight = 1;
gbc_jlAlternativeName.insets = new Insets(5, 5, 5, 5);
gbc_jlAlternativeName.anchor = GridBagConstraints.NORTHEAST;
jgnAlternativeName = new JGeneralNames(res.getString("DIssuerAlternativeName.AlternativeName.Title"));
jgnAlternativeName.setPreferredSize(new Dimension(400, 150));
GridBagConstraints gbc_jgnAlternativeName = new GridBagConstraints();
gbc_jgnAlternativeName.gridx = 1;
gbc_jgnAlternativeName.gridy = 1;
gbc_jgnAlternativeName.gridwidth = 1;
gbc_jgnAlternativeName.gridheight = 1;
gbc_jgnAlternativeName.insets = new Insets(5, 5, 5, 5);
gbc_jgnAlternativeName.anchor = GridBagConstraints.WEST;
jpIssuerAlternativeName = new JPanel(new GridBagLayout());
jpIssuerAlternativeName.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()));
jpIssuerAlternativeName.add(jlAlternativeName, gbc_jlAlternativeName);
jpIssuerAlternativeName.add(jgnAlternativeName, gbc_jgnAlternativeName);
jbOK = new JButton(res.getString("DIssuerAlternativeName.jbOK.text"));
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jbCancel = new JButton(res.getString("DIssuerAlternativeName.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(jpIssuerAlternativeName, BorderLayout.CENTER);
getContentPane().add(jpButtons, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
setResizable(false);
getRootPane().setDefaultButton(jbOK);
pack();
}
Aggregations