Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-04-12 06:16:49 -0400
committerUwe Stieber2013-04-12 06:16:49 -0400
commitccf1b162686a47401aee384afb648b699c030cc3 (patch)
treedeebbc1a34d6c67f01bb4ff3af4ef396fe07b0ad
parent902ec1e3a213082f30ce5c70157e1dc6c195c4c0 (diff)
downloadorg.eclipse.tcf-ccf1b162686a47401aee384afb648b699c030cc3.tar.gz
org.eclipse.tcf-ccf1b162686a47401aee384afb648b699c030cc3.tar.xz
org.eclipse.tcf-ccf1b162686a47401aee384afb648b699c030cc3.zip
Target Explorer: Fix bugzilla 405548 and rework default source lookup handling
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/META-INF/MANIFEST.MF2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/computers/SourcePathComputerDelegate.java83
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml456
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java350
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties80
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java125
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties3
12 files changed, 665 insertions, 472 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java
index bf4e8adba..2eaf96d58 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java
@@ -11,14 +11,32 @@ package org.eclipse.tcf.te.core.cdt;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
/**
* Provides CDT utilities.
*/
+@SuppressWarnings("deprecation")
public final class CdtUtils {
+ /**
+ * Returns the default source lookup directory providing access to the default
+ * source lookup setting within the preferences.
+ *
+ * @return The default source lookup director.
+ * @throws CoreException In case the operation fails.
+ */
public static ISourceLookupDirector getDefaultSourceLookupDirector() throws CoreException {
return CDebugCorePlugin.getDefault().getCommonSourceLookupDirector();
}
+
+ /**
+ * Provides access to the (deprecated) CDT debug core plugin preferences.
+ *
+ * @return The plugin preferences instance.
+ */
+ public static Preferences getDebugCorePluginPreferences() {
+ return CDebugCorePlugin.getDefault().getPluginPreferences();
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/META-INF/MANIFEST.MF
index 07f12c8c7..91f35811d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/META-INF/MANIFEST.MF
@@ -8,6 +8,7 @@ Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.core.expressions;bundle-version="3.4.400",
org.eclipse.debug.core;bundle-version="3.7.100",
+ org.eclipse.tcf.te.core.cdt;bundle-version="1.1.0",
org.eclipse.tcf.te.runtime;bundle-version="1.1.0",
org.eclipse.tcf.te.runtime.concurrent;bundle-version="1.1.0",
org.eclipse.tcf.te.runtime.model;bundle-version="1.1.0",
@@ -23,6 +24,7 @@ Export-Package: org.eclipse.tcf.te.launch.core.activator;x-internal:=true,
org.eclipse.tcf.te.launch.core.bindings,
org.eclipse.tcf.te.launch.core.bindings.interfaces,
org.eclipse.tcf.te.launch.core.bindings.internal;x-internal:=true,
+ org.eclipse.tcf.te.launch.core.computers,
org.eclipse.tcf.te.launch.core.delegates,
org.eclipse.tcf.te.launch.core.exceptions,
org.eclipse.tcf.te.launch.core.interfaces,
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml
index 97452e1eb..a3b561e6b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml
@@ -48,6 +48,14 @@
</propertyTester>
</extension>
+<!-- Source path computers contibutions -->
+ <extension point="org.eclipse.debug.core.sourcePathComputers">
+ <sourcePathComputer
+ class="org.eclipse.tcf.te.launch.core.computers.SourcePathComputerDelegate"
+ id="org.eclipse.tcf.te.launch.core.sourcePathComputer">
+ </sourcePathComputer>
+ </extension>
+
<!-- Launch Step contributions -->
<extension point="org.eclipse.tcf.te.runtime.stepper.steps">
<step
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/computers/SourcePathComputerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/computers/SourcePathComputerDelegate.java
new file mode 100644
index 000000000..257435209
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/computers/SourcePathComputerDelegate.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.launch.core.computers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
+import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
+import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
+import org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer;
+import org.eclipse.tcf.te.core.cdt.CdtUtils;
+import org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem;
+import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectsPersistenceDelegate;
+
+/**
+ * Computes default source path containers based on the CDT preferences.
+ */
+public class SourcePathComputerDelegate implements ISourcePathComputerDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
+ List<ISourceContainer> containers = new ArrayList<ISourceContainer>();
+
+ // Get the default CDT source lookup director to access the default source lookup
+ // settings from the preferences
+ ISourceLookupDirector director = CdtUtils.getDefaultSourceLookupDirector();
+ if (director != null) {
+ // Get the default source lookup containers
+ ISourceContainer[] candidates = director.getSourceContainers();
+ for (ISourceContainer candidate : candidates) {
+ // CProjectSourceContainer instances does not make sense for our launches
+ // as the container won't be able to identify the correct project. We
+ // are going to replace this source lookup container with ordinary project
+ // source lookup containers based on our referenced projects.
+ if ("CProjectSourceContainer".equals(candidate.getClass().getSimpleName())) { //$NON-NLS-1$
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+
+ // Get the list of referenced projects
+ IReferencedProjectItem[] items = ReferencedProjectsPersistenceDelegate.getReferencedProjects(configuration);
+ for (IReferencedProjectItem item : items) {
+ IProject project = root.getProject(item.getProjectName());
+ if (project != null && project.isAccessible()) {
+ ISourceContainer container = new ProjectSourceContainer(project, true);
+ if (!containers.contains(container)) containers.add(container);
+ }
+ }
+
+ continue;
+ }
+
+ // Just add the source container to the list of containers
+ if (!containers.contains(candidate)) containers.add(candidate);
+ }
+ }
+
+ // Fallback to the whole workspace if there are no default source
+ // lookup containers from the preferences
+ if (containers.size() == 0) {
+ containers.add(new WorkspaceSourceContainer());
+ }
+
+ return containers.toArray(new ISourceContainer[containers.size()]);
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
index dfbf2d8d8..c9e5f52bf 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
@@ -1,228 +1,228 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
-<!-- Adapter factory contributions -->
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.debug.core.ILaunch"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext"/>
- </factory>
- <factory
- adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.debug.core.ILaunchConfiguration"/>
- <adapter type="org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"/>
- </factory>
- </extension>
-
-<!-- Service contributions -->
- <extension point="org.eclipse.tcf.te.runtime.services.services">
- <service
- id="org.eclipse.tcf.te.tcf.launch.services.persistence.import"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.services.ImportPersistenceService">
- <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IImportPersistenceService"/>
- </service>
- <service
- id="org.eclipse.tcf.te.tcf.launch.services.persistence.export"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.services.ExportPersistenceService">
- <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IExportPersistenceService"/>
- </service>
- </extension>
-
-<!-- Launch Configuration Type contributions -->
- <extension point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app"
- sourceLocatorId="org.eclipse.tcf.debug.SourceLocator"
- sourcePathComputerId="org.eclipse.tcf.debug.SourcePathComputer"
- delegate="org.eclipse.tcf.te.tcf.launch.core.delegates.LaunchConfigurationDelegate"
- modes="run,debug"
- name="%LaunchType.Remote.App.name"/>
- <launchConfigurationType
- id="org.eclipse.tcf.te.tcf.launch.type.attach"
- public="false"
- sourceLocatorId="org.eclipse.tcf.debug.SourceLocator"
- sourcePathComputerId="org.eclipse.tcf.debug.SourcePathComputer"
- delegate="org.eclipse.tcf.te.tcf.launch.core.delegates.LaunchConfigurationDelegate"
- modes="debug"
- name="%LaunchType.Attach.name"/>
- </extension>
-
-<!-- Launch Configuration Type Binding contributions -->
- <extension point="org.eclipse.tcf.te.launch.core.launchConfigTypeBindings">
- <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app">
- <launchManagerDelegate
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"
- modes="run"/>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
- modes="run"/>
- <enablement>
- <with variable="context">
- <or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
- </adapt>
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <or>
- <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="Processes"/>
- <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
- </or>
- </and>
- </or>
- </with>
- </enablement>
- </launchConfigTypeBinding>
- <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app">
- <launchManagerDelegate
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"
- modes="debug"/>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
- modes="debug"/>
- <enablement>
- <with variable="context">
- <or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
- </adapt>
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <or>
- <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="Processes"/>
- <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
- </or>
- <or>
- <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="RunControl"/>
- <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="RunControl"/>
- </or>
- </and>
- </or>
- </with>
- </enablement>
- </launchConfigTypeBinding>
- <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.attach">
- <launchManagerDelegate
- id="org.eclipse.tcf.te.tcf.launch.type.attach.launchManagerDelegate"
- modes="debug"/>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.attach.stepGroup"
- modes="debug"/>
- <enablement>
- <with variable="context">
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- </with>
- </enablement>
- </launchConfigTypeBinding>
- </extension>
-
-<!-- Launch Manager Delegate contributions -->
- <extension point="org.eclipse.tcf.te.launch.core.launchManagerDelegates">
- <delegate
- class="org.eclipse.tcf.te.tcf.launch.core.lm.delegates.RemoteAppLaunchManagerDelegate"
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"/>
- <delegate
- class="org.eclipse.tcf.te.tcf.launch.core.lm.delegates.AttachLaunchManagerDelegate"
- id="org.eclipse.tcf.te.tcf.launch.type.attach.launchManagerDelegate"/>
- </extension>
-
-<!-- Launch Step Group contributions -->
- <extension point="org.eclipse.tcf.te.runtime.stepper.stepGroups">
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
- label="%LaunchStepGroup.Remote.App.name"
- iterator="org.eclipse.tcf.te.launch.core.steps.iterators.LaunchContextIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
- <reference id="org.eclipse.tcf.te.tcf.launch.core.fileTransferStepGroup"/>
- <reference id="org.eclipse.tcf.te.tcf.launch.core.launchProcessStepGroup"/>
- <reference id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep">
- <enablement>
- <with variable="context">
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </with>
- </enablement>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.core.closeChannelStep"/>
- <reference id="org.eclipse.tcf.te.launch.core.removeLaunchStep">
- <enablement>
- <with variable="context">
- <not>
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </not>
- </with>
- </enablement>
- </reference>
- </references>
- </stepGroup>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.core.launchProcessStepGroup"
- label="%LaunchStepGroup.LaunchProcess.name"
- iterator="org.eclipse.tcf.te.tcf.launch.core.steps.iterators.LaunchProcessIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
- <parameter name="remoteService" value="Processes"/>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
- <parameter name="remoteService" value="RunControl"/>
- <enablement>
- <with variable="context">
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </with>
- </enablement>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.processes.core.launchProcessStep"/>
- <reference id="org.eclipse.tcf.te.tcf.processes.core.resumeProcessStep">
- <enablement>
- <with variable="context">
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </with>
- </enablement>
- </reference>
- </references>
- </stepGroup>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.core.fileTransferStepGroup"
- label="%LaunchStepGroup.FileTransfer.name"
- iterator="org.eclipse.tcf.te.tcf.launch.core.steps.iterators.FileTransferIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
- <parameter name="remoteService" value="FileSystem"/>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.filesystem.core.fileTransferStep"/>
- </references>
- </stepGroup>
-
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.attach.stepGroup"
- label="%LaunchStepGroup.Attach.name"
- iterator="org.eclipse.tcf.te.launch.core.steps.iterators.LaunchContextIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
- <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
- <parameter name="remoteService" value="RunControl"/>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep">
- <enablement>
- <with variable="context">
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </with>
- </enablement>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.core.closeChannelStep"/>
- </references>
- </stepGroup>
- </extension>
-
-<!-- Launch Step contributions -->
- <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
- <step
- id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep"
- class="org.eclipse.tcf.te.tcf.launch.core.steps.AttachDebuggerStep"
- label="%LaunchStep.AttachDebugger.name"/>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+<!-- Adapter factory contributions -->
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.debug.core.ILaunch"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
+ <adapter type="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext"/>
+ </factory>
+ <factory
+ adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
+ <adapter type="org.eclipse.debug.core.ILaunchConfiguration"/>
+ <adapter type="org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"/>
+ </factory>
+ </extension>
+
+<!-- Service contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.services.services">
+ <service
+ id="org.eclipse.tcf.te.tcf.launch.services.persistence.import"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.services.ImportPersistenceService">
+ <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IImportPersistenceService"/>
+ </service>
+ <service
+ id="org.eclipse.tcf.te.tcf.launch.services.persistence.export"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.services.ExportPersistenceService">
+ <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IExportPersistenceService"/>
+ </service>
+ </extension>
+
+<!-- Launch Configuration Type contributions -->
+ <extension point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app"
+ sourceLocatorId="org.eclipse.tcf.debug.SourceLocator"
+ sourcePathComputerId="org.eclipse.tcf.te.launch.core.sourcePathComputer"
+ delegate="org.eclipse.tcf.te.tcf.launch.core.delegates.LaunchConfigurationDelegate"
+ modes="run,debug"
+ name="%LaunchType.Remote.App.name"/>
+ <launchConfigurationType
+ id="org.eclipse.tcf.te.tcf.launch.type.attach"
+ public="false"
+ sourceLocatorId="org.eclipse.tcf.debug.SourceLocator"
+ sourcePathComputerId="org.eclipse.tcf.te.launch.core.sourcePathComputer"
+ delegate="org.eclipse.tcf.te.tcf.launch.core.delegates.LaunchConfigurationDelegate"
+ modes="debug"
+ name="%LaunchType.Attach.name"/>
+ </extension>
+
+<!-- Launch Configuration Type Binding contributions -->
+ <extension point="org.eclipse.tcf.te.launch.core.launchConfigTypeBindings">
+ <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app">
+ <launchManagerDelegate
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"
+ modes="run"/>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
+ modes="run"/>
+ <enablement>
+ <with variable="context">
+ <or>
+ <adapt type="org.eclipse.core.resources.IResource">
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
+ </adapt>
+ <and>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <or>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="Processes"/>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
+ </or>
+ </and>
+ </or>
+ </with>
+ </enablement>
+ </launchConfigTypeBinding>
+ <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app">
+ <launchManagerDelegate
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"
+ modes="debug"/>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
+ modes="debug"/>
+ <enablement>
+ <with variable="context">
+ <or>
+ <adapt type="org.eclipse.core.resources.IResource">
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
+ </adapt>
+ <and>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <or>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="Processes"/>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
+ </or>
+ <or>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="RunControl"/>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="RunControl"/>
+ </or>
+ </and>
+ </or>
+ </with>
+ </enablement>
+ </launchConfigTypeBinding>
+ <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.attach">
+ <launchManagerDelegate
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.launchManagerDelegate"
+ modes="debug"/>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.stepGroup"
+ modes="debug"/>
+ <enablement>
+ <with variable="context">
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </with>
+ </enablement>
+ </launchConfigTypeBinding>
+ </extension>
+
+<!-- Launch Manager Delegate contributions -->
+ <extension point="org.eclipse.tcf.te.launch.core.launchManagerDelegates">
+ <delegate
+ class="org.eclipse.tcf.te.tcf.launch.core.lm.delegates.RemoteAppLaunchManagerDelegate"
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"/>
+ <delegate
+ class="org.eclipse.tcf.te.tcf.launch.core.lm.delegates.AttachLaunchManagerDelegate"
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.launchManagerDelegate"/>
+ </extension>
+
+<!-- Launch Step Group contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.stepGroups">
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
+ label="%LaunchStepGroup.Remote.App.name"
+ iterator="org.eclipse.tcf.te.launch.core.steps.iterators.LaunchContextIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.launch.core.fileTransferStepGroup"/>
+ <reference id="org.eclipse.tcf.te.tcf.launch.core.launchProcessStepGroup"/>
+ <reference id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep">
+ <enablement>
+ <with variable="context">
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </with>
+ </enablement>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.core.closeChannelStep"/>
+ <reference id="org.eclipse.tcf.te.launch.core.removeLaunchStep">
+ <enablement>
+ <with variable="context">
+ <not>
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </not>
+ </with>
+ </enablement>
+ </reference>
+ </references>
+ </stepGroup>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.core.launchProcessStepGroup"
+ label="%LaunchStepGroup.LaunchProcess.name"
+ iterator="org.eclipse.tcf.te.tcf.launch.core.steps.iterators.LaunchProcessIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
+ <parameter name="remoteService" value="Processes"/>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
+ <parameter name="remoteService" value="RunControl"/>
+ <enablement>
+ <with variable="context">
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </with>
+ </enablement>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.processes.core.launchProcessStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.processes.core.resumeProcessStep">
+ <enablement>
+ <with variable="context">
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </with>
+ </enablement>
+ </reference>
+ </references>
+ </stepGroup>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.core.fileTransferStepGroup"
+ label="%LaunchStepGroup.FileTransfer.name"
+ iterator="org.eclipse.tcf.te.tcf.launch.core.steps.iterators.FileTransferIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
+ <parameter name="remoteService" value="FileSystem"/>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.filesystem.core.fileTransferStep"/>
+ </references>
+ </stepGroup>
+
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.stepGroup"
+ label="%LaunchStepGroup.Attach.name"
+ iterator="org.eclipse.tcf.te.launch.core.steps.iterators.LaunchContextIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
+ <parameter name="remoteService" value="RunControl"/>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep">
+ <enablement>
+ <with variable="context">
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </with>
+ </enablement>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.core.closeChannelStep"/>
+ </references>
+ </stepGroup>
+ </extension>
+
+<!-- Launch Step contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
+ <step
+ id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep"
+ class="org.eclipse.tcf.te.tcf.launch.core.steps.AttachDebuggerStep"
+ label="%LaunchStep.AttachDebugger.name"/>
+ </extension>
+
+</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java
index e42042a10..577ec6cdf 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java
@@ -1,178 +1,172 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.tcf.launch.core.lm.delegates;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate;
-import org.eclipse.tcf.te.core.cdt.CdtUtils;
-import org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchContextLaunchAttributes;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
-import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.selection.interfaces.IRemoteSelectionContext;
-import org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
-import org.eclipse.tcf.te.runtime.services.interfaces.delegates.ILabelProviderDelegate;
-import org.eclipse.tcf.te.tcf.launch.core.interfaces.steps.ITcfLaunchStepAttributes;
-
-/**
- * RemoteAppLaunchManagerDelegate
- */
-public class AttachLaunchManagerDelegate extends DefaultLaunchManagerDelegate {
-
- // mandatory attributes for attach launch configurations
- private static final String[] MANDATORY_CONFIG_ATTRIBUTES = new String[] {
- ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS
- };
-
- /**
- * Constructor.
- */
- public AttachLaunchManagerDelegate() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#updateLaunchConfigAttributes(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
- */
- @Override
- public void updateLaunchConfigAttributes(ILaunchConfigurationWorkingCopy wc, ILaunchSpecification launchSpec) {
- super.updateLaunchConfigAttributes(wc, launchSpec);
-
- wc.setAttribute(ITcfLaunchStepAttributes.ATTR_ATTACH_SERVICES, (List<?>)null);
- wc.setAttribute(TCFLaunchDelegate.ATTR_DISCONNECT_ON_CTX_EXIT, false);
- copySpecToConfig(launchSpec, wc);
-
- wc.rename(getDefaultLaunchName(wc));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#initLaunchConfigAttributes(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
- */
- @Override
- public void initLaunchConfigAttributes(ILaunchConfigurationWorkingCopy wc, ILaunchSpecification launchSpec) {
- super.initLaunchConfigAttributes(wc, launchSpec);
-
- wc.setAttribute(ITcfLaunchStepAttributes.ATTR_ATTACH_SERVICES, (List<?>)null);
- wc.setAttribute(TCFLaunchDelegate.ATTR_DISCONNECT_ON_CTX_EXIT, false);
- try {
- wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, CdtUtils.getDefaultSourceLookupDirector().getMemento());
- }
- catch (Exception e) {
-
- }
- copySpecToConfig(launchSpec, wc);
-
- wc.rename(getDefaultLaunchName(wc));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#updateLaunchConfig(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext, boolean)
- */
- @Override
- public void updateLaunchConfig(ILaunchConfigurationWorkingCopy wc, ISelectionContext selContext, boolean replace) {
- super.updateLaunchConfig(wc, selContext, replace);
-
- if (selContext instanceof IRemoteSelectionContext) {
- IRemoteSelectionContext remoteCtx = (IRemoteSelectionContext)selContext;
- LaunchContextsPersistenceDelegate.setLaunchContexts(wc, new IModelNode[]{remoteCtx.getRemoteCtx()});
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#addLaunchSpecAttributes(org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification, java.lang.String, org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext)
- */
- @Override
- protected ILaunchSpecification addLaunchSpecAttributes(ILaunchSpecification launchSpec, String launchConfigTypeId, ISelectionContext selectionContext) {
- launchSpec = super.addLaunchSpecAttributes(launchSpec, launchConfigTypeId, selectionContext);
-
- if (selectionContext instanceof IRemoteSelectionContext) {
- List<IModelNode> launchContexts = new ArrayList<IModelNode>(Arrays.asList(LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec)));
- IModelNode remoteCtx = ((IRemoteSelectionContext)selectionContext).getRemoteCtx();
- if (!launchContexts.contains(remoteCtx)) {
- launchContexts.add(remoteCtx);
- LaunchContextsPersistenceDelegate.setLaunchContexts(launchSpec, launchContexts.toArray(new IModelNode[launchContexts.size()]));
- }
-
- launchSpec.setLaunchConfigName(getDefaultLaunchName(launchSpec));
- }
-
- return launchSpec;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDefaultLaunchName(org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
- */
- @Override
- public String getDefaultLaunchName(ILaunchSpecification launchSpec) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec);
- String name = getDefaultLaunchName((contexts != null && contexts.length > 0 ? contexts[0] : null));
- return name.trim().length() > 0 ? name.trim() : super.getDefaultLaunchName(launchSpec);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDefaultLaunchName(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public String getDefaultLaunchName(ILaunchConfiguration launchConfig) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchConfig);
- String name = getDefaultLaunchName((contexts != null && contexts.length > 0 ? contexts[0] : null));
- return name.trim().length() > 0 ? name.trim() : super.getDefaultLaunchName(launchConfig);
- }
-
- private String getDefaultLaunchName(IModelNode context) {
- if (context != null) {
- IUIService uiService = ServiceManager.getInstance().getService(context, IUIService.class);
- if (uiService != null) {
- ILabelProviderDelegate labelProviderDelegate = uiService.getDelegate(context, ILabelProviderDelegate.class);
- if (labelProviderDelegate != null) {
- return labelProviderDelegate.getText(context);
- }
- }
- return context.getName();
- }
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getMandatoryAttributes()
- */
- @Override
- protected List<String> getMandatoryAttributes() {
- return Arrays.asList(MANDATORY_CONFIG_ATTRIBUTES);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getNumAttributes()
- */
- @Override
- protected int getNumAttributes() {
- return 1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getAttributeRanking(java.lang.String)
- */
- @Override
- protected int getAttributeRanking(String attributeKey) {
- if (ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS.equals(attributeKey)) {
- return getNumAttributes() * 2;
- }
- return 1;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.tcf.launch.core.lm.delegates;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate;
+import org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchContextLaunchAttributes;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
+import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
+import org.eclipse.tcf.te.launch.core.selection.interfaces.IRemoteSelectionContext;
+import org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
+import org.eclipse.tcf.te.runtime.services.interfaces.delegates.ILabelProviderDelegate;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.steps.ITcfLaunchStepAttributes;
+
+/**
+ * RemoteAppLaunchManagerDelegate
+ */
+public class AttachLaunchManagerDelegate extends DefaultLaunchManagerDelegate {
+
+ // mandatory attributes for attach launch configurations
+ private static final String[] MANDATORY_CONFIG_ATTRIBUTES = new String[] {
+ ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS
+ };
+
+ /**
+ * Constructor.
+ */
+ public AttachLaunchManagerDelegate() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#updateLaunchConfigAttributes(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
+ */
+ @Override
+ public void updateLaunchConfigAttributes(ILaunchConfigurationWorkingCopy wc, ILaunchSpecification launchSpec) {
+ super.updateLaunchConfigAttributes(wc, launchSpec);
+
+ wc.setAttribute(ITcfLaunchStepAttributes.ATTR_ATTACH_SERVICES, (List<?>)null);
+ wc.setAttribute(TCFLaunchDelegate.ATTR_DISCONNECT_ON_CTX_EXIT, false);
+ copySpecToConfig(launchSpec, wc);
+
+ wc.rename(getDefaultLaunchName(wc));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#initLaunchConfigAttributes(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
+ */
+ @Override
+ public void initLaunchConfigAttributes(ILaunchConfigurationWorkingCopy wc, ILaunchSpecification launchSpec) {
+ super.initLaunchConfigAttributes(wc, launchSpec);
+
+ wc.setAttribute(ITcfLaunchStepAttributes.ATTR_ATTACH_SERVICES, (List<?>)null);
+ wc.setAttribute(TCFLaunchDelegate.ATTR_DISCONNECT_ON_CTX_EXIT, false);
+
+ copySpecToConfig(launchSpec, wc);
+
+ wc.rename(getDefaultLaunchName(wc));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#updateLaunchConfig(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext, boolean)
+ */
+ @Override
+ public void updateLaunchConfig(ILaunchConfigurationWorkingCopy wc, ISelectionContext selContext, boolean replace) {
+ super.updateLaunchConfig(wc, selContext, replace);
+
+ if (selContext instanceof IRemoteSelectionContext) {
+ IRemoteSelectionContext remoteCtx = (IRemoteSelectionContext)selContext;
+ LaunchContextsPersistenceDelegate.setLaunchContexts(wc, new IModelNode[]{remoteCtx.getRemoteCtx()});
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#addLaunchSpecAttributes(org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification, java.lang.String, org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext)
+ */
+ @Override
+ protected ILaunchSpecification addLaunchSpecAttributes(ILaunchSpecification launchSpec, String launchConfigTypeId, ISelectionContext selectionContext) {
+ launchSpec = super.addLaunchSpecAttributes(launchSpec, launchConfigTypeId, selectionContext);
+
+ if (selectionContext instanceof IRemoteSelectionContext) {
+ List<IModelNode> launchContexts = new ArrayList<IModelNode>(Arrays.asList(LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec)));
+ IModelNode remoteCtx = ((IRemoteSelectionContext)selectionContext).getRemoteCtx();
+ if (!launchContexts.contains(remoteCtx)) {
+ launchContexts.add(remoteCtx);
+ LaunchContextsPersistenceDelegate.setLaunchContexts(launchSpec, launchContexts.toArray(new IModelNode[launchContexts.size()]));
+ }
+
+ launchSpec.setLaunchConfigName(getDefaultLaunchName(launchSpec));
+ }
+
+ return launchSpec;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDefaultLaunchName(org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
+ */
+ @Override
+ public String getDefaultLaunchName(ILaunchSpecification launchSpec) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec);
+ String name = getDefaultLaunchName((contexts != null && contexts.length > 0 ? contexts[0] : null));
+ return name.trim().length() > 0 ? name.trim() : super.getDefaultLaunchName(launchSpec);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDefaultLaunchName(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public String getDefaultLaunchName(ILaunchConfiguration launchConfig) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchConfig);
+ String name = getDefaultLaunchName((contexts != null && contexts.length > 0 ? contexts[0] : null));
+ return name.trim().length() > 0 ? name.trim() : super.getDefaultLaunchName(launchConfig);
+ }
+
+ private String getDefaultLaunchName(IModelNode context) {
+ if (context != null) {
+ IUIService uiService = ServiceManager.getInstance().getService(context, IUIService.class);
+ if (uiService != null) {
+ ILabelProviderDelegate labelProviderDelegate = uiService.getDelegate(context, ILabelProviderDelegate.class);
+ if (labelProviderDelegate != null) {
+ return labelProviderDelegate.getText(context);
+ }
+ }
+ return context.getName();
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getMandatoryAttributes()
+ */
+ @Override
+ protected List<String> getMandatoryAttributes() {
+ return Arrays.asList(MANDATORY_CONFIG_ATTRIBUTES);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getNumAttributes()
+ */
+ @Override
+ protected int getNumAttributes() {
+ return 1;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getAttributeRanking(java.lang.String)
+ */
+ @Override
+ protected int getAttributeRanking(String attributeKey) {
+ if (ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS.equals(attributeKey)) {
+ return getNumAttributes() * 2;
+ }
+ return 1;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
index 14116d857..4a973bc9b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
org.eclipse.tcf.core;bundle-version="1.1.0",
org.eclipse.tcf.debug;bundle-version="1.1.0",
org.eclipse.tcf.debug.ui;bundle-version="1.1.0",
+ org.eclipse.tcf.te.core.cdt;bundle-version="1.1.0",
org.eclipse.tcf.te.launch.core;bundle-version="1.1.0",
org.eclipse.tcf.te.launch.ui;bundle-version="1.1.0",
org.eclipse.tcf.te.runtime;bundle-version="1.1.0",
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
index 6a3ae043c..3d563eb11 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
@@ -1,40 +1,40 @@
-##################################################################################
-# Copyright (c) 2011, 2012 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-##################################################################################
-
-pluginName = Target Explorer, TCF Launching, UI
-providerName = Eclipse.org - Target Explorer
-
-# ***** Editor Pages *****
-
-MemoryMapEditorPage.name=Symbol Files
-PathMapEditorPage.name=Object Pathes
-SourceLookupEditorPage.name=Source Pathes
-
-# ***** Command contributions *****
-
-Command.showInDebugView.name=Show In Debug View Command
-Command.showInDebugView.description=Show the selection in the Debug View.
-
-LauchTree.name=Launches
-
-LaunchShortcut.Remote.App.name=Remote Application
-
-command.run.name=Run Remote Application
-command.debug.name=Debug Remote Application
-
-menu.diagnostics.label=Diagnostics
-
-command.runtests.name=Run Diagnostics Tests Command
-command.runtests.label=Run Tests
-command.runtests.tooltip=Run Diagnostics Tests on the selected Peer
-
-command.runtestsloop.name=Run Diagnostics Tests Loop Command
-command.runtestsloop.label=Run Tests Loop
-command.runtestsloop.tooltip=Run Diagnostics Tests in a loop on the selected Peer
+##################################################################################
+# Copyright (c) 2011, 2012 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, TCF Launching, UI
+providerName = Eclipse.org - Target Explorer
+
+# ***** Editor Pages *****
+
+MemoryMapEditorPage.name=Symbol Files
+PathMapEditorPage.name=Object Paths
+SourceLookupEditorPage.name=Source Paths
+
+# ***** Command contributions *****
+
+Command.showInDebugView.name=Show In Debug View Command
+Command.showInDebugView.description=Show the selection in the Debug View.
+
+LauchTree.name=Launches
+
+LaunchShortcut.Remote.App.name=Remote Application
+
+command.run.name=Run Remote Application
+command.debug.name=Debug Remote Application
+
+menu.diagnostics.label=Diagnostics
+
+command.runtests.name=Run Diagnostics Tests Command
+command.runtests.label=Run Tests
+command.runtests.tooltip=Run Diagnostics Tests on the selected Peer
+
+command.runtestsloop.name=Run Diagnostics Tests Loop Command
+command.runtestsloop.label=Run Tests Loop
+command.runtestsloop.tooltip=Run Diagnostics Tests in a loop on the selected Peer
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java
index bc8487db6..9361050bb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/SourceLookupEditorPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
@@ -9,47 +9,120 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.ui.editor;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
+import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.core.cdt.CdtUtils;
+import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
/**
* Source lookup launch configuration tab container page implementation.
*/
-@SuppressWarnings("restriction")
+@SuppressWarnings({ "restriction", "deprecation" })
public class SourceLookupEditorPage extends AbstractTcfLaunchTabContainerEditorPage {
+ /**
+ * Extension to the standard source lookup panel to be embedded into an editor page
+ */
+ protected static class EditorSourceLookupPanel extends SourceLookupPanel {
+ private final AbstractTcfLaunchTabContainerEditorPage editorPage;
+ private IPropertyChangeListener listener;
+
+ /**
+ * Constructor
+ *
+ * @param editorPage The parent editor page. Must not be <code>null</code>.
+ */
+ public EditorSourceLookupPanel(AbstractTcfLaunchTabContainerEditorPage editorPage) {
+ super();
+
+ Assert.isNotNull(editorPage);
+ this.editorPage = editorPage;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (listener != null) {
+ Preferences prefs = CdtUtils.getDebugCorePluginPreferences();
+ if (prefs != null) prefs.removePropertyChangeListener(listener);
+ listener = null;
+ }
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ ((Composite)getControl()).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // Create the preferences listener
+ listener = new IPropertyChangeListener() {
+
+ @SuppressWarnings("synthetic-access")
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ if ("org.eclipse.cdt.debug.core.cDebug.default_source_containers".equals(event.getProperty())) { //$NON-NLS-1$
+ initializeFrom(getLaunchConfig(editorPage.getPeerModel(editorPage.getEditorInput())));
+ //fPathViewer.refresh(true);
+ }
+ }
+ };
+
+ // Register preferences listener.
+ // Note the the CDT debug core plugin still uses the deprecated plugin preferences.
+ Preferences prefs = CdtUtils.getDebugCorePluginPreferences();
+ if (prefs != null) prefs.addPropertyChangeListener(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel#getName()
+ */
+ @Override
+ public String getName() {
+ return Messages.SourceLookupEditorPage_name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel#updateLaunchConfigurationDialog()
+ */
+ @Override
+ protected void updateLaunchConfigurationDialog() {
+ super.updateLaunchConfigurationDialog();
+ performApply(getLaunchConfig(editorPage.getPeerModel(editorPage.getEditorInput())));
+ editorPage.checkLaunchConfigDirty();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ boolean oldDirty = editorPage.getEditor().isDirty() || editorPage.checkLaunchConfigDirty();
+ super.initializeFrom(configuration);
+ if (!oldDirty && editorPage.checkLaunchConfigDirty()) {
+ editorPage.extractData();
+ }
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#createLaunchConfigurationTab()
*/
@Override
protected AbstractLaunchConfigurationTab createLaunchConfigurationTab() {
- return new SourceLookupPanel() {
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
- ((Composite)getControl()).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- }
- @Override
- protected void updateLaunchConfigurationDialog() {
- super.updateLaunchConfigurationDialog();
- performApply(getLaunchConfig(getPeerModel(getEditorInput())));
- checkLaunchConfigDirty();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public void initializeFrom(ILaunchConfiguration configuration) {
- boolean oldDirty = getEditor().isDirty() || checkLaunchConfigDirty();
- super.initializeFrom(configuration);
- if (!oldDirty && checkLaunchConfigDirty()) {
- extractData();
- }
- }
- };
+ return new EditorSourceLookupPanel(this);
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
index a66550be9..3565e154d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
@@ -55,6 +55,14 @@ public class PathMapTab extends TCFPathMapTab {
}
/* (non-Javadoc)
+ * @see org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab#getName()
+ */
+ @Override
+ public String getName() {
+ return Messages.PathMapEditorPage_name;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab#createControl(org.eclipse.swt.widgets.Composite)
*/
@Override
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
index 25075c3cd..cbc3136b0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
@@ -95,10 +95,13 @@ public class Messages extends NLS {
public static String LaunchConfigurationAdvancedTabSection_lineseparator_crlf;
public static String LaunchConfigurationAdvancedTabSection_lineseparator_cr;
+ public static String PathMapEditorPage_name;
// public static String PathMapEditorPage_column_source;
// public static String PathMapEditorPage_column_destination;
public static String PathMapEditorPage_column_contextquery;
+ public static String SourceLookupEditorPage_name;
+
public static String AbstractDiagnosticsCommandHandler_progress_title;
public static String AbstractDiagnosticsCommandHandler_progress_button_cancel;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
index d677eaf16..3e9abe0b1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
@@ -36,9 +36,12 @@ LaunchConfigurationAdvancedTabSection_lineseparator_lf=LF
LaunchConfigurationAdvancedTabSection_lineseparator_crlf=CRLF
LaunchConfigurationAdvancedTabSection_lineseparator_cr=CR
+PathMapEditorPage_name=Object Paths
#PathMapEditorPage_column_source=Local
#PathMapEditorPage_column_destination=Origin
PathMapEditorPage_column_contextquery=Context Query
+SourceLookupEditorPage_name=Source Paths
+
AbstractDiagnosticsCommandHandler_progress_title=Running Diagnostics...
AbstractDiagnosticsCommandHandler_progress_button_cancel=&Cancel

Back to the top