diff options
author | Vivian Kong | 2009-08-28 19:38:47 +0000 |
---|---|---|
committer | Vivian Kong | 2009-08-28 19:38:47 +0000 |
commit | 2ca67d781f25cf5fcad2fc1c74d24715544ab7b1 (patch) | |
tree | 31f07aaf2c11733f0c69992b37af7c4dfc51c5ab /xlc | |
parent | 47f2fb94b4e751543ac51c402aaa410c89e55fb0 (diff) | |
download | org.eclipse.cdt-2ca67d781f25cf5fcad2fc1c74d24715544ab7b1.tar.gz org.eclipse.cdt-2ca67d781f25cf5fcad2fc1c74d24715544ab7b1.tar.xz org.eclipse.cdt-2ca67d781f25cf5fcad2fc1c74d24715544ab7b1.zip |
bug 288005 - separate XLC compiler version number with its label for translation
Diffstat (limited to 'xlc')
8 files changed, 44 insertions, 23 deletions
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties index 83b6bc7d139..018e0aa5604 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties @@ -8,11 +8,10 @@ # Contributors: # IBM Corporation - initial API and implementation ############################################################################### -# START NON-TRANSLATABLE -XLCompiler_v8=v8.0 -XLCompiler_v9=v9.0 + +XLCompiler_v8=8.0 +XLCompiler_v9=9.0 XLCompiler_v10=v10.1 -# END NON-TRANSLATABLE XLCompilerPreferencePage_0=XL C/C++ Compiler Preferences XLCompilerPreferencePage_1=Compiler Root Path: XLCompilerPreferencePage_2=Compiler Version: diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java index a73dd79cb46..551e32d96f3 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2009 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 @@ -21,9 +21,31 @@ public class PreferenceConstants { public static final String P_XL_COMPILER_ROOT = "XL_compilerRoot"; //$NON-NLS-1$ public static final String P_XLC_COMPILER_VERSION = "XLC_compilerVersion"; //$NON-NLS-1$ + + public static final String P_XL_COMPILER_VERSION_8 = "v8.0"; //$NON-NLS-1$ + public static final String P_XL_COMPILER_VERSION_9 = "v9.0"; //$NON-NLS-1$ + public static final String P_XL_COMPILER_VERSION_10 = "v10.1"; //$NON-NLS-1$ public static final String P_XL_COMPILER_VERSION_8_NAME = Messages.XLCompiler_v8; public static final String P_XL_COMPILER_VERSION_9_NAME = Messages.XLCompiler_v9; public static final String P_XL_COMPILER_VERSION_10_NAME = Messages.XLCompiler_v10; + + public static String getVersion (String label) { + if (label.equalsIgnoreCase(P_XL_COMPILER_VERSION_10_NAME)) + return P_XL_COMPILER_VERSION_10; + else if (label.equalsIgnoreCase(P_XL_COMPILER_VERSION_9_NAME)) + return P_XL_COMPILER_VERSION_9; + else + return P_XL_COMPILER_VERSION_8; + } + + public static String getVersionLabel (String version) { + if (version.equalsIgnoreCase(P_XL_COMPILER_VERSION_10)) + return P_XL_COMPILER_VERSION_10_NAME; + else if (version.equalsIgnoreCase(P_XL_COMPILER_VERSION_9)) + return P_XL_COMPILER_VERSION_9_NAME; + else + return P_XL_COMPILER_VERSION_8_NAME; + } } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java index dd719712809..2f6a8679b24 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2009 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 @@ -29,7 +29,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { public void initializeDefaultPreferences() { IPreferenceStore store = XLCUIPlugin.getDefault().getPreferenceStore(); store.setDefault(PreferenceConstants.P_XL_COMPILER_ROOT, "/opt/ibmcmp"); //$NON-NLS-1$ - store.setDefault(PreferenceConstants.P_XLC_COMPILER_VERSION, PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME); + store.setDefault(PreferenceConstants.P_XLC_COMPILER_VERSION, PreferenceConstants.P_XL_COMPILER_VERSION_8); } } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java index 240b8a833f7..3635b4358de 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2009 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 @@ -79,9 +79,9 @@ public class XLCompilerPreferencePage addField(pathEditor); - String[][] versionEntries = {{PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, Messages.XLCompiler_v8}, - {PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, Messages.XLCompiler_v9}, - {PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME, Messages.XLCompiler_v10}}; + String[][] versionEntries = {{PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_8}, + {PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_9}, + {PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_10}}; addField(new ComboFieldEditor(PreferenceConstants.P_XLC_COMPILER_VERSION, Messages.XLCompilerPreferencePage_2, versionEntries, getFieldEditorParent())); diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java index 86d6b8e2b67..65bdded5b2f 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java @@ -23,7 +23,6 @@ import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.preference.DirectoryFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchPropertyPage; @@ -113,7 +112,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements } Combo versionCombo = fVersionEditor.getComboControl(versionParent); - versionCombo.setText(currentVersion); + versionCombo.setText(PreferenceConstants.getVersionLabel(currentVersion)); } @@ -139,10 +138,11 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore(); String currentPath = prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT); String currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); + String currentVersionLabel = PreferenceConstants.getVersionLabel(currentVersion); fPathEditor.setStringValue(currentPath); - fVersionEditor.getComboControl(getFieldEditorParent()).setText(currentVersion); + fVersionEditor.getComboControl(getFieldEditorParent()).setText(currentVersionLabel); } @@ -158,9 +158,9 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements PreferenceConstants.P_XL_COMPILER_ROOT), fPathEditor .getStringValue()); + String version = PreferenceConstants.getVersion(fVersionEditor.getSelection()); project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$ - PreferenceConstants.P_XLC_COMPILER_VERSION), fVersionEditor - .getSelection()); + PreferenceConstants.P_XLC_COMPILER_VERSION), version); } catch (CoreException e) { return false; } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java index 000af9e110d..514ed3bd82f 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java @@ -53,7 +53,7 @@ public class XLCv8ApplicabiltyCalculator implements IOptionApplicability { currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); } - if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME)) + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_8)) return true; } @@ -81,7 +81,7 @@ public class XLCv8ApplicabiltyCalculator implements IOptionApplicability { currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); } - if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME)) + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_8)) return true; } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java index 9d713dd5ed8..f92514adbc7 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java @@ -55,7 +55,7 @@ public class XLCv9ApplicabilityCalculator implements IOptionApplicability { currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); } - if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME)) + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_9)) return true; } @@ -83,7 +83,7 @@ public class XLCv9ApplicabilityCalculator implements IOptionApplicability { currentVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); } - if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME)) + if(currentVersion.equals(PreferenceConstants.P_XL_COMPILER_VERSION_9)) return true; } diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java index 24849ad9fe8..da6c672cd5a 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java @@ -176,16 +176,16 @@ public class XLCSettingsWizardPage extends MBSCustomPage { // set the default based on the workbench preference String compilerVersion = prefStore.getString(PreferenceConstants.P_XLC_COMPILER_VERSION); - fVersionCombo.setText(compilerVersion); + fVersionCombo.setText(PreferenceConstants.getVersionLabel(compilerVersion)); // update the page manager with the setting - MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, fVersionCombo.getText()); + MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, PreferenceConstants.getVersion(fVersionCombo.getText())); fVersionCombo.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { // update the page manager with the setting - MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, fVersionCombo.getText()); + MBSCustomPageManager.addPageProperty(pageID, PreferenceConstants.P_XLC_COMPILER_VERSION, PreferenceConstants.getVersion(fVersionCombo.getText())); } |