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;
}
Aggregations