Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to '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
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java15
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/MultiCfgContributedEnvironment.java7
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties1
6 files changed, 60 insertions, 2 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 b17ea403147..4a070146a65 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 00000000000..b768f1d1f3c
--- /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 00000000000..5893fb4711d
--- /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
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java
index 3fee728cf25..ec97c2c4616 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java
@@ -108,6 +108,8 @@ public class EnvironmentTab extends AbstractCPropertyTab {
if(td.var.getOperation() == IEnvironmentVariable.ENVVAR_REMOVE)
return UIMessages.getString(VALUE_UNDEF);
return td.var.getValue();
+ case 2:
+ return ce.getOrigin(td.var);
}
return EMPTY_STR;
}
@@ -129,6 +131,8 @@ public class EnvironmentTab extends AbstractCPropertyTab {
if(td.var.getOperation() == IEnvironmentVariable.ENVVAR_REMOVE)
f = JFaceResources.getFontRegistry().getItalic(JFaceResources.DIALOG_FONT);
break;
+ case 2:
+ return null;
}
return f;
}
@@ -180,10 +184,15 @@ public class EnvironmentTab extends AbstractCPropertyTab {
// add headers
TableColumn tc = new TableColumn(table, SWT.LEFT);
tc.setText(UIMessages.getString("EnvironmentTab.1")); //$NON-NLS-1$
- tc.setWidth(200);
+ tc.setWidth(150);
tc = new TableColumn(table, SWT.LEFT);
tc.setText(UIMessages.getString("EnvironmentTab.2")); //$NON-NLS-1$
- tc.setWidth(200);
+ tc.setWidth(150);
+ if (this.getResDesc() != null) {
+ tc = new TableColumn(table, SWT.LEFT);
+ tc.setText(UIMessages.getString("EnvironmentTab.16")); //$NON-NLS-1$
+ tc.setWidth(100);
+ }
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 2;
@@ -191,6 +200,7 @@ public class EnvironmentTab extends AbstractCPropertyTab {
b1 = new Button(usercomp, SWT.RADIO);
b1.setText(UIMessages.getString("EnvironmentTab.3")); //$NON-NLS-1$
+ b1.setToolTipText(UIMessages.getString("EnvironmentTab.3")); //$NON-NLS-1$
b1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b1.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -212,6 +222,7 @@ public class EnvironmentTab extends AbstractCPropertyTab {
b2 = new Button(usercomp, SWT.RADIO);
b2.setText(UIMessages.getString("EnvironmentTab.4")); //$NON-NLS-1$
+ b2.setToolTipText(UIMessages.getString("EnvironmentTab.4")); //$NON-NLS-1$
b2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b2.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/MultiCfgContributedEnvironment.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/MultiCfgContributedEnvironment.java
index 5051ad09d0f..8b16f08b467 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/MultiCfgContributedEnvironment.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/MultiCfgContributedEnvironment.java
@@ -20,6 +20,8 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
import org.eclipse.cdt.core.settings.model.MultiItemsHolder;
+import org.eclipse.cdt.internal.core.envvar.ContributedEnvironment;
+
/**
*
*
@@ -188,4 +190,9 @@ public class MultiCfgContributedEnvironment implements IContributedEnvironment {
doReplace(des);
}
+ public String getOrigin(IEnvironmentVariable var) {
+ if (ice instanceof ContributedEnvironment)
+ return ((ContributedEnvironment)ice).getOrigin(var);
+ return AbstractPage.EMPTY_STR;
+ }
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties
index 48b03a3354e..2aa9a57553c 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties
@@ -464,6 +464,7 @@ EnvironmentTab.12=Variables list
EnvironmentTab.13=Add to all configurations
EnvironmentTab.14=Select variables
EnvironmentTab.15=Current String List DISPLAY mode. Double-click to change
+EnvironmentTab.16=Origin
EnvironmentTab.17=CONJUNCTION
EnvironmentTab.18=DISJUNCTION
EnvironmentTab.19=DISPLAY mode:

Back to the top