Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-05-08 07:50:50 +0000
committerUwe Stieber2012-05-08 07:50:50 +0000
commit9bf931c765f00676a7f695c8f97a20357645909e (patch)
tree9be797baa02907a3661fff8b4a5dda61f25759cf /target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui
parent79868a126db1e5d0cea06a46512ec13bc93576c1 (diff)
downloadorg.eclipse.tcf-9bf931c765f00676a7f695c8f97a20357645909e.tar.gz
org.eclipse.tcf-9bf931c765f00676a7f695c8f97a20357645909e.tar.xz
org.eclipse.tcf-9bf931c765f00676a7f695c8f97a20357645909e.zip
Target Explorer: Remove run process action, add run and debug actions to peer
and resource nodes
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/plugin.properties44
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml156
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchShortcut.java113
3 files changed, 177 insertions, 136 deletions
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 eed629c8a..cbb457b0e 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,21 +1,23 @@
-##################################################################################
-# Copyright (c) 2011 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 - TCF
-
-# ***** 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
+##################################################################################
+# Copyright (c) 2011 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 - TCF
+
+# ***** Command contributions *****
+
+Command.showInDebugView.name=Show In Debug View Command
+Command.showInDebugView.description=Show the selection in the Debug View.
+
+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
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 db4d925f1..1671f2308 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
@@ -30,11 +30,13 @@
<!-- Launch shortcut contributions -->
<extension point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
- class="org.eclipse.tcf.te.tcf.launch.ui.remote.app.LaunchShortcut"
id="org.eclipse.tcf.te.tcf.launch.ui.launchshortcut.remote.app.run"
label="%LaunchShortcut.Remote.App.name"
icon="icons/obj16/remote_app.gif"
modes="run">
+ <class class="org.eclipse.tcf.te.launch.ui.internal.handler.LaunchShortcutHandler">
+ <parameter name="typeId" value="org.eclipse.tcf.te.tcf.launch.type.remote.app"/>
+ </class>
<contextualLaunch>
<enablement>
<with variable="selection">
@@ -53,11 +55,13 @@
</contextualLaunch>
</shortcut>
<shortcut
- class="org.eclipse.tcf.te.tcf.launch.ui.remote.app.LaunchShortcut"
id="org.eclipse.tcf.te.tcf.launch.ui.launchshortcut.remote.app.debug"
label="%LaunchShortcut.Remote.App.name"
icon="icons/obj16/remote_app.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.remote.app"/>
+ </class>
<contextualLaunch>
<enablement>
<with variable="selection">
@@ -122,6 +126,154 @@
</navigatorContent>
</extension>
+<!-- Menu contributions -->
+ <extension point="org.eclipse.ui.menus">
+ <!-- Project explorer menu contributions -->
+ <menuContribution locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?before=additions">
+ <separator name="org.eclipse.tcf.te.tcf.ui.launch.remote.app.launch" visible="true"/>
+ <command
+ commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.run"
+ disabledIcon="platform:/plugin/org.eclipse.debug.ui/icons/full/dtool16/run_exc.gif"
+ icon="platform:/plugin/org.eclipse.debug.ui/icons/full/etool16/run_exc.gif"
+ id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.run"
+ label="%LaunchShortcutHandler.Remote.App.run.name"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="selection">
+ <iterate
+ operator="and"
+ ifEmpty="false">
+ <instanceof value="org.eclipse.core.resources.IResource"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.debug"
+ disabledIcon="platform:/plugin/org.eclipse.debug.ui/icons/full/dtool16/debug_exc.gif"
+ icon="platform:/plugin/org.eclipse.debug.ui/icons/full/etool16/debug_exc.gif"
+ id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.debug"
+ label="%LaunchShortcutHandler.Remote.App.debug.name"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="selection">
+ <iterate
+ operator="and"
+ ifEmpty="false">
+ <instanceof value="org.eclipse.core.resources.IResource"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <!-- Target explorer menu contributions -->
+ <menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?before=additions">
+ <separator name="org.eclipse.tcf.te.tcf.ui.launch.remote.app.launch" visible="true"/>
+ <command
+ commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.run"
+ disabledIcon="platform:/plugin/org.eclipse.debug.ui/icons/full/dtool16/run_exc.gif"
+ icon="platform:/plugin/org.eclipse.debug.ui/icons/full/etool16/run_exc.gif"
+ id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.run"
+ label="%LaunchShortcutHandler.Remote.App.run.name"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="selection">
+ <iterate
+ operator="and"
+ ifEmpty="false">
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.debug"
+ disabledIcon="platform:/plugin/org.eclipse.debug.ui/icons/full/dtool16/debug_exc.gif"
+ icon="platform:/plugin/org.eclipse.debug.ui/icons/full/etool16/debug_exc.gif"
+ id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.debug"
+ label="%LaunchShortcutHandler.Remote.App.debug.name"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="selection">
+ <iterate
+ operator="and"
+ ifEmpty="false">
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+<!-- Command contributions -->
+ <extension point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.tcf.te.ui.commands.category"
+ id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.run"
+ name="%LaunchShortcutHandler.Remote.App.run.name"/>
+ <command
+ categoryId="org.eclipse.tcf.te.ui.commands.category"
+ id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.debug"
+ name="%LaunchShortcutHandler.Remote.App.debug.name"/>
+ </extension>
+
+<!-- Handler contributions -->
+ <extension point="org.eclipse.ui.handlers">
+ <handler commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.run">
+ <class class="org.eclipse.tcf.te.launch.ui.internal.handler.LaunchShortcutHandler">
+ <parameter name="mode" value="run"/>
+ <parameter name="typeId" value="org.eclipse.tcf.te.tcf.launch.type.remote.app"/>
+ </class>
+ <activeWhen>
+ <with variable="activePartId">
+ <or>
+ <equals value="org.eclipse.tcf.te.ui.views.View"/>
+ <equals value="org.eclipse.ui.navigator.ProjectExplorer"/>
+ </or>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with variable="selection">
+ <iterate
+ operator="and"
+ ifEmpty="false">
+ <or>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <instanceof value="org.eclipse.core.resources.IResource"/>
+ </or>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.debug">
+ <class class="org.eclipse.tcf.te.launch.ui.internal.handler.LaunchShortcutHandler">
+ <parameter name="mode" value="debug"/>
+ <parameter name="typeId" value="org.eclipse.tcf.te.tcf.launch.type.remote.app"/>
+ </class>
+ <activeWhen>
+ <with variable="activePartId">
+ <or>
+ <equals value="org.eclipse.tcf.te.ui.views.View"/>
+ <equals value="org.eclipse.ui.navigator.ProjectExplorer"/>
+ </or>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with variable="selection">
+ <iterate
+ operator="and"
+ ifEmpty="false">
+ <or>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <instanceof value="org.eclipse.core.resources.IResource"/>
+ </or>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ </extension>
+
<!-- Property section contributions -->
<extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
<propertySections contributorId="org.eclipse.tcf.te.ui">
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchShortcut.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchShortcut.java
deleted file mode 100644
index 2ba8721a4..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchShortcut.java
+++ /dev/null
@@ -1,113 +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.remote.app;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.debug.ui.ILaunchShortcut2;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-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.interfaces.ILaunchSelection;
-import org.eclipse.tcf.te.launch.ui.selection.LaunchSelectionManager;
-import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
-import org.eclipse.tcf.te.tcf.launch.ui.activator.UIPlugin;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * LaunchShortcut
- */
-public class LaunchShortcut implements ILaunchShortcut2 {
-
- /**
- * Constructor.
- */
- public LaunchShortcut() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String)
- */
- @Override
- public void launch(ISelection selection, String mode) {
- ILaunchConfigurationType launchConfigType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(ILaunchTypes.REMOTE_APPLICATION);
- try {
- ILaunchSelection launchSelection = LaunchSelectionManager.getInstance().getLaunchSelection(launchConfigType, mode, null);
- ILaunchManagerDelegate delegate = LaunchManager.getInstance().getLaunchManagerDelegate(launchConfigType, mode);
- if (delegate != null && launchSelection != null) {
- // create an empty launch configuration specification to initialize all attributes with their default defaults.
- ILaunchSpecification launchSpec = delegate.getLaunchSpecification(launchConfigType.getIdentifier(), launchSelection);
- // initialize the new launch config.
- // ignore validation result of launch spec - init as much attributes as possible
- if (launchSpec != null) {
- 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);
-
- ILaunchGroup launchGroup = DebugUITools.getLaunchGroup(config, mode);
- DebugUITools.openLaunchConfigurationDialogOnGroup(UIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), new StructuredSelection(config), launchGroup.getIdentifier());
- }
- }
- }
- catch (Exception e) {
- DebugUITools.openLaunchConfigurationDialogOnGroup(UIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), null, null);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String)
- */
- @Override
- public void launch(IEditorPart editor, String mode) {
- launch((ISelection)null, mode);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.ui.IEditorPart)
- */
- @Override
- public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editorpart) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public IResource getLaunchableResource(ISelection selection) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.ui.IEditorPart)
- */
- @Override
- public IResource getLaunchableResource(IEditorPart editorpart) {
- return null;
- }
-
-}

Back to the top