1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 21:15:23 +02:00

[235626] Convert dstore.security to MessageBundle format

This commit is contained in:
Martin Oberhuber 2008-06-04 22:48:52 +00:00
parent e97b62b224
commit e4d6db8c8f
11 changed files with 311 additions and 360 deletions

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,15 +12,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security; package org.eclipse.rse.internal.dstore.security;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
@ -35,7 +32,6 @@ public class UniversalSecurityPlugin extends AbstractUIPlugin
{ {
private final static String KEYSTORE = "dstorekeystore.dat"; //$NON-NLS-1$ private final static String KEYSTORE = "dstorekeystore.dat"; //$NON-NLS-1$
private static UniversalSecurityPlugin inst; private static UniversalSecurityPlugin inst;
private static ResourceBundle aResourceBundle;
public static final String PLUGIN_ID = "org.eclipse.rse.dstore.security"; //$NON-NLS-1$ public static final String PLUGIN_ID = "org.eclipse.rse.dstore.security"; //$NON-NLS-1$
public UniversalSecurityPlugin() { public UniversalSecurityPlugin() {
@ -51,28 +47,6 @@ public class UniversalSecurityPlugin extends AbstractUIPlugin
return PLUGIN_ID; return PLUGIN_ID;
} }
public static ResourceBundle getResourceBundle() {
if(aResourceBundle == null)
{
try {
aResourceBundle = Platform.getResourceBundle(Platform.getBundle(PLUGIN_ID));
} catch (Exception e) {
aResourceBundle = null;
}
}
return aResourceBundle;
}
public static String getString(String key) {
try {
return getResourceBundle().getString(key);
} catch (MissingResourceException e) {
return key;
}
}
public static String getKeyStoreLocation() { public static String getKeyStoreLocation() {
Bundle bundle = Platform.getBundle(PLUGIN_ID); Bundle bundle = Platform.getBundle(PLUGIN_ID);

View file

@ -13,19 +13,16 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [181112] NLS missing messages * Martin Oberhuber (Wind River) - [181112] NLS missing messages
* Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security; package org.eclipse.rse.internal.dstore.security;
import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.NLS;
public class UniversalSecurityProperties extends NLS public class UniversalSecurityProperties extends NLS
{ {
private static String BUNDLE_NAME = "org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties";//$NON-NLS-1$ private static String BUNDLE_NAME = "org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties"; //$NON-NLS-1$
public static String RESID_SECURITY_CERTIFICATE_PROP_TITLE; public static String RESID_SECURITY_CERTIFICATE_PROP_TITLE;
public static String RESID_SECURITY_VALIDITY_PERIOD; public static String RESID_SECURITY_VALIDITY_PERIOD;
@ -56,6 +53,11 @@ public class UniversalSecurityProperties extends NLS
public static String RESID_SECURITY_IO_SAVE_ERROR_; public static String RESID_SECURITY_IO_SAVE_ERROR_;
public static String RESID_SECURITY_CERTIFICATE_STORE_ERROR_; public static String RESID_SECURITY_CERTIFICATE_STORE_ERROR_;
public static String RESID_SECURITY_UNINIT_KEYSTORE_ERROR_; public static String RESID_SECURITY_UNINIT_KEYSTORE_ERROR_;
public static String RESID_SECURITY_ALGORITHM_ERROR_;
public static String RESID_SECURITY_LOAD_KEYSTORE_ERROR_;
public static String RESID_SECURITY_KEY_LOAD_ERROR_;
public static String RESID_SECURITY_INITIALIZE_ERROR_;
public static String RESID_SECURITY_SECURITY_PROVIDER_ERROR_;
public static String RESID_SECURITY_CERTIFICATE_EXC_; public static String RESID_SECURITY_CERTIFICATE_EXC_;
public static String RESID_SECURITY_LOAD_IO_EXC_; public static String RESID_SECURITY_LOAD_IO_EXC_;
public static String RESID_SECURITY_CERTIFICATE_LOAD_EXC_; public static String RESID_SECURITY_CERTIFICATE_LOAD_EXC_;

View file

@ -12,7 +12,7 @@
# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. # Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
# #
# Contributors: # Contributors:
# {Name} (company) - description of contribution. # Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
############################################################################### ###############################################################################
# NLS_MESSAGEFORMAT_NONE # NLS_MESSAGEFORMAT_NONE
@ -48,6 +48,13 @@
RESID_SECURITY_IO_SAVE_ERROR_ = A input-output exception occurred while saving key store \n%1. RESID_SECURITY_IO_SAVE_ERROR_ = A input-output exception occurred while saving key store \n%1.
RESID_SECURITY_CERTIFICATE_STORE_ERROR_ = One or more certificates in the\n%1\nkey store could not be stored. RESID_SECURITY_CERTIFICATE_STORE_ERROR_ = One or more certificates in the\n%1\nkey store could not be stored.
RESID_SECURITY_UNINIT_KEYSTORE_ERROR_ = Keystore %1 \nhas not been initialized. RESID_SECURITY_UNINIT_KEYSTORE_ERROR_ = Keystore %1 \nhas not been initialized.
# FIXME MISSING STRINGS START
RESID_SECURITY_ALGORITHM_ERROR_ = Algorithm error in Keystore %1
RESID_SECURITY_LOAD_KEYSTORE_ERROR_ = An error occurred when processing Keystore.
RESID_SECURITY_KEY_LOAD_ERROR_ = Error loading key from %1
RESID_SECURITY_INITIALIZE_ERROR_ = Error initializing keystore at %1
RESID_SECURITY_SECURITY_PROVIDER_ERROR_ = Missing Security Provider
# FIXME MISSING STRINGS END
RESID_SECURITY_CERTIFICATE_EXC_ = A certificate exception occurred while loading the file\n%1 RESID_SECURITY_CERTIFICATE_EXC_ = A certificate exception occurred while loading the file\n%1
RESID_SECURITY_LOAD_IO_EXC_ = A input-output exception occurred while loading the file\n%1 RESID_SECURITY_LOAD_IO_EXC_ = A input-output exception occurred while loading the file\n%1
RESID_SECURITY_CERTIFICATE_LOAD_EXC_ = Unable to load certificate. RESID_SECURITY_CERTIFICATE_LOAD_EXC_ = Unable to load certificate.

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,14 +12,13 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security.preference; package org.eclipse.rse.internal.dstore.security.preference;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityPlugin;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties; import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties;
import org.eclipse.rse.internal.dstore.security.widgets.CertificatePropertiesForm; import org.eclipse.rse.internal.dstore.security.widgets.CertificatePropertiesForm;
import org.eclipse.rse.ui.dialogs.SystemPromptDialog; import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
@ -36,7 +35,7 @@ public class CertPropertiesDialog extends SystemPromptDialog
public CertPropertiesDialog(Shell parentShell, Object cert) public CertPropertiesDialog(Shell parentShell, Object cert)
{ {
super(parentShell, UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_PROP_TITLE)); super(parentShell, UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_PROP_TITLE);
_cert = cert; _cert = cert;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security.preference; package org.eclipse.rse.internal.dstore.security.preference;
@ -21,7 +21,6 @@ package org.eclipse.rse.internal.dstore.security.preference;
import java.security.Key; import java.security.Key;
import org.eclipse.rse.internal.dstore.security.ImageRegistry; import org.eclipse.rse.internal.dstore.security.ImageRegistry;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityPlugin;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties; import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
@ -38,7 +37,7 @@ public class KeyElement extends Element
public String getType() public String getType()
{ {
return UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_KEY_ENTRY); return UniversalSecurityProperties.RESID_SECURITY_KEY_ENTRY;
} }
public String getAlgorithm() public String getAlgorithm()

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security.preference; package org.eclipse.rse.internal.dstore.security.preference;
@ -57,7 +57,7 @@ public class NewCertDialog extends SystemPromptDialog implements Listener
private Shell _shell; private Shell _shell;
public NewCertDialog(UniversalSecurityPreferencePage page, Shell shell){ public NewCertDialog(UniversalSecurityPreferencePage page, Shell shell){
super(shell,UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_ADD_CERT_DLG_TITLE) ); super(shell, UniversalSecurityProperties.RESID_SECURITY_ADD_CERT_DLG_TITLE);
this.page = page; this.page = page;
_shell = shell; _shell = shell;
} }
@ -97,53 +97,54 @@ public class NewCertDialog extends SystemPromptDialog implements Listener
} }
catch(FileNotFoundException e){ catch(FileNotFoundException e){
String text = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_KEY_IO_ERROR_); String text = UniversalSecurityProperties.RESID_SECURITY_KEY_IO_ERROR_;
text = StringModifier.change(text, "%1", _certForm.getPath()); //$NON-NLS-1$ text = StringModifier.change(text, "%1", _certForm.getPath()); //$NON-NLS-1$
String msg = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_LOAD_EXC_); String msg = UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_LOAD_EXC_;
Status err = new Status(IStatus.ERROR,ResourcesPlugin.PI_RESOURCES,IStatus.ERROR,text,e); Status err = new Status(IStatus.ERROR,ResourcesPlugin.PI_RESOURCES,IStatus.ERROR,text,e);
ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(),UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_SEC_MSG), msg,err); ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
return false; return false;
} }
catch(IOException e){ catch(IOException e){
String text = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_LOAD_IO_EXC_); String text = UniversalSecurityProperties.RESID_SECURITY_LOAD_IO_EXC_;
text = StringModifier.change(text, "%1", _certForm.getPath()); //$NON-NLS-1$ text = StringModifier.change(text, "%1", _certForm.getPath()); //$NON-NLS-1$
text = StringModifier.change(text, "%1", UniversalSecurityPlugin.getKeyStoreLocation()); //$NON-NLS-1$ text = StringModifier.change(text, "%1", UniversalSecurityPlugin.getKeyStoreLocation()); //$NON-NLS-1$
String msg = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_LOAD_EXC_); String msg = UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_LOAD_EXC_;
Status err = new Status(IStatus.ERROR,ResourcesPlugin.PI_RESOURCES,IStatus.ERROR,text,e); Status err = new Status(IStatus.ERROR,ResourcesPlugin.PI_RESOURCES,IStatus.ERROR,text,e);
ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(),UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_SEC_MSG), msg,err); ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
return false; return false;
} }
catch(CertificateException exc){ catch(CertificateException exc){
String text = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_EXC_); String text = UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_EXC_;
text = StringModifier.change(text, "%1", _certForm.getPath()); //$NON-NLS-1$ text = StringModifier.change(text, "%1", _certForm.getPath()); //$NON-NLS-1$
String msg = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_LOAD_EXC_); String msg = UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_LOAD_EXC_;
Status err = new Status(IStatus.ERROR,ResourcesPlugin.PI_RESOURCES,IStatus.ERROR,text,exc); Status err = new Status(IStatus.ERROR,ResourcesPlugin.PI_RESOURCES,IStatus.ERROR,text,exc);
ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(),UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_SEC_MSG), msg,err); ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
return false; return false;
} }
catch(KeyStoreException exc){ catch(KeyStoreException exc){
String text = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_KEY_STORE_ERROR_); String text = UniversalSecurityProperties.RESID_SECURITY_KEY_STORE_ERROR_;
text = StringModifier.change(text, "%1", UniversalSecurityPlugin.getKeyStoreLocation()); //$NON-NLS-1$ text = StringModifier.change(text, "%1", UniversalSecurityPlugin.getKeyStoreLocation()); //$NON-NLS-1$
String msg = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_LOAD_EXC_); String msg = UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_LOAD_EXC_;
Status err = new Status(IStatus.ERROR,ResourcesPlugin.PI_RESOURCES,IStatus.ERROR,text,exc); Status err = new Status(IStatus.ERROR,ResourcesPlugin.PI_RESOURCES,IStatus.ERROR,text,exc);
ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(),UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_SEC_MSG), msg,err); ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
return false; return false;
} }
if (_certificate instanceof X509Certificate) if (_certificate instanceof X509Certificate)
{ {
X509CertificateElement elem = new X509CertificateElement(_certForm.getAliasName(), UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_TRUSTED_CERTIFICATE), (X509Certificate)_certificate); X509CertificateElement elem = new X509CertificateElement(_certForm.getAliasName(), UniversalSecurityProperties.RESID_SECURITY_TRUSTED_CERTIFICATE,
(X509Certificate) _certificate);
this.page._tableItems.add(elem); this.page._tableItems.add(elem);
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,14 +12,13 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security.preference; package org.eclipse.rse.internal.dstore.security.preference;
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityPlugin;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties; import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties;
import org.eclipse.rse.internal.dstore.security.util.GridUtil; import org.eclipse.rse.internal.dstore.security.util.GridUtil;
import org.eclipse.rse.ui.dialogs.SystemPromptDialog; import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
@ -43,7 +42,7 @@ public class RenameCertDialog extends SystemPromptDialog implements Listener{
public RenameCertDialog(UniversalSecurityPreferencePage page, Shell shell, String oldValue) public RenameCertDialog(UniversalSecurityPreferencePage page, Shell shell, String oldValue)
{ {
super(shell, UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_RENAME_CERT_DLG_TITLE)); super(shell, UniversalSecurityProperties.RESID_SECURITY_RENAME_CERT_DLG_TITLE);
oldAlias = oldValue; oldAlias = oldValue;
} }
@ -64,7 +63,7 @@ public class RenameCertDialog extends SystemPromptDialog implements Listener{
content.setLayoutData(data); content.setLayoutData(data);
Label lblName = new Label(content, SWT.NONE); Label lblName = new Label(content, SWT.NONE);
lblName.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_ALIAS)); lblName.setText(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_ALIAS);
txtName = new Text(content, SWT.BORDER); txtName = new Text(content, SWT.BORDER);
txtName.setText(oldAlias); txtName.setText(oldAlias);

