Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/attach.gifbin0 -> 962 bytes
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml48
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java48
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationTabGroup.java51
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java93
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java10
8 files changed, 253 insertions, 3 deletions
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 59bf042e2..53eafd74c 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
@@ -27,7 +27,9 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.tcf.te.ui.controls;bundle-version="1.1.0",
org.eclipse.tcf.te.ui.forms;bundle-version="1.1.0",
org.eclipse.tcf.te.ui.swt;bundle-version="1.1.0",
- org.eclipse.tcf.te.ui.views;bundle-version="1.1.0"
+ org.eclipse.tcf.te.ui.views;bundle-version="1.1.0",
+ org.eclipse.tcf.debug.ui;bundle-version="1.1.0",
+ org.eclipse.tcf.te.runtime.concurrent;bundle-version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/attach.gif b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/attach.gif
new file mode 100644
index 000000000..59c0c793d
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/attach.gif
Binary files differ
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 6075e73b1..507c01d04 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
@@ -21,3 +21,5 @@ LauchTree.name=Launches
LaunchShortcutHandler.Remote.App.run.name=Run Remote Application
LaunchShortcutHandler.Remote.App.debug.name=Debug Remote Application
LaunchShortcut.Remote.App.name=Remote Application
+
+LaunchShortcut.Attach.name=Attach
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 eac29aadb..76060d1dc 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,12 +2,30 @@
<?eclipse version="3.4"?>
<plugin>
+<!-- Service contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.services.services">
+ <service
+ class="org.eclipse.tcf.te.tcf.launch.ui.internal.services.DebugService"
+ id="org.eclipse.tcf.te.tcf.launch.core.services.debug">
+ <serviceType
+ bundleId="org.eclipse.tcf.te.runtime.services"
+ class="org.eclipse.tcf.te.runtime.services.interfaces.IDebugService"/>
+ <enablement>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </enablement>
+ </service>
+ </extension>
+
<!-- Launch configuration type contributions -->
<extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
<launchConfigurationTypeImage
configTypeID="org.eclipse.tcf.te.tcf.launch.type.remote.app"
icon="icons/obj16/remote_app.gif"
id="org.eclipse.tcf.te.tcf.launch.type.remote.app.image"/>
+ <launchConfigurationTypeImage
+ configTypeID="org.eclipse.tcf.te.tcf.launch.type.attach"
+ icon="icons/obj16/attach.gif"
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.image"/>
</extension>
<!-- Launch configuration tab group contributions -->
@@ -16,6 +34,10 @@
class="org.eclipse.tcf.te.tcf.launch.ui.remote.app.LaunchConfigurationTabGroup"
id="org.eclipse.tcf.te.tcf.launch.type.remote.app.tabgroup"
type="org.eclipse.tcf.te.tcf.launch.type.remote.app"/>
+ <launchConfigurationTabGroup
+ class="org.eclipse.tcf.te.tcf.launch.ui.attach.LaunchConfigurationTabGroup"
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.tabgroup"
+ type="org.eclipse.tcf.te.tcf.launch.type.attach"/>
</extension>
<!-- Launch shortcut contributions -->
@@ -58,7 +80,29 @@
forcePluginActivation="true"
property="org.eclipse.tcf.te.launch.core.isValidLaunchConfigType"
value="org.eclipse.tcf.te.tcf.launch.type.remote.app"
- args="run"/>
+ args="debug"/>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ <shortcut
+ id="org.eclipse.tcf.te.tcf.launch.ui.launchshortcut.attach.debug"
+ label="%LaunchShortcut.Attach.name"
+ icon="icons/obj16/attach.gif"
+ modes="debug">
+ <class class="org.eclipse.tcf.te.launch.ui.internal.handler.LaunchShortcutHandler">
+ <parameter name="typeId" value="org.eclipse.tcf.te.tcf.launch.type.attach"/>
+ </class>
+ <contextualLaunch>
+ <enablement>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.tcf.te.launch.core.isValidLaunchConfigType"
+ value="org.eclipse.tcf.te.tcf.launch.type.attach"
+ args="debug"/>
</iterate>
</with>
</enablement>
@@ -100,7 +144,7 @@
activeByDefault="false"
contentProvider="org.eclipse.tcf.te.launch.ui.internal.viewer.LaunchNavigatorContentProvider"
labelProvider="org.eclipse.tcf.te.launch.ui.internal.viewer.LaunchTreeLabelProvider"
- priority="normal">
+ priority="lowest">
<triggerPoints>
<instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
</triggerPoints>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java
new file mode 100644
index 000000000..79cee5f49
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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.attach;
+
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
+import org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext.ContextSelectorSection;
+import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
+import org.eclipse.ui.forms.IManagedForm;
+
+/**
+ * Remote application main launch tab implementation.
+ */
+public class LaunchConfigurationMainTab extends AbstractContextSelectorTab {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab#doCreateContextSelectorSection(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected ContextSelectorSection doCreateContextSelectorSection(IManagedForm form, Composite panel) {
+ return new ContextSelectorSection(form, panel);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab#doCreateAdditionalFormContent(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
+ */
+ @Override
+ protected void doCreateAdditionalFormContent(IManagedForm form, Composite parent, CustomFormToolkit toolkit) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
+ */
+ @Override
+ public Image getImage() {
+ return DebugUITools.getImage(ILaunchTypes.ATTACH);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationTabGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationTabGroup.java
new file mode 100644
index 000000000..dac5037aa
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationTabGroup.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.attach;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
+import org.eclipse.tcf.internal.debug.ui.launch.TCFMemoryMapTab;
+import org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab;
+import org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchConfigurationTabGroup;
+
+/**
+ * Remote application launch configuration tab group implementation.
+ */
+@SuppressWarnings("restriction")
+public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchContextConfigurationTabGroup#createContextSelectorTab(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.util.List, java.lang.String)
+ */
+ @Override
+ public void createContextSelectorTab(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
+ Assert.isNotNull(tabs);
+
+ ILaunchConfigurationTab tab = new LaunchConfigurationMainTab();
+ tabs.add(tab);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchContextConfigurationTabGroup#createAdditionalTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.util.List, java.lang.String)
+ */
+ @Override
+ public void createAdditionalTabs(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
+
+ tabs.add(new TCFMemoryMapTab());
+ tabs.add(new TCFPathMapTab());
+ tabs.add(new SourceLookupTab());
+ tabs.add(new CommonTab());
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
new file mode 100644
index 000000000..1541960d8
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.ui.internal.services;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.launch.core.lm.LaunchManager;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchManagerDelegate;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
+import org.eclipse.tcf.te.launch.core.selection.LaunchSelection;
+import org.eclipse.tcf.te.launch.core.selection.RemoteSelectionContext;
+import org.eclipse.tcf.te.launch.core.selection.interfaces.ILaunchSelection;
+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.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.services.AbstractService;
+import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
+
+/**
+ * Debug service implementations for TCF contexts.
+ */
+public class DebugService extends AbstractService implements IDebugService {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.services.interfaces.IDebugService#attach(java.lang.Object, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void attach(final Object context, final IPropertiesContainer data, final ICallback callback) {
+ if (!Protocol.isDispatchThread()) {
+ internalAttach(context, data, callback);
+ }
+ else {
+ ExecutorsUtil.execute(new Runnable() {
+ @Override
+ public void run() {
+ internalAttach(context, data, callback);
+ }
+ });
+ }
+ }
+
+ protected void internalAttach(final Object context, final IPropertiesContainer data, final ICallback callback) {
+ Assert.isNotNull(context);
+ Assert.isNotNull(data);
+ Assert.isNotNull(callback);
+
+ if (context instanceof IModelNode) {
+ ILaunchConfigurationType launchConfigType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(ILaunchTypes.ATTACH);
+ try {
+ ILaunchSelection launchSelection = new LaunchSelection(ILaunchManager.DEBUG_MODE, new RemoteSelectionContext((IModelNode)context, true));
+ ILaunchManagerDelegate delegate = LaunchManager.getInstance().getLaunchManagerDelegate(launchConfigType, ILaunchManager.DEBUG_MODE);
+ if (delegate != null) {
+ // create an empty launch configuration specification to initialize all attributes with their default defaults.
+ ILaunchSpecification launchSpec = delegate.getLaunchSpecification(launchConfigType.getIdentifier(), launchSelection);
+ delegate.validate(launchSpec);
+ if (launchSpec != null && launchSpec.isValid()) {
+ ILaunchConfiguration[] launchConfigs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(launchConfigType);
+ launchConfigs = delegate.getMatchingLaunchConfigurations(launchSpec, launchConfigs);
+
+ ILaunchConfiguration config = launchConfigs != null && launchConfigs.length > 0 ? launchConfigs[0] : null;
+ config = LaunchManager.getInstance().createOrUpdateLaunchConfiguration(config, launchSpec);
+
+ delegate.validate(ILaunchManager.DEBUG_MODE, config);
+ DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
+ }
+ }
+ callback.done(this, Status.OK_STATUS);
+ }
+ catch (Exception e) {
+ callback.done(this, StatusHelper.getStatus(e));
+ }
+ }
+ else {
+ callback.done(this, Status.OK_STATUS);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java
index 5becd2d66..7aefb11ae 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java
@@ -12,9 +12,13 @@ package org.eclipse.tcf.te.tcf.launch.ui.remote.app;
import java.util.List;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.CommonTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
+import org.eclipse.tcf.internal.debug.ui.launch.TCFMemoryMapTab;
+import org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab;
import org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchConfigurationTabGroup;
import org.eclipse.tcf.te.launch.ui.tabs.refprojects.RefProjetcsTab;
import org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer.FileTransferTab;
@@ -22,6 +26,7 @@ import org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer.FileTransferTab;
/**
* Remote application launch configuration tab group implementation.
*/
+@SuppressWarnings("restriction")
public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
/* (non-Javadoc)
@@ -43,6 +48,11 @@ public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabG
tabs.add(new FileTransferTab());
tabs.add(new RefProjetcsTab());
+ if (ILaunchManager.DEBUG_MODE.equalsIgnoreCase(mode)) {
+ tabs.add(new TCFMemoryMapTab());
+ tabs.add(new TCFPathMapTab());
+ tabs.add(new SourceLookupTab());
+ }
tabs.add(new CommonTab());
}
}

Back to the top