aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-05-10 01:56:10 (EDT)
committerUwe Stieber2012-05-10 01:56:10 (EDT)
commit5c52e55eec4b75d7d0135e56943f6c80d2753548 (patch)
tree27d60fc2b6053960ac24228a133e2a1be7999b15
parent642b08adcd2d525d0dbf24ecb172cd278b050aa3 (diff)
downloadorg.eclipse.tcf-5c52e55eec4b75d7d0135e56943f6c80d2753548.zip
org.eclipse.tcf-5c52e55eec4b75d7d0135e56943f6c80d2753548.tar.gz
org.eclipse.tcf-5c52e55eec4b75d7d0135e56943f6c80d2753548.tar.bz2
Target Explorer: ADD correct breakpoint at main after debug remote app
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/plugin.xml15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/properties/LaunchContextPropertiesSection.java15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/viewer/LaunchNavigatorContentProvider.java37
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/selection/LaunchSelectionManager.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/ICommonTCFLaunchAttributes.java28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/services/DebugService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java52
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/CloseChannelStep.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java7
-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.xml9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/adapters/AdapterFactory.java44
12 files changed, 168 insertions, 70 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/plugin.xml
index 70c3f82..cfa8ee1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/plugin.xml
@@ -92,15 +92,16 @@
id="launchConfigurations"
labelProvider="org.eclipse.tcf.te.launch.ui.internal.viewer.LaunchTreeLabelProvider"
name="%LauchEditorPage.column.name"
- width="400">
+ width="250">
</column>
<column
id="description"
labelProvider="org.eclipse.tcf.te.launch.ui.internal.viewer.DescriptionColumnLabelProvider"
name="%LauchEditorPage.column.description"
- width="400">
+ width="300">
</column>
<column
+ visible="false"
id="lastLaunched"
labelProvider="org.eclipse.tcf.te.launch.ui.internal.viewer.LastLaunchedColumnLabelProvider"
name="%LauchEditorPage.column.lastLaunched"
@@ -584,7 +585,10 @@
<iterate
operator="and"
ifEmpty="false">
- <test property="org.eclipse.tcf.te.launch.ui.model.isValidLaunchConfig" value="run"/>
+ <and>
+ <test property="org.eclipse.tcf.te.launch.ui.model.isLaunchConfig"/>
+ <test property="org.eclipse.tcf.te.launch.ui.model.isValidLaunchConfig" value="run"/>
+ </and>
</iterate>
</with>
</enabledWhen>
@@ -605,7 +609,10 @@
<iterate
operator="and"
ifEmpty="false">
- <test property="org.eclipse.tcf.te.launch.ui.model.isValidLaunchConfig" value="debug"/>
+ <and>
+ <test property="org.eclipse.tcf.te.launch.ui.model.isLaunchConfig"/>
+ <test property="org.eclipse.tcf.te.launch.ui.model.isValidLaunchConfig" value="debug"/>
+ </and>
</iterate>
</with>
</enabledWhen>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/properties/LaunchContextPropertiesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/properties/LaunchContextPropertiesSection.java
index 6a7dd63..5e4056c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/properties/LaunchContextPropertiesSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/properties/LaunchContextPropertiesSection.java
@@ -11,6 +11,7 @@ package org.eclipse.tcf.te.launch.ui.internal.properties;
import org.eclipse.core.runtime.Assert;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -56,7 +57,19 @@ public class LaunchContextPropertiesSection extends BaseTitledSection {
ILaunchConfiguration node = ((LaunchNode)input).getLaunchConfiguration();
IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(node);
- launchContextValue = contexts != null && contexts.length > 0 ? ((ILabelProvider)contexts[0].getAdapter(ILabelProvider.class)).getText(contexts[0]) : ""; //$NON-NLS-1$
+ if (contexts != null && contexts.length > 0) {
+ ILabelProvider labelProvider = (ILabelProvider)contexts[0].getAdapter(ILabelProvider.class);
+ launchContextValue = labelProvider.getText(contexts[0]);
+ if (labelProvider instanceof ILabelDecorator) {
+ launchContextValue = ((ILabelDecorator)labelProvider).decorateText(launchContextValue, contexts[0]);
+ }
+ if (contexts.length > 1) {
+ launchContextValue += ", ..."; //$NON-NLS-1$
+ }
+ }
+ else {
+ launchContextValue = ""; //$NON-NLS-1$
+ }
}
/*
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/viewer/LaunchNavigatorContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/viewer/LaunchNavigatorContentProvider.java
index dc62136..b591a0c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/viewer/LaunchNavigatorContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/internal/viewer/LaunchNavigatorContentProvider.java
@@ -11,13 +11,20 @@ package org.eclipse.tcf.te.launch.ui.internal.viewer;
import java.util.EventObject;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ICommonLaunchAttributes;
+import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
import org.eclipse.tcf.te.launch.ui.model.LaunchModel;
import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
import org.eclipse.tcf.te.runtime.events.ChangeEvent;
import org.eclipse.tcf.te.runtime.events.EventManager;
import org.eclipse.tcf.te.runtime.interfaces.events.IEventListener;
+import org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
import org.eclipse.tcf.te.ui.trees.TreeContentProvider;
import org.eclipse.ui.PlatformUI;
@@ -58,8 +65,36 @@ public class LaunchNavigatorContentProvider extends TreeContentProvider implemen
* @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
@Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ public void inputChanged(final Viewer viewer, Object oldInput, Object newInput) {
super.inputChanged(viewer, oldInput, newInput);
+
+ if (newInput != null && !newInput.equals(oldInput)) {
+ LaunchModel model = LaunchModel.getLaunchModel(newInput);
+ LaunchNode lastLaunchedNode = null;
+ long nodeValue = -1;
+ for (IModelNode typeNode : model.getRootNode().getChildren()) {
+ for (IModelNode launchNode : ((IContainerModelNode)typeNode).getChildren()) {
+ ILaunchConfiguration config = ((LaunchNode)launchNode).getLaunchConfiguration();
+ String lastLaunched = DefaultPersistenceDelegate.getAttribute(config, ICommonLaunchAttributes.ATTR_LAST_LAUNCHED, (String)null);
+ if (lastLaunched != null) {
+ long last = Long.parseLong(lastLaunched);
+ if (last > nodeValue) {
+ nodeValue = last;
+ lastLaunchedNode = (LaunchNode)launchNode;
+ }
+ }
+ }
+ }
+ if (lastLaunchedNode != null) {
+ final LaunchNode node = lastLaunchedNode;
+ ExecutorsUtil.executeInUI(new Runnable() {
+ @Override
+ public void run() {
+ viewer.setSelection(new StructuredSelection(node));
+ }
+ });
+ }
+ }
}
/*
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/selection/LaunchSelectionManager.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/selection/LaunchSelectionManager.java
index 2029001..3e824cb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/selection/LaunchSelectionManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/selection/LaunchSelectionManager.java
@@ -22,6 +22,7 @@ import org.eclipse.cdt.utils.elf.Elf.Attribute;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
@@ -222,15 +223,23 @@ public class LaunchSelectionManager {
// If the selection is not an IResource itself, try to adapt to it.
// This will possibly trigger an plugin activation on loadAdapter(...).
- if (sel instanceof IResource) {
- resource = (IResource)sel;
+ if (sel instanceof IProject) {
+ prj = (IProject)sel;
}
else {
- resource = (IResource)Platform.getAdapterManager().loadAdapter(sel, IResource.class.getName());
- }
+ if (sel instanceof IResource) {
+ resource = (IResource)sel;
+ }
+ else if (sel instanceof IAdaptable) {
+ resource = (IResource)((IAdaptable)sel).getAdapter(IResource.class);
+ }
+ else {
+ resource = (IResource)Platform.getAdapterManager().loadAdapter(sel, IResource.class.getName());
+ }
- // Get the project from the resource
- prj = resource.getProject();
+ // Get the project from the resource
+ prj = resource != null ? resource.getProject() : null;
+ }
// If the project could be determined, add the project's
// hash code to the cumulative hash code.
@@ -238,6 +247,9 @@ public class LaunchSelectionManager {
projects.add(prj);
hash += prj.hashCode();
}
+ else {
+ hash += sel.hashCode();
+ }
}
projects.clear();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/ICommonTCFLaunchAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/ICommonTCFLaunchAttributes.java
new file mode 100644
index 0000000..c2cf355
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/ICommonTCFLaunchAttributes.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.interfaces;
+
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ICommonLaunchAttributes;
+
+/**
+ * Defines the launch configuration attribute id's to access the launch step contexts.
+ */
+public interface ICommonTCFLaunchAttributes {
+
+ /**
+ * Define the prefix used by all other attribute id's as prefix.
+ */
+ public static final String ATTR_PREFIX = "org.eclipse.tcf.te.tcf.launch"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: The TCF channel.
+ */
+ public static final String ATTR_CHANNEL = ICommonLaunchAttributes.ATTR_PREFIX + ".channel"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/services/DebugService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/services/DebugService.java
index c011709..d6f1e9c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/services/DebugService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/services/DebugService.java
@@ -212,6 +212,8 @@ public class DebugService extends AbstractService implements IDebugService {
ILaunchConfigurationWorkingCopy wc = lct.newInstance(null, name);
// And fill in the launch configuration attributes
wc.setAttribute(TCFLaunchDelegate.ATTR_PEER_ID, peerId.get());
+ wc.setAttribute(TCFLaunchDelegate.ATTR_STOP_AT_MAIN, true);
+ wc.setAttribute(TCFLaunchDelegate.ATTR_DISCONNECT_ON_CTX_EXIT, true);
wc.setAttribute(TCFLaunchDelegate.ATTR_RUN_LOCAL_AGENT, false);
wc.setAttribute(TCFLaunchDelegate.ATTR_USE_LOCAL_AGENT, false);
// Save the working copy
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java
index 673cac0..8f869cb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java
@@ -9,10 +9,19 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.core.steps;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.tcf.protocol.IChannel;
+import org.eclipse.tcf.protocol.IToken;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.IProcesses;
+import org.eclipse.tcf.services.IRunControl;
+import org.eclipse.tcf.services.IRunControl.RunControlContext;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
@@ -21,7 +30,9 @@ import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.launch.core.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ICommonTCFLaunchAttributes;
import org.eclipse.tcf.te.tcf.launch.core.interfaces.IRemoteAppLaunchAttributes;
/**
@@ -52,7 +63,46 @@ public class AttachDebuggerStep extends AbstractTcfLaunchStep {
public void execute(IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, final ICallback callback) {
IDebugService dbgService = ServiceManager.getInstance().getService(getActivePeerModel(data), IDebugService.class, false);
if (dbgService != null) {
- dbgService.attach(getActivePeerModel(data), new PropertiesContainer(), callback);
+ Callback cb = new Callback();
+ dbgService.attach(getActivePeerModel(data), new PropertiesContainer(), cb);
+ ExecutorsUtil.waitAndExecute(0, cb.getDoneConditionTester(monitor));
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ IProcesses.ProcessContext processContext = (IProcesses.ProcessContext)StepperAttributeUtil.getProperty(IRemoteAppLaunchAttributes.ATTR_PROCESS_CONTEXT, fullQualifiedId, data);
+ IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ICommonTCFLaunchAttributes.ATTR_CHANNEL, fullQualifiedId, data);
+ Assert.isNotNull(channel);
+ IRunControl runControl = channel.getRemoteService(IRunControl.class);
+ if (runControl != null) {
+ runControl.getContext(processContext.getID(), new IRunControl.DoneGetContext() {
+ @Override
+ public void doneGetContext(IToken token, Exception error, RunControlContext context) {
+ if (error == null) {
+ context.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
+ @Override
+ public void doneCommand(IToken token, Exception error) {
+ callback.done(AttachDebuggerStep.this, StatusHelper.getStatus(error));
+ }
+ });
+ }
+ else {
+ callback.done(AttachDebuggerStep.this, StatusHelper.getStatus(error));
+ }
+ }
+ });
+ }
+ else {
+ callback.done(this, new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing run control service")); //$NON-NLS-1$
+ }
+ }
+ };
+ if (Protocol.isDispatchThread()) {
+ runnable.run();
+ }
+ else {
+ Protocol.invokeLater(runnable);
+ }
}
else {
callback.done(this, new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing debugger service")); //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/CloseChannelStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/CloseChannelStep.java
index 15cc7aa..3d5bcf8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/CloseChannelStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/CloseChannelStep.java
@@ -15,9 +15,11 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ICommonTCFLaunchAttributes;
/**
* Close channel step implementation.
@@ -42,7 +44,7 @@ public class CloseChannelStep extends AbstractTcfLaunchStep {
*/
@Override
public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- IChannel channel = Tcf.getChannelManager().getChannel(getActivePeerModel(data).getPeer());
+ IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ICommonTCFLaunchAttributes.ATTR_CHANNEL, fullQualifiedId, data);
if (channel != null && channel.getState() != IChannel.STATE_CLOSED) {
Tcf.getChannelManager().closeChannel(channel);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java
index 9de3215..995aaab 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java
@@ -15,11 +15,13 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ICommonTCFLaunchAttributes;
/**
* Open channel step implementation.
@@ -43,10 +45,11 @@ public class OpenChannelStep extends AbstractTcfLaunchStep {
* @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
*/
@Override
- public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, final ICallback callback) {
+ public void execute(IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, final ICallback callback) {
Tcf.getChannelManager().openChannel(getActivePeerModel(data).getPeer(), null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
+ StepperAttributeUtil.setProperty(ICommonTCFLaunchAttributes.ATTR_CHANNEL, fullQualifiedId.getParentId(), data, channel);
callback.done(OpenChannelStep.this, StatusHelper.getStatus(error));
}
});
@@ -54,7 +57,7 @@ public class OpenChannelStep extends AbstractTcfLaunchStep {
@Override
public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- IChannel channel = Tcf.getChannelManager().getChannel(getActivePeerModel(data).getPeer());
+ IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ICommonTCFLaunchAttributes.ATTR_CHANNEL, fullQualifiedId, data);
if (channel != null && channel.getState() != IChannel.STATE_CLOSED) {
Tcf.getChannelManager().closeChannel(channel);
}
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 861b7a8..c4eb710 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
@@ -33,7 +33,6 @@ Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.eclipse.tcf.te.tcf.launch.ui.activator;x-internal:=true,
org.eclipse.tcf.te.tcf.launch.ui.help,
- org.eclipse.tcf.te.tcf.launch.ui.internal.adapters,
org.eclipse.tcf.te.tcf.launch.ui.nls;x-internal:=true,
org.eclipse.tcf.te.tcf.launch.ui.remote.app,
org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer,
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
index 68b2e47..f1edbdd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
@@ -2,15 +2,6 @@
<?eclipse version="3.4"?>
<plugin>
-<!-- Adapter factory contributions -->
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- class="org.eclipse.tcf.te.tcf.launch.ui.internal.adapters.AdapterFactory"
- adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
- <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
- </factory>
- </extension>
-
<!-- Launch configuration type contributions -->
<extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
<launchConfigurationTypeImage
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/adapters/AdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/adapters/AdapterFactory.java
deleted file mode 100644
index 99cd90f..0000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/adapters/AdapterFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * 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.ui.internal.adapters;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.ui.actions.ILaunchable;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * Adapter factory implementation.
- */
-public class AdapterFactory implements IAdapterFactory {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof IPeerModel) {
- if (ILaunchable.class.equals(adapterType)) {
- return new ILaunchable() {};
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return new Class<?>[] {
- ILaunchable.class
- };
- }
-
-}