Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivian Kong2009-08-28 15:38:36 -0400
committerVivian Kong2009-08-28 15:38:36 -0400
commit3e41154b930f4cf1226a0be70da021fe48524e6e (patch)
tree8012453e1ef64ad9179f872aa9682681863bd029
parent544abcb74ce319d02565f89207073953226c1f44 (diff)
downloadorg.eclipse.cdt-3e41154b930f4cf1226a0be70da021fe48524e6e.tar.gz
org.eclipse.cdt-3e41154b930f4cf1226a0be70da021fe48524e6e.tar.xz
org.eclipse.cdt-3e41154b930f4cf1226a0be70da021fe48524e6e.zip
bug 288005 - separate XLC compiler version number with its label for translation
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties7
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceConstants.java24
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/PreferenceInitializer.java4
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/preferences/XLCompilerPreferencePage.java8
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java10
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv8ApplicabiltyCalculator.java4
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCv9ApplicabilityCalculator.java4
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/wizards/XLCSettingsWizardPage.java6
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 83b6bc7d13..018e0aa560 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 a73dd79cb4..551e32d96f 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 dd71971280..2f6a8679b2 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 240b8a833f..3635b4358d 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 86d6b8e2b6..65bdded5b2 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 000af9e110..514ed3bd82 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 9d713dd5ed..f92514adbc 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 24849ad9fe..da6c672cd5 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()));
}

Back to the top