Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Burns2004-12-07 22:22:09 +0000
committerJared Burns2004-12-07 22:22:09 +0000
commit19ad8d0bc7e76ca4aad1a601f6b685d0a7b2e879 (patch)
tree77a37bf00ee2e62c51347e65fdf510de61e68a04
parent335e5217e2c31d152972bd10c8da2e329c21bebe (diff)
downloadeclipse.platform.debug-19ad8d0bc7e76ca4aad1a601f6b685d0a7b2e879.tar.gz
eclipse.platform.debug-19ad8d0bc7e76ca4aad1a601f6b685d0a7b2e879.tar.xz
eclipse.platform.debug-19ad8d0bc7e76ca4aad1a601f6b685d0a7b2e879.zip
Bug 45977 - Contribute variables should indicate the plugin that contributed them
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java10
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java7
4 files changed, 30 insertions, 2 deletions
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
index aa646f7d0..b29ce4e9c 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
@@ -555,4 +555,14 @@ public class StringVariableManager implements IStringVariableManager {
public void validateStringVariables(String expression) throws CoreException {
new StringSubstitutionEngine().validateStringVariables(expression, this);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.variables.IStringVariableManager#getContributingPluginId(org.eclipse.core.variables.IStringVariable)
+ */
+ public String getContributingPluginId(IStringVariable variable) {
+ if (variable instanceof StringVariable) {
+ return ((StringVariable) variable).getConfigurationElement().getNamespace();
+ }
+ return null;
+ }
}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
index 8d0a311c8..de36166fb 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
@@ -71,6 +71,18 @@ public interface IStringVariableManager {
* if none
*/
public IDynamicVariable getDynamicVariable(String name);
+
+ /**
+ * Returns the plugin identifier of the plugin that contributed the
+ * given variable via extension or <code>null</code> if the given
+ * variable wasn't contributed via extension.
+ *
+ * @param variable the variable
+ * @return the plugin identifier of the plugin that contributed the
+ * given variable or <code>null</code>
+ * @since 3.1
+ */
+ public String getContributingPluginId(IStringVariable variable);
/**
* Recursively resolves and replaces all variable references in the given
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
index 77d7d3df6..ff36f8e99 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
@@ -80,9 +80,10 @@ SimpleVariablePreferencePage.15=Overwrite variable?
SimpleVariablePreferencePage.16=A variable named {0} already exists. Overwrite?
SimpleLaunchVariablePreferencePage.21=Remove Contributed Variables
SimpleLaunchVariablePreferencePage.22=The following variables were contributed by plug-ins. Removing them may cause unknown problems.\n{0}\nProceed?
-SimpleLaunchVariablePreferencePage.23=\ (contributed)
+SimpleLaunchVariablePreferencePage.23=\ [contributed]
StringVariablePreferencePage.24=Error
StringVariablePreferencePage.25=Unable to save changes
+StringVariablePreferencePage.0=\ [contributed by {0}]
ViewManagementPreferencePage.0=The Debug View can automatically open and close views based on selection. Choose in which perspectives this feature should be enabled:
ViewManagementPreferencePage.1=View Management
ViewManagementPreferencePage.2=&Perspectives:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
index c883ef12c..4cc2b3a53 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
@@ -488,7 +488,12 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
case 0 :
StringBuffer buffer= new StringBuffer(variable.getName());
if (variable.isContributed()) {
- buffer.append(DebugPreferencesMessages.getString("SimpleLaunchVariablePreferencePage.23")); //$NON-NLS-1$
+ String pluginId = getVariableManager().getContributingPluginId(variable);
+ if (pluginId != null) {
+ buffer.append(MessageFormat.format(DebugPreferencesMessages.getString("StringVariablePreferencePage.0"), new String[] {pluginId})); //$NON-NLS-1$
+ } else {
+ buffer.append(DebugPreferencesMessages.getString("SimpleLaunchVariablePreferencePage.23")); //$NON-NLS-1$
+ }
}
return buffer.toString();
case 1:

Back to the top