Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-04-15 07:11:36 +0000
committerTobias Schwarz2013-04-15 07:11:36 +0000
commita429bbdb4dd1fc554688cee94f6a13185b33db65 (patch)
tree89f44ec6014bc06547d3c5086d2fe9d42480bd37 /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui
parentbc7419e92bbf4fea2b35fe61f58e38cb04307cd0 (diff)
downloadorg.eclipse.tcf-a429bbdb4dd1fc554688cee94f6a13185b33db65.tar.gz
org.eclipse.tcf-a429bbdb4dd1fc554688cee94f6a13185b33db65.tar.xz
org.eclipse.tcf-a429bbdb4dd1fc554688cee94f6a13185b33db65.zip
Target Explorer: use stepper for connect/disconnect
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/icons/etool16/debug_exc.gifbin0 -> 348 bytes
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties160
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml208
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java106
4 files changed, 281 insertions, 193 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/icons/etool16/debug_exc.gif b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/icons/etool16/debug_exc.gif
new file mode 100644
index 000000000..afe775b5a
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/icons/etool16/debug_exc.gif
Binary files differ
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
index 9af867401..9d41e5e17 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
@@ -1,85 +1,75 @@
-##################################################################################
-# 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 UI Plug-in
-providerName = Eclipse.org - Target Explorer
-
-# ***** Navigator Content *****
-
-navigatorContent.name = Dynamic Target Discovery
-
-# ***** Filter *****
-
-UnreachablePeersFilter.name=Unreachable targets
-RedirectPeersFilter.name=Redirected Targets (Root Level)
-PeersByCurrentUserFilter.name=Only show targets started by me
-
-# ***** Import/Export Wizards *****
-
-ImportWizards.Category.TCF=System Management
-ImportWizards.Peer=Configurations
-ImportWizards.PeerDescription=
-
-ExportWizards.Category.TCF=System Management
-ExportWizards.Peer=Configurations
-ExportWizards.PeerDescription=
-
-# ***** Decorators *****
-
-peerhost.decorator.label = Target Node Decorator
-
-# ***** Wizards *****
-
-NewWizards.category.name=Target Communication Framework
-
-NewTargetWizard.name=Target
-NewTargetWizard.description=Specify the attributes of the target to connect to.
-
-# ***** Editor Pages *****
-
-OverviewEditorPage.name=Overview
-
-# ***** Property Tabs *****
-
-propertyTab.general.label = General
-
-# ***** Preference and Property Pages *****
-
-preference.page.name = Logging
-
-# ***** Command Contributions *****
-
-command.delete.label=Delete
-command.delete.description=Delete the selected target
-
-command.refresh.label=Refresh
-command.refresh.description=Refresh the selected target
-
-command.redirect.name=Redirect Command
-command.redirect.label=Redirect...
-command.redirect.tooltip=Redirect communication to this node through a proxy
-
-command.resetredirect.name=Reset Redirect Command
-command.resetredirect.label=Reset Redirect
-command.resetredirect.tooltip=Reset communication redirection of this node
-
-command.offline.name=Always Available Offline Command
-command.offline.label=Always Available Offline
-command.offline.tooltip=Creates an offline copy of the target attributes.
-
-command.rename.label=Rename
-command.rename.tooltip=Rename the selected target
-command.rename.description=Rename the selected target
-
-command.redirect.mnemonic = e
-command.resetredirect.mnemonic = s
-command.delete.mnemonic = D
-command.offline.mnemonic = f
-command.rename.mnemonic = R \ No newline at end of file
+##################################################################################
+# 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 UI Plug-in
+providerName = Eclipse.org - Target Explorer
+
+# ***** Navigator Content *****
+
+navigatorContent.name = Dynamic Target Discovery
+
+# ***** Filter *****
+
+UnreachablePeersFilter.name=Unreachable targets
+RedirectPeersFilter.name=Redirected Targets (Root Level)
+PeersByCurrentUserFilter.name=Only show targets started by me
+
+# ***** Import/Export Wizards *****
+
+ImportWizards.Category.TCF=System Management
+ImportWizards.Peer=Configurations
+ImportWizards.PeerDescription=
+
+ExportWizards.Category.TCF=System Management
+ExportWizards.Peer=Configurations
+ExportWizards.PeerDescription=
+
+# ***** Decorators *****
+
+peerhost.decorator.label = Target Node Decorator
+
+# ***** Wizards *****
+
+NewWizards.category.name=Target Communication Framework
+
+NewTargetWizard.name=Target
+NewTargetWizard.description=Specify the attributes of the target to connect to.
+
+# ***** Editor Pages *****
+
+OverviewEditorPage.name=Overview
+
+# ***** Property Tabs *****
+
+propertyTab.general.label = General
+
+# ***** Preference and Property Pages *****
+
+preference.page.name = Logging
+
+# ***** Command Contributions *****
+
+command.delete.label=Delete
+command.delete.tooltip=Delete the selected target
+command.delete.mnemonic = D
+
+command.rename.label=Rename
+command.rename.tooltip=Rename the selected target
+command.rename.mnemonic = R
+
+command.refresh.label=Refresh
+command.refresh.tooltip=Refresh the selected target
+
+command.offline.label=Always Available Offline
+command.offline.tooltip=Creates an offline copy of the target attributes.
+command.offline.mnemonic = f
+
+command.debug.label=Debug
+command.debug.tooltip=Starts the debugger
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
index 16267e532..bc33b3b03 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
@@ -254,51 +254,8 @@
<!-- Menu contributions -->
<extension point="org.eclipse.ui.menus">
-<!--
- <menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?after=group.redirect">
- <command
- commandId="org.eclipse.tcf.te.tcf.ui.command.redirect"
- helpContextId="org.eclipse.tcf.te.tcf.ui.command_Redirect"
- id="org.eclipse.tcf.te.tcf.ui.commands.redirect"
- label="%command.redirect.label"
- mnemonic="%command.redirect.mnemonic"
- style="push"
- tooltip="%command.redirect.tooltip">
- <visibleWhen checkEnabled="false">
- <with variable="selection">
- <count value="+"/>
- <iterate operator="and" ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <test property="org.eclipse.tcf.te.tcf.locator.isStaticPeer" value="true"/>
- </and>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.tcf.te.tcf.ui.command.resetredirect"
- helpContextId="org.eclipse.tcf.te.tcf.ui.command_ResetRedirect"
- id="org.eclipse.tcf.te.tcf.ui.commands.resetredirect"
- label="%command.resetredirect.label"
- mnemonic="%command.resetredirect.mnemonic"
- style="push"
- tooltip="%command.resetredirect.tooltip">
- <visibleWhen checkEnabled="false">
- <with variable="selection">
- <count value="+"/>
- <iterate operator="and" ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <test property="org.eclipse.tcf.te.tcf.locator.isStaticPeer" value="true"/>
- </and>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
--->
+ <!-- View context menu contributions -->
<menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?after=group.delete">
<command
commandId="org.eclipse.ui.edit.delete"
@@ -308,8 +265,7 @@
id="org.eclipse.tcf.te.ui.commands.delete"
label="%command.delete.label"
mnemonic="%command.delete.mnemonic"
- style="push"
- tooltip="%command.delete.description">
+ tooltip="%command.delete.tooltip">
<visibleWhen checkEnabled="false">
<with variable="selection">
<count value="+"/>
@@ -326,7 +282,6 @@
id="org.eclipse.tcf.te.tcf.ui.commands.rename"
label="%command.rename.label"
mnemonic="%command.rename.mnemonic"
- style="push"
tooltip="%command.rename.tooltip">
<visibleWhen checkEnabled="false">
<with variable="selection">
@@ -341,16 +296,12 @@
</visibleWhen>
</command>
</menuContribution>
-
<menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?after=group.categories">
<command
commandId="org.eclipse.tcf.te.tcf.ui.command.offline"
helpContextId="org.eclipse.tcf.te.tcf.ui.command_Offline"
id="org.eclipse.tcf.te.tcf.ui.commands.offline"
- label="%command.offline.label"
- mnemonic="%command.offline.mnemonic"
- style="push"
- tooltip="%command.offline.tooltip">
+ mnemonic="%command.offline.mnemonic">
<visibleWhen checkEnabled="true">
<with variable="selection">
<count value="+"/>
@@ -376,13 +327,12 @@
</visibleWhen>
</command>
</menuContribution>
-
<menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?after=group.refresh">
<command
commandId="org.eclipse.tcf.te.ui.command.refresh"
label="%command.refresh.label"
style="push"
- tooltip="%command.refresh.description">
+ tooltip="%command.refresh.tooltip">
<visibleWhen checkEnabled="false">
<with variable="selection">
<count value="+"/>
@@ -407,77 +357,79 @@
</visibleWhen>
</command>
</menuContribution>
+ <menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?after=group.launch.rundebug">
+ <command commandId="org.eclipse.tcf.te.tcf.ui.command.debug">
+ <visibleWhen checkEnabled="false">
+ <with variable="selection">
+ <count value="1"/>
+ <iterate operator="and" ifEmpty="false">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <or>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="RunControl"/>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="RunControl"/>
+ <not>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.services.hasService"
+ value="org.eclipse.tcf.te.runtime.services.interfaces.IMenuService"/>
+ </not>
+ <test
+ property="org.eclipse.tcf.te.runtime.services.menu.isVisible"
+ args="org.eclipse.tcf.te.tcf.ui.command.debug"
+ value="true"/>
+ </or>
+ </adapt>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+
+ <menuContribution locationURI="toolbar:org.eclipse.tcf.te.tcf.ui.OverviewEditorPage?after=group.launch.rundebug">
+ <command commandId="org.eclipse.tcf.te.tcf.ui.editor.command.debug"/>
+ </menuContribution>
+
</extension>
<!-- Command contributions -->
<extension point="org.eclipse.ui.commands">
-<!--
<command
+ id="org.eclipse.tcf.te.tcf.ui.command.offline"
categoryId="org.eclipse.tcf.te.ui.commands.category"
- helpContextId="org.eclipse.tcf.te.tcf.ui.command_Redirect"
- id="org.eclipse.tcf.te.tcf.ui.command.redirect"
- name="%command.redirect.name">
+ helpContextId="org.eclipse.tcf.te.tcf.ui.command_Offline"
+ name="%command.offline.label"
+ description="%command.offline.tooltip">
</command>
<command
+ id="org.eclipse.tcf.te.tcf.ui.command.debug"
categoryId="org.eclipse.tcf.te.ui.commands.category"
- helpContextId="org.eclipse.tcf.te.tcf.ui.command_ResetRedirect"
- id="org.eclipse.tcf.te.tcf.ui.command.resetredirect"
- name="%command.resetredirect.name">
+ helpContextId="org.eclipse.tcf.te.tcf.ui.command_Debug"
+ name="%command.debug.label"
+ description="%command.debug.tooltip">
</command>
--->
<command
+ id="org.eclipse.tcf.te.tcf.ui.editor.command.debug"
categoryId="org.eclipse.tcf.te.ui.commands.category"
- helpContextId="org.eclipse.tcf.te.tcf.ui.command_Offline"
- id="org.eclipse.tcf.te.tcf.ui.command.offline"
- name="%command.offline.name">
+ helpContextId="org.eclipse.tcf.te.tcf.ui.command_Debug"
+ name="%command.debug.label"
+ description="%command.debug.tooltip">
</command>
</extension>
+<!-- Command image contributions -->
+ <extension point="org.eclipse.ui.commandImages">
+ <image
+ commandId="org.eclipse.tcf.te.tcf.ui.command.debug"
+ icon="icons/etool16/debug_exc.gif">
+ </image>
+ <image
+ commandId="org.eclipse.tcf.te.tcf.ui.editor.command.debug"
+ icon="icons/etool16/debug_exc.gif">
+ </image>
+ </extension>
+
<!-- Handler contributions -->
<extension point="org.eclipse.ui.handlers">
-<!--
- <handler
- class="org.eclipse.tcf.te.tcf.ui.handler.RedirectHandler"
- commandId="org.eclipse.tcf.te.tcf.ui.command.redirect">
- <activeWhen>
- <with variable="activePartId">
- <equals value="org.eclipse.tcf.te.ui.views.View"/>
- </with>
- </activeWhen>
- <enabledWhen>
- <with variable="selection">
- <count value="1"/>
- <iterate operator="and" ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <test property="org.eclipse.tcf.te.tcf.locator.isRedirected" value="false"/>
- </and>
- </iterate>
- </with>
- </enabledWhen>
- </handler>
-
- <handler
- class="org.eclipse.tcf.te.tcf.ui.handler.ResetRedirectHandler"
- commandId="org.eclipse.tcf.te.tcf.ui.command.resetredirect">
- <activeWhen>
- <with variable="activePartId">
- <equals value="org.eclipse.tcf.te.ui.views.View"/>
- </with>
- </activeWhen>
- <enabledWhen>
- <with variable="selection">
- <count value="1"/>
- <iterate operator="and" ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <test property="org.eclipse.tcf.te.tcf.locator.isRedirected" value="true"/>
- </and>
- </iterate>
- </with>
- </enabledWhen>
- </handler>
--->
<handler
commandId="org.eclipse.ui.edit.delete"
class="org.eclipse.tcf.te.tcf.ui.handler.DeleteHandler">
@@ -572,6 +524,46 @@
</with>
</enabledWhen>
</handler>
+
+ <handler
+ commandId="org.eclipse.tcf.te.tcf.ui.command.debug"
+ class="org.eclipse.tcf.te.tcf.ui.handler.StartDebugCommandHandler">
+ <activeWhen>
+ <with variable="systemManagerViewSelection">
+ <iterate operator="and" ifEmpty="false">
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with variable="systemManagerViewSelection">
+ <count value="1"/>
+ <iterate operator="and" ifEmpty="false">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="RunControl"/>
+ <test property="org.eclipse.tcf.te.launch.core.isLaunched" value="false"/>
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.tcf.te.tcf.ui.editor.command.debug"
+ class="org.eclipse.tcf.te.tcf.ui.handler.StartDebugCommandHandler">
+ <activeWhen>
+ <with variable="activeEditorInput">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with variable="activeEditorInput">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="RunControl"/>
+ <test property="org.eclipse.tcf.te.launch.core.isLaunched" value="false"/>
+ </adapt>
+ </with>
+ </enabledWhen>
+ </handler>
</extension>
<!-- Tabbed properties view contributions -->
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
new file mode 100644
index 000000000..c6e1e3fb5
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
@@ -0,0 +1,106 @@
+/**
+ * StartDebugCommandHandler.java
+ * Created on Jun 29, 2012
+ *
+ * Copyright (c) 2012 Wind River Systems, Inc.
+ *
+ * The right to copy, distribute, modify, or otherwise make use
+ * of this software may be licensed only pursuant to the terms
+ * of an applicable Wind River license agreement.
+ */
+package org.eclipse.tcf.te.tcf.ui.handler;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+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;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.ui.async.UICallbackInvocationDelegate;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.part.EditorPart;
+
+/**
+ * Start debugger command handler implementation.
+ */
+public class StartDebugCommandHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // Get the active part
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);
+ // Get the current selection
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+ // If the handler is invoked from an editor part, ignore the selection and
+ // construct an artificial selection from the active editor input.
+ if (part instanceof EditorPart) {
+ IEditorInput input = ((EditorPart)part).getEditorInput();
+ Object element = input != null ? input.getAdapter(Object.class) : null;
+ if (element != null) {
+ selection = new StructuredSelection(element);
+ }
+ }
+
+ // If the selection is not empty, iterate over the selection and execute
+ // the operation for each peer model node in the selection.
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ // Create the collector keeping track of the callbacks for each peer model
+ // node within the selection
+ final AsyncCallbackCollector collector = new AsyncCallbackCollector(new Callback() {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ // Signal that all operations completed
+ }
+ }, new UICallbackInvocationDelegate());
+
+ Iterator<?> iterator = ((IStructuredSelection)selection).iterator();
+ while (iterator.hasNext()) {
+ final Object element = iterator.next();
+ if (element instanceof IPeerModel) {
+ startDebugger((IPeerModel)element, new AsyncCallbackCollector.SimpleCollectorCallback(collector));
+ }
+ }
+
+ // Mark the collector initialization done
+ collector.initDone();
+ }
+
+ return null;
+ }
+
+ /**
+ * Starts the debugger for the given peer model node.
+ *
+ * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @param callback The callback. Must not be <code>null</code>.
+ */
+ public void startDebugger(final IPeerModel peerModel, final ICallback callback) {
+ Assert.isNotNull(peerModel);
+ Assert.isNotNull(callback);
+
+ IDebugService dbgService = ServiceManager.getInstance().getService(peerModel, IDebugService.class, false);
+ if (dbgService != null) {
+ // Attach the debugger and all cores (OCDDevices)
+ IPropertiesContainer props = new PropertiesContainer();
+ dbgService.attach(peerModel, props, null, callback);
+ }
+ }
+}

Back to the top