aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2012-09-06 12:37:08 (EDT)
committerRoland Grunberg2012-09-06 13:09:26 (EDT)
commit32d88f8edfe086bc3f1a755aedda6917a9964fa7 (patch)
tree557154f4001e08cfde6d24018c356126f7324dfd
parent855342bacba1acd9f325182f573da7ccae698df7 (diff)
downloadorg.eclipse.linuxtools-32d88f8edfe086bc3f1a755aedda6917a9964fa7.zip
org.eclipse.linuxtools-32d88f8edfe086bc3f1a755aedda6917a9964fa7.tar.gz
org.eclipse.linuxtools-32d88f8edfe086bc3f1a755aedda6917a9964fa7.tar.bz2
Apply plug-in specific shortcut attributes only when launching shorcuts.
Since shortcuts do not set the "provider" attribute in their respective configurations, a provider id is needed to get a shortcut and apply plug-in specific attributes. Configurations that have the "provider" attribute set are not shortcuts, and therefore do no need plug-in specific attributes to be applied. Change-Id: I5bcbe5a35bb7f245eac6be150ba643274744b43b Reviewed-on: https://git.eclipse.org/r/7642 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com> IP-Clean: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java16
2 files changed, 12 insertions, 6 deletions
diff --git a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java
index 9d99403..9de8c1a 100644
--- a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java
+++ b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java
@@ -41,7 +41,7 @@ public abstract class ProviderOptionsTab extends ProfileLaunchConfigurationTab {
HashMap<String, String> comboItems;
CTabFolder tabgroup;
Boolean initialized;
- private static final String PROVIDER_CONFIG_ATT = "provider"; //$NON-NLS-1$
+ public static final String PROVIDER_CONFIG_ATT = "provider"; //$NON-NLS-1$
public void createControl(Composite parent) {
top = new Composite(parent, SWT.NONE);
diff --git a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java
index ce12605..4b3077e 100644
--- a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java
+++ b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.linuxtools.internal.profiling.provider.AbstractProviderPreferencesPage;
+import org.eclipse.linuxtools.internal.profiling.provider.ProviderOptionsTab;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationDelegate;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationTabGroup;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut;
@@ -31,14 +32,19 @@ public abstract class ProviderLaunchConfigurationDelegate extends
if (config != null) {
// get provider id from configuration.
String providerId = config.getAttribute(
- AbstractProviderPreferencesPage.PREFS_KEY, "");
+ ProviderOptionsTab.PROVIDER_CONFIG_ATT, "");
+
+ // the provider attribute is only set when launching from the
+ // dialog menu, if it's not set then we are launching from a
+ // shortcut.
if (providerId.equals("")) {
+ // acquire a provider id to run.
providerId = getProviderIdToRun();
+ // get configuration shortcut associated with provider id.
+ ProfileLaunchShortcut shortcut= ProfileLaunchShortcut.getLaunchShortcutProviderFromId(providerId);
+ // set attributes related to the specific profiling shortcut configuration.
+ shortcut.setDefaultProfileLaunchShortcutAttributes(config);
}
- // get configuration delegate associated with provider id.
- ProfileLaunchShortcut shortcut= ProfileLaunchShortcut.getLaunchShortcutProviderFromId(providerId);
- // set attributes related to the specific profiling shortcut configuration.
- shortcut.setDefaultProfileLaunchShortcutAttributes(config);
// get delegate associated with provider id.
ProfileLaunchConfigurationDelegate delegate = getConfigurationDelegateFromId(providerId);