Search in sources :

Example 6 with PolicyMapping

use of org.kse.crypto.x509.PolicyMapping in project keystore-explorer by kaikramer.

the class PolicyMappingsTableCellRend method getTableCellRendererComponent.

/**
 * Returns the rendered cell.
 *
 * @param jtPolicyMappings
 *            The JTable
 * @param value
 *            The value to assign to the cell
 * @param isSelected
 *            True if cell is selected
 * @param row
 *            The row of the cell to render
 * @param col
 *            The column of the cell to render
 * @param hasFocus
 *            If true, render cell appropriately
 * @return The renderered cell
 */
@Override
public Component getTableCellRendererComponent(JTable jtPolicyMappings, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
    JLabel cell = (JLabel) super.getTableCellRendererComponent(jtPolicyMappings, value, isSelected, hasFocus, row, col);
    PolicyMapping policyMapping = (PolicyMapping) value;
    if (col == 0) {
        String issuerDomainPolicyIdStr = policyMapping.getIssuerDomainPolicy().getId();
        cell.setText(issuerDomainPolicyIdStr);
        cell.setToolTipText(issuerDomainPolicyIdStr);
    } else {
        String subjectDomainPolicyIdStr = policyMapping.getSubjectDomainPolicy().getId();
        cell.setText(subjectDomainPolicyIdStr);
        cell.setToolTipText(subjectDomainPolicyIdStr);
    }
    cell.setHorizontalAlignment(LEFT);
    cell.setBorder(new EmptyBorder(0, 5, 0, 5));
    return cell;
}
Also used : PolicyMapping(org.kse.crypto.x509.PolicyMapping) JLabel(javax.swing.JLabel) EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

PolicyMapping (org.kse.crypto.x509.PolicyMapping)6 Container (java.awt.Container)2 Point (java.awt.Point)2 JDialog (javax.swing.JDialog)2 JFrame (javax.swing.JFrame)2 JLabel (javax.swing.JLabel)1 EmptyBorder (javax.swing.border.EmptyBorder)1 ASN1Encodable (org.bouncycastle.asn1.ASN1Encodable)1 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)1 ASN1Sequence (org.bouncycastle.asn1.ASN1Sequence)1