mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 00:35:49 +02:00
[232131] TVT34:TCT221: PLK: Certificate expiration date format
https://bugs.eclipse.org/bugs/show_bug.cgi?id=232131
This commit is contained in:
parent
378da2bb59
commit
34fbce31eb
4 changed files with 22 additions and 19 deletions
|
@ -21,3 +21,4 @@ Export-Package: org.eclipse.rse.internal.dstore.security;x-internal:=true,
|
|||
org.eclipse.rse.internal.dstore.security.util;x-internal:=true,
|
||||
org.eclipse.rse.internal.dstore.security.widgets;x-internal:=true,
|
||||
org.eclipse.rse.internal.dstore.security.wizards;x-internal:=true
|
||||
Import-Package: com.ibm.icu.text
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2006, 2008 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -12,7 +12,7 @@
|
|||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* David Dykstal (IBM) - [232131] fix minor layout problems along with date formats
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.dstore.security.preference;
|
||||
|
@ -136,7 +136,6 @@ public class UniversalSecurityPreferencePage extends PreferencePage implements
|
|||
table.setLinesVisible(true);
|
||||
GridData data = GridUtil.createFill();
|
||||
data.heightHint = 50;
|
||||
data.widthHint = 100;
|
||||
table.setLayoutData(data);
|
||||
|
||||
TableLayout tableLayout = new TableLayout();
|
||||
|
@ -148,19 +147,19 @@ public class UniversalSecurityPreferencePage extends PreferencePage implements
|
|||
|
||||
TableColumn toColumn = new TableColumn(table, SWT.LEFT);
|
||||
toColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_TO));
|
||||
tableLayout.addColumnData(new ColumnPixelData(120));
|
||||
tableLayout.addColumnData(new ColumnPixelData(150));
|
||||
|
||||
TableColumn frmColumn = new TableColumn(table, SWT.LEFT);
|
||||
frmColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_FROM));
|
||||
tableLayout.addColumnData(new ColumnPixelData(120));
|
||||
tableLayout.addColumnData(new ColumnPixelData(150));
|
||||
|
||||
TableColumn expColumn = new TableColumn(table, SWT.RIGHT);
|
||||
TableColumn expColumn = new TableColumn(table, SWT.LEFT);
|
||||
expColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_EXPIRES));
|
||||
tableLayout.addColumnData(new ColumnPixelData(120));
|
||||
tableLayout.addColumnData(new ColumnPixelData(150));
|
||||
table.setLayout(tableLayout);
|
||||
|
||||
// Adjust the table viewer.
|
||||
String[] properties = new String[] {"STRING", "STRING", "STRING", "NUMBER"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
String[] properties = new String[] {"STRING", "STRING", "STRING", "STRING"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
_viewer.setColumnProperties(properties);
|
||||
_viewer.setContentProvider(new CertTableContentProvider());
|
||||
_viewer.setLabelProvider(new CertTableLabelProvider());
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2006, 2008 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -12,7 +12,7 @@
|
|||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* David Dykstal (IBM) - use ICU for date formats
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.dstore.security.preference;
|
||||
|
@ -21,6 +21,8 @@ package org.eclipse.rse.internal.dstore.security.preference;
|
|||
import java.security.cert.X509Certificate;
|
||||
import java.util.Date;
|
||||
|
||||
import com.ibm.icu.text.DateFormat;
|
||||
|
||||
|
||||
public class X509CertificateElement extends Element
|
||||
{
|
||||
|
@ -168,24 +170,23 @@ public class X509CertificateElement extends Element
|
|||
return extract(full, CERT_COUNTRY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getNotBefore()
|
||||
{
|
||||
return _cert.getNotBefore().toString();
|
||||
Date date = _cert.getNotBefore();
|
||||
String result = DateFormat.getDateInstance(DateFormat.LONG).format(date);
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getNotAfter()
|
||||
{
|
||||
return _cert.getNotAfter().toString();
|
||||
Date date = _cert.getNotAfter();
|
||||
String result = DateFormat.getDateInstance(DateFormat.LONG).format(date);
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getExpirationDate()
|
||||
{
|
||||
Date date = _cert.getNotAfter();
|
||||
return date.toString();
|
||||
return getNotAfter();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
*
|
||||
* Contributors:
|
||||
* David Dykstal (IBM) - [231913] increasing width of form to accomodate translation
|
||||
* David Dykstal (IBM) - [232131] using ICU for DateFormat
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.dstore.security.widgets;
|
||||
|
||||
import java.security.Key;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.text.DateFormat;
|
||||
|
||||
import org.eclipse.rse.internal.dstore.security.UniversalSecurityPlugin;
|
||||
import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties;
|
||||
|
@ -35,6 +35,8 @@ import org.eclipse.swt.widgets.Label;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.ibm.icu.text.DateFormat;
|
||||
|
||||
public class CertificatePropertiesForm extends SystemBaseForm
|
||||
{
|
||||
private Object _certificate;
|
||||
|
|
Loading…
Add table
Reference in a new issue