Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Krasilnikov2008-04-07 15:18:43 +0000
committerOleg Krasilnikov2008-04-07 15:18:43 +0000
commit0df76bd7b0a35b9ce48808408099238a5a717e7b (patch)
treee3ffdf10b2986949a7afab71838bd821b423032b /core/org.eclipse.cdt.core
parente1cbe4d9da8de05ecafedcb7300caf8a0b3a9b25 (diff)
downloadorg.eclipse.cdt-0df76bd7b0a35b9ce48808408099238a5a717e7b.tar.gz
org.eclipse.cdt-0df76bd7b0a35b9ce48808408099238a5a717e7b.tar.xz
org.eclipse.cdt-0df76bd7b0a35b9ce48808408099238a5a717e7b.zip
Bug #206231 : The usability of the Environment variables dialogs is poor.
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java13
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/Messages.java22
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/messages.properties4
3 files changed, 39 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java
index b17ea40314..4a070146a6 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ContributedEnvironment.java
@@ -142,6 +142,19 @@ public class ContributedEnvironment implements IContributedEnvironment{
return false;
}
+ public String getOrigin(IEnvironmentVariable var) {
+ if(var instanceof EnvVarDescriptor) {
+ ICoreEnvironmentVariableSupplier sup = ((EnvVarDescriptor)var).getSupplier();
+ if (sup instanceof BuildSustemEnvironmentSupplier)
+ return Messages.getString("ContributedEnvironment.0"); //$NON-NLS-1$
+ if (sup instanceof EclipseEnvironmentSupplier)
+ return Messages.getString("ContributedEnvironment.1"); //$NON-NLS-1$
+ if (sup instanceof UserDefinedEnvironmentSupplier)
+ return Messages.getString("ContributedEnvironment.2"); //$NON-NLS-1$
+ }
+ return Messages.getString("ContributedEnvironment.3"); //$NON-NLS-1$
+ }
+
public void serialize(ICProjectDescription des){
EnvironmentVariableManager.fUserSupplier.storeProjectEnvironment(des, false);
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/Messages.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/Messages.java
new file mode 100644
index 0000000000..b768f1d1f3
--- /dev/null
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/Messages.java
@@ -0,0 +1,22 @@
+package org.eclipse.cdt.internal.core.envvar;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.envvar.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/messages.properties b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/messages.properties
new file mode 100644
index 0000000000..5893fb4711
--- /dev/null
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/messages.properties
@@ -0,0 +1,4 @@
+ContributedEnvironment.0=BUILD SYSTEM
+ContributedEnvironment.1=ECLIPSE ENV
+ContributedEnvironment.2=USER
+ContributedEnvironment.3=UNKNOWN

Back to the top