View file

@ -13,6 +13,7 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - [232131] fix minor layout problems along with date formats * David Dykstal (IBM) - [232131] fix minor layout problems along with date formats
* Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security.preference; package org.eclipse.rse.internal.dstore.security.preference;
@ -103,7 +104,7 @@ public class UniversalSecurityPreferencePage extends PreferencePage implements
Text label = new Text(composite, SWT.READ_ONLY); Text label = new Text(composite, SWT.READ_ONLY);
label.setBackground(composite.getBackground()); label.setBackground(composite.getBackground());
label.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_SEC_DESCRIPTION)); label.setText(UniversalSecurityProperties.RESID_SECURITY_PREF_SEC_DESCRIPTION);
GridData data = new GridData(); GridData data = new GridData();
data.horizontalSpan = 2; data.horizontalSpan = 2;
label.setLayoutData(data); label.setLayoutData(data);
@ -142,19 +143,19 @@ public class UniversalSecurityPreferencePage extends PreferencePage implements
TableColumn aliasColumn = new TableColumn(table, SWT.LEFT); TableColumn aliasColumn = new TableColumn(table, SWT.LEFT);
aliasColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_ALIAS_NAME)); aliasColumn.setText(UniversalSecurityProperties.RESID_SECURITY_PREF_ALIAS_NAME);
tableLayout.addColumnData(new ColumnPixelData(100)); tableLayout.addColumnData(new ColumnPixelData(100));
TableColumn toColumn = new TableColumn(table, SWT.LEFT); TableColumn toColumn = new TableColumn(table, SWT.LEFT);
toColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_TO)); toColumn.setText(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_TO);
tableLayout.addColumnData(new ColumnPixelData(150)); tableLayout.addColumnData(new ColumnPixelData(150));
TableColumn frmColumn = new TableColumn(table, SWT.LEFT); TableColumn frmColumn = new TableColumn(table, SWT.LEFT);
frmColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_FROM)); frmColumn.setText(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_FROM);
tableLayout.addColumnData(new ColumnPixelData(150)); tableLayout.addColumnData(new ColumnPixelData(150));
TableColumn expColumn = new TableColumn(table, SWT.LEFT); TableColumn expColumn = new TableColumn(table, SWT.LEFT);
expColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_EXPIRES)); expColumn.setText(UniversalSecurityProperties.RESID_SECURITY_PREF_EXPIRES);
tableLayout.addColumnData(new ColumnPixelData(150)); tableLayout.addColumnData(new ColumnPixelData(150));
table.setLayout(tableLayout); table.setLayout(tableLayout);
@ -172,16 +173,16 @@ public class UniversalSecurityPreferencePage extends PreferencePage implements
{ {
Composite buttonComposite = SystemWidgetHelpers.createComposite(parent, 4); Composite buttonComposite = SystemWidgetHelpers.createComposite(parent, 4);
_addButton = SystemWidgetHelpers.createPushButton(buttonComposite, UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_ADD_LBL),this); _addButton = SystemWidgetHelpers.createPushButton(buttonComposite, UniversalSecurityProperties.RESID_SECURITY_ADD_LBL, this);
_removeButton = SystemWidgetHelpers.createPushButton(buttonComposite, UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_REMOVE_LBL), this); _removeButton = SystemWidgetHelpers.createPushButton(buttonComposite, UniversalSecurityProperties.RESID_SECURITY_REMOVE_LBL, this);
_removeButton.setEnabled(false); _removeButton.setEnabled(false);
_renameButton = SystemWidgetHelpers.createPushButton(buttonComposite, UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_RENAME_LBL), this); _renameButton = SystemWidgetHelpers.createPushButton(buttonComposite, UniversalSecurityProperties.RESID_SECURITY_RENAME_LBL, this);
_renameButton.setEnabled(false); _renameButton.setEnabled(false);
_propertiesButton = SystemWidgetHelpers.createPushButton(buttonComposite, UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PROPERTIES_LBL), this); _propertiesButton = SystemWidgetHelpers.createPushButton(buttonComposite, UniversalSecurityProperties.RESID_SECURITY_PROPERTIES_LBL, this);
_propertiesButton.setEnabled(false); _propertiesButton.setEnabled(false);
} }
@ -219,64 +220,55 @@ public class UniversalSecurityPreferencePage extends PreferencePage implements
catch (IOException e) catch (IOException e)
{ {
String text = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_IO_SAVE_ERROR_); String text = UniversalSecurityProperties.RESID_SECURITY_IO_SAVE_ERROR_;
text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$ text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$
text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$ text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$
String msg = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_KEYSTORE_SAVE_ERROR_); String msg = UniversalSecurityProperties.RESID_SECURITY_KEYSTORE_SAVE_ERROR_;
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, e); IStatus.ERROR, text, e);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
.getActiveWorkbenchShell(), UniversalSecurityPlugin
.getString("SEC_MSG"), msg, err); //$NON-NLS-1$
return false; return false;
} }
catch (CertificateException exc) catch (CertificateException exc)
{ {
String text = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_STORE_ERROR_); String text = UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_STORE_ERROR_;
text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$ text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$
String msg = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_KEYSTORE_SAVE_ERROR_); String msg = UniversalSecurityProperties.RESID_SECURITY_KEYSTORE_SAVE_ERROR_;
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, exc); IStatus.ERROR, text, exc);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin
.getActiveWorkbenchShell(), UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_SEC_MSG), msg, err); .getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
return false; return false;
} }
catch (KeyStoreException exc) catch (KeyStoreException exc)
{ {
String text = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_UNINIT_KEYSTORE_ERROR_); String text = UniversalSecurityProperties.RESID_SECURITY_UNINIT_KEYSTORE_ERROR_;
text = StringModifier.change(text, "%1", UniversalSecurityPlugin //$NON-NLS-1$ text = StringModifier.change(text, "%1", UniversalSecurityPlugin //$NON-NLS-1$
.getKeyStoreLocation()); .getKeyStoreLocation());
String msg = UniversalSecurityPlugin String msg = UniversalSecurityProperties.RESID_SECURITY_KEYSTORE_SAVE_ERROR_;
.getString("RESID_SECURITY_KEYSTORE_SAVE_ERROR_"); //$NON-NLS-1$
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, exc); IStatus.ERROR, text, exc);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
.getActiveWorkbenchShell(), UniversalSecurityPlugin
.getString("SEC_MSG"), msg, err); //$NON-NLS-1$
return false; return false;
} }
catch (NoSuchAlgorithmException exc2) catch (NoSuchAlgorithmException exc2)
{ {
String text = UniversalSecurityPlugin String text = UniversalSecurityProperties.RESID_SECURITY_ALGORITHM_ERROR_;
.getString("RESID_SECURITY_ALGORITHM_ERROR_"); //$NON-NLS-1$
text = StringModifier.change(text, "%1", UniversalSecurityPlugin //$NON-NLS-1$ text = StringModifier.change(text, "%1", UniversalSecurityPlugin //$NON-NLS-1$
.getKeyStoreLocation()); .getKeyStoreLocation());
String msg = UniversalSecurityPlugin String msg = UniversalSecurityProperties.RESID_SECURITY_KEYSTORE_SAVE_ERROR_;
.getString("RESID_SECURITY_KEYSTORE_SAVE_ERROR_"); //$NON-NLS-1$
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, exc2); IStatus.ERROR, text, exc2);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
.getActiveWorkbenchShell(), UniversalSecurityPlugin
.getString("SEC_MSG"), msg, err); //$NON-NLS-1$
return false; return false;
} }
@ -323,8 +315,7 @@ public class UniversalSecurityPreferencePage extends PreferencePage implements
{ {
Key key = _keyStore.getKey(alias, passw.toCharArray()); Key key = _keyStore.getKey(alias, passw.toCharArray());
KeyElement elem = new KeyElement(alias, KeyElement elem = new KeyElement(alias,
UniversalSecurityPlugin UniversalSecurityProperties.RESID_SECURITY_KEY_ENTRY,
.getString("RESID_SECURITY_KEY_ENTRY"), //$NON-NLS-1$
key); key);
_tableItems.add(elem); _tableItems.add(elem);
} }
@ -339,82 +330,62 @@ public class UniversalSecurityPreferencePage extends PreferencePage implements
catch (IOException e) catch (IOException e)
{ {
String text = UniversalSecurityPlugin String text = UniversalSecurityProperties.RESID_SECURITY_LOAD_IO_EXC_;
.getString("RESID_SECURITY_LOAD_IO_EXC_"); //$NON-NLS-1$
text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$ text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$
String msg = UniversalSecurityPlugin String msg = UniversalSecurityProperties.RESID_SECURITY_LOAD_KEYSTORE_ERROR_;
.getString("RESID_SECURITY_LOAD_KEYSTORE_ERROR_"); //$NON-NLS-1$
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, e); IStatus.ERROR, text, e);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
.getActiveWorkbenchShell(), UniversalSecurityPlugin
.getString("SEC_MSG"), msg, err); //$NON-NLS-1$
} }
catch (CertificateException exc) catch (CertificateException exc)
{ {
String text = UniversalSecurityPlugin String text = UniversalSecurityProperties.RESID_SECURITY_KEY_LOAD_ERROR_;
.getString("RESID_SECURITY_KEY_LOAD_ERROR_"); //$NON-NLS-1$
text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$ text = StringModifier.change(text, "%1", storePath); //$NON-NLS-1$
String msg = UniversalSecurityPlugin String msg = UniversalSecurityProperties.RESID_SECURITY_LOAD_KEYSTORE_ERROR_;
.getString("RESID_SECURITY_LOAD_KEYSTORE_ERROR_"); //$NON-NLS-1$
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, exc); IStatus.ERROR, text, exc);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
.getActiveWorkbenchShell(), UniversalSecurityPlugin
.getString("SEC_MSG"), msg, err); //$NON-NLS-1$
} }
catch (KeyStoreException exc) catch (KeyStoreException exc)
{ {
String text = UniversalSecurityPlugin String text = UniversalSecurityProperties.RESID_SECURITY_INITIALIZE_ERROR_;
.getString("RESID_SECURITY_INITIALIZE_ERROR_"); //$NON-NLS-1$
text = StringModifier.change(text, "%1", UniversalSecurityPlugin //$NON-NLS-1$ text = StringModifier.change(text, "%1", UniversalSecurityPlugin //$NON-NLS-1$
.getKeyStoreLocation()); .getKeyStoreLocation());
String msg = UniversalSecurityPlugin String msg = UniversalSecurityProperties.RESID_SECURITY_LOAD_KEYSTORE_ERROR_;
.getString("RESID_SECURITY_LOAD_KEYSTORE_ERROR_"); //$NON-NLS-1$
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, exc); IStatus.ERROR, text, exc);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
.getActiveWorkbenchShell(), UniversalSecurityPlugin
.getString("SEC_MSG"), msg, err); //$NON-NLS-1$
} }
catch (NoSuchProviderException exc2) catch (NoSuchProviderException exc2)
{ {
String text = UniversalSecurityPlugin String text = UniversalSecurityProperties.RESID_SECURITY_SECURITY_PROVIDER_ERROR_;
.getString("RESID_SECURITY_SECURITY_PROVIDER_ERROR_"); //$NON-NLS-1$ String msg = UniversalSecurityProperties.RESID_SECURITY_INITIALIZE_ERROR_;
String msg = UniversalSecurityPlugin
.getString("RESID_SECURITY_INITIALIZE_ERROR_"); //$NON-NLS-1$
msg = StringModifier.change(msg, "%1", UniversalSecurityPlugin //$NON-NLS-1$ msg = StringModifier.change(msg, "%1", UniversalSecurityPlugin //$NON-NLS-1$
.getKeyStoreLocation()); .getKeyStoreLocation());
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, exc2); IStatus.ERROR, text, exc2);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
.getActiveWorkbenchShell(), UniversalSecurityPlugin
.getString("SEC_MSG"), msg, err); //$NON-NLS-1$
} }
catch (NoSuchAlgorithmException exc2) catch (NoSuchAlgorithmException exc2)
{ {
String text = UniversalSecurityPlugin String text = UniversalSecurityProperties.RESID_SECURITY_ALGORITHM_ERROR_;
.getString("RESID_SECURITY_ALGORITHM_ERROR_"); //$NON-NLS-1$
text = StringModifier.change(text, "%1", UniversalSecurityPlugin //$NON-NLS-1$ text = StringModifier.change(text, "%1", UniversalSecurityPlugin //$NON-NLS-1$
.getKeyStoreLocation()); .getKeyStoreLocation());
String msg = UniversalSecurityPlugin String msg = UniversalSecurityProperties.RESID_SECURITY_LOAD_KEYSTORE_ERROR_;
.getString("RESID_SECURITY_LOAD_KEYSTORE_ERROR_"); //$NON-NLS-1$
Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, Status err = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
IStatus.ERROR, text, exc2); IStatus.ERROR, text, exc2);
ErrorDialog.openError(UniversalSecurityPlugin ErrorDialog.openError(UniversalSecurityPlugin.getActiveWorkbenchShell(), UniversalSecurityProperties.RESID_SECURITY_SEC_MSG, msg, err);
.getActiveWorkbenchShell(), UniversalSecurityPlugin
.getString("SEC_MSG"), msg, err); //$NON-NLS-1$
} }

View file

@ -13,6 +13,7 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - [230815] fix layout problems with long labels * David Dykstal (IBM) - [230815] fix layout problems with long labels
* Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
@ -27,7 +28,6 @@ import java.security.cert.CertificateException;
import java.util.ArrayList; import java.util.ArrayList;
import org.eclipse.dstore.core.util.ssl.DStoreKeyStore; import org.eclipse.dstore.core.util.ssl.DStoreKeyStore;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityPlugin;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties; import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties;
import org.eclipse.rse.internal.dstore.security.util.GridUtil; import org.eclipse.rse.internal.dstore.security.util.GridUtil;
import org.eclipse.rse.ui.SystemBaseForm; import org.eclipse.rse.ui.SystemBaseForm;
@ -80,19 +80,19 @@ public class CertificateForm extends SystemBaseForm
nameGroup.setLayout(layout); nameGroup.setLayout(layout);
Label lblPath = new Label(nameGroup, SWT.NONE); Label lblPath = new Label(nameGroup, SWT.NONE);
lblPath.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_FILE)); lblPath.setText(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_FILE);
_pathField = new Text(nameGroup, SWT.BORDER); _pathField = new Text(nameGroup, SWT.BORDER);
_pathField.setLayoutData(GridUtil.createHorizontalFill()); _pathField.setLayoutData(GridUtil.createHorizontalFill());
((GridData)_pathField.getLayoutData()).widthHint = 150; ((GridData)_pathField.getLayoutData()).widthHint = 150;
_pathField.setText(""); //$NON-NLS-1$ _pathField.setText(""); //$NON-NLS-1$
_browseButton = new Button(nameGroup, SWT.PUSH); _browseButton = new Button(nameGroup, SWT.PUSH);
_browseButton.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_BROWSE)); _browseButton.setText(UniversalSecurityProperties.RESID_SECURITY_BROWSE);
_browseButton.addListener(SWT.Selection, this); _browseButton.addListener(SWT.Selection, this);
Label lblName = new Label(nameGroup, SWT.NONE); Label lblName = new Label(nameGroup, SWT.NONE);
lblName.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_ALIAS)); lblName.setText(UniversalSecurityProperties.RESID_SECURITY_CERTIFICATE_ALIAS);
_aliasField = new Text(nameGroup, SWT.BORDER); _aliasField = new Text(nameGroup, SWT.BORDER);
_aliasField.setText(""); //$NON-NLS-1$ _aliasField.setText(""); //$NON-NLS-1$

View file

@ -12,8 +12,9 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - [231913] increasing width of form to accomodate translation * David Dykstal (IBM) - [231913] increasing width of form to accommodate translation
* David Dykstal (IBM) - [232131] using ICU for DateFormat * David Dykstal (IBM) - [232131] using ICU for DateFormat
* Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security.widgets; package org.eclipse.rse.internal.dstore.security.widgets;
@ -21,7 +22,6 @@ package org.eclipse.rse.internal.dstore.security.widgets;
import java.security.Key; import java.security.Key;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityPlugin;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties; import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties;
import org.eclipse.rse.internal.dstore.security.util.GridUtil; import org.eclipse.rse.internal.dstore.security.util.GridUtil;
import org.eclipse.rse.internal.dstore.security.util.StringModifier; import org.eclipse.rse.internal.dstore.security.util.StringModifier;
@ -93,7 +93,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
if (_alias != null) if (_alias != null)
{ {
Label lblAlias = new Label(content, SWT.NONE); Label lblAlias = new Label(content, SWT.NONE);
lblAlias.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PROP_ALIAS_LBL)); lblAlias.setText(UniversalSecurityProperties.RESID_SECURITY_PROP_ALIAS_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
lblAlias.setLayoutData(data); lblAlias.setLayoutData(data);
@ -106,7 +106,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
} }
Label lblVersion = new Label(content, SWT.NONE); Label lblVersion = new Label(content, SWT.NONE);
lblVersion.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIF_VERSION_LBL)); lblVersion.setText(UniversalSecurityProperties.RESID_SECURITY_CERTIF_VERSION_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
lblVersion.setLayoutData(data); lblVersion.setLayoutData(data);
@ -118,7 +118,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblVersionValue.setLayoutData(data); lblVersionValue.setLayoutData(data);
Label lblIssuedTo = new Label(content, SWT.NONE); Label lblIssuedTo = new Label(content, SWT.NONE);
lblIssuedTo.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_ISSUED_TO_LBL)); lblIssuedTo.setText(UniversalSecurityProperties.RESID_SECURITY_ISSUED_TO_LBL);
data = new GridData(); data = new GridData();
data.verticalAlignment = GridData.BEGINNING; data.verticalAlignment = GridData.BEGINNING;
data.horizontalIndent = 5; data.horizontalIndent = 5;
@ -131,7 +131,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblIssuedToValue.setLayoutData(data); lblIssuedToValue.setLayoutData(data);
Label lblIssuedBy = new Label(content, SWT.NONE); Label lblIssuedBy = new Label(content, SWT.NONE);
lblIssuedBy.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_ISSUED_BY_LBL)); lblIssuedBy.setText(UniversalSecurityProperties.RESID_SECURITY_ISSUED_BY_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
data.verticalAlignment = GridData.BEGINNING; data.verticalAlignment = GridData.BEGINNING;
@ -144,7 +144,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblIssuedByValue.setLayoutData(data); lblIssuedByValue.setLayoutData(data);
Label lblValidity = new Label(content, SWT.NONE); Label lblValidity = new Label(content, SWT.NONE);
lblValidity.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_VALIDITY_LBL)); lblValidity.setText(UniversalSecurityProperties.RESID_SECURITY_VALIDITY_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
lblValidity.setLayoutData(data); lblValidity.setLayoutData(data);
@ -155,7 +155,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblValidityValue.setLayoutData(data); lblValidityValue.setLayoutData(data);
Label lblAlgorithm = new Label(content, SWT.NONE); Label lblAlgorithm = new Label(content, SWT.NONE);
lblAlgorithm.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_ALGORITHM_LBL)); lblAlgorithm.setText(UniversalSecurityProperties.RESID_SECURITY_ALGORITHM_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
lblAlgorithm.setLayoutData(data); lblAlgorithm.setLayoutData(data);
@ -171,7 +171,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblIssuedByValue.setText(((X509Certificate)_certificate).getIssuerDN().getName()); lblIssuedByValue.setText(((X509Certificate)_certificate).getIssuerDN().getName());
DateFormat df = DateFormat.getDateInstance(DateFormat.LONG); DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
String validity = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_VALIDITY_PERIOD); String validity = UniversalSecurityProperties.RESID_SECURITY_VALIDITY_PERIOD;
validity = StringModifier.change(validity,"%1", df.format(((X509Certificate)_certificate).getNotBefore())); //$NON-NLS-1$ validity = StringModifier.change(validity,"%1", df.format(((X509Certificate)_certificate).getNotBefore())); //$NON-NLS-1$
validity = StringModifier.change(validity,"%2", df.format(((X509Certificate)_certificate).getNotAfter())); //$NON-NLS-1$ validity = StringModifier.change(validity,"%2", df.format(((X509Certificate)_certificate).getNotAfter())); //$NON-NLS-1$
@ -200,7 +200,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
if (_alias != null) if (_alias != null)
{ {
Label lblAlias = new Label(content, SWT.NONE); Label lblAlias = new Label(content, SWT.NONE);
lblAlias.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PROP_ALIAS_LBL)); lblAlias.setText(UniversalSecurityProperties.RESID_SECURITY_PROP_ALIAS_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
lblAlias.setLayoutData(data); lblAlias.setLayoutData(data);
@ -213,7 +213,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
} }
Label lblVersion = new Label(content, SWT.NONE); Label lblVersion = new Label(content, SWT.NONE);
lblVersion.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_CERTIF_VERSION_LBL)); lblVersion.setText(UniversalSecurityProperties.RESID_SECURITY_CERTIF_VERSION_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
lblVersion.setLayoutData(data); lblVersion.setLayoutData(data);
@ -225,7 +225,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblVersionValue.setLayoutData(data); lblVersionValue.setLayoutData(data);
Label lblIssuedTo = new Label(content, SWT.NONE); Label lblIssuedTo = new Label(content, SWT.NONE);
lblIssuedTo.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_ISSUED_TO_LBL)); lblIssuedTo.setText(UniversalSecurityProperties.RESID_SECURITY_ISSUED_TO_LBL);
data = new GridData(); data = new GridData();
data.verticalAlignment = GridData.BEGINNING; data.verticalAlignment = GridData.BEGINNING;
data.horizontalIndent = 5; data.horizontalIndent = 5;
@ -238,7 +238,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblIssuedToValue.setLayoutData(data); lblIssuedToValue.setLayoutData(data);
Label lblIssuedBy = new Label(content, SWT.NONE); Label lblIssuedBy = new Label(content, SWT.NONE);
lblIssuedBy.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_ISSUED_BY_LBL)); lblIssuedBy.setText(UniversalSecurityProperties.RESID_SECURITY_ISSUED_BY_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
data.verticalAlignment = GridData.BEGINNING; data.verticalAlignment = GridData.BEGINNING;
@ -251,7 +251,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblIssuedByValue.setLayoutData(data); lblIssuedByValue.setLayoutData(data);
Label lblValidity = new Label(content, SWT.NONE); Label lblValidity = new Label(content, SWT.NONE);
lblValidity.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_VALIDITY_LBL)); lblValidity.setText(UniversalSecurityProperties.RESID_SECURITY_VALIDITY_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
lblValidity.setLayoutData(data); lblValidity.setLayoutData(data);
@ -262,7 +262,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblValidityValue.setLayoutData(data); lblValidityValue.setLayoutData(data);
Label lblAlgorithm = new Label(content, SWT.NONE); Label lblAlgorithm = new Label(content, SWT.NONE);
lblAlgorithm.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_ALGORITHM_LBL)); lblAlgorithm.setText(UniversalSecurityProperties.RESID_SECURITY_ALGORITHM_LBL);
data = new GridData(); data = new GridData();
data.horizontalIndent = 5; data.horizontalIndent = 5;
lblAlgorithm.setLayoutData(data); lblAlgorithm.setLayoutData(data);
@ -278,7 +278,7 @@ public class CertificatePropertiesForm extends SystemBaseForm
lblIssuedByValue.setText(((X509Certificate)_certificate).getIssuerDN().getName()); lblIssuedByValue.setText(((X509Certificate)_certificate).getIssuerDN().getName());
DateFormat df = DateFormat.getDateInstance(DateFormat.LONG); DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
String validity = UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_VALIDITY_PERIOD); String validity = UniversalSecurityProperties.RESID_SECURITY_VALIDITY_PERIOD;
validity = StringModifier.change(validity,"%1", df.format(((X509Certificate)_certificate).getNotBefore())); //$NON-NLS-1$ validity = StringModifier.change(validity,"%1", df.format(((X509Certificate)_certificate).getNotBefore())); //$NON-NLS-1$
validity = StringModifier.change(validity,"%2", df.format(((X509Certificate)_certificate).getNotAfter())); //$NON-NLS-1$ validity = StringModifier.change(validity,"%2", df.format(((X509Certificate)_certificate).getNotAfter())); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. * Copyright (c) 2002, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [235626] Convert dstore.security to MessageBundle format
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.security.wizards; package org.eclipse.rse.internal.dstore.security.wizards;
@ -25,7 +25,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TableLayout; import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.Wizard;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityPlugin;
import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties; import org.eclipse.rse.internal.dstore.security.UniversalSecurityProperties;
import org.eclipse.rse.internal.dstore.security.preference.CertTableContentProvider; import org.eclipse.rse.internal.dstore.security.preference.CertTableContentProvider;
import org.eclipse.rse.internal.dstore.security.preference.X509CertificateElement; import org.eclipse.rse.internal.dstore.security.preference.X509CertificateElement;
@ -119,15 +118,15 @@ public class SystemImportCertWizardMainPage
TableLayout tableLayout = new TableLayout(); TableLayout tableLayout = new TableLayout();
TableColumn toColumn = new TableColumn(table, SWT.LEFT); TableColumn toColumn = new TableColumn(table, SWT.LEFT);
toColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_TO)); toColumn.setText(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_TO);
tableLayout.addColumnData(new ColumnPixelData(90)); tableLayout.addColumnData(new ColumnPixelData(90));
TableColumn frmColumn = new TableColumn(table, SWT.LEFT); TableColumn frmColumn = new TableColumn(table, SWT.LEFT);
frmColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_FROM)); frmColumn.setText(UniversalSecurityProperties.RESID_SECURITY_PREF_ISSUED_FROM);
tableLayout.addColumnData(new ColumnPixelData(90)); tableLayout.addColumnData(new ColumnPixelData(90));
TableColumn expColumn = new TableColumn(table, SWT.RIGHT); TableColumn expColumn = new TableColumn(table, SWT.RIGHT);
expColumn.setText(UniversalSecurityPlugin.getString(UniversalSecurityProperties.RESID_SECURITY_PREF_EXPIRES)); expColumn.setText(UniversalSecurityProperties.RESID_SECURITY_PREF_EXPIRES);
tableLayout.addColumnData(new ColumnPixelData(180)); tableLayout.addColumnData(new ColumnPixelData(180));
table.setLayout(tableLayout); table.setLayout(tableLayout);