Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-11-23 11:59:29 +0000
committerUwe Stieber2012-11-23 12:00:11 +0000
commit2c43a1b5e56a84729b0f47e032c05313bb454a43 (patch)
treecb01e35d5be04285dcc76672c296f5f3c650c728 /target_explorer/plugins/org.eclipse.tcf.te.launch.core
parent7aeb78abbc0eac3c2a64183220e6f01312206537 (diff)
downloadorg.eclipse.tcf-2c43a1b5e56a84729b0f47e032c05313bb454a43.tar.gz
org.eclipse.tcf-2c43a1b5e56a84729b0f47e032c05313bb454a43.tar.xz
org.eclipse.tcf-2c43a1b5e56a84729b0f47e032c05313bb454a43.zip
Target Explorer: Added property tester to test if a debugger has been launched already for a given context
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.launch.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/META-INF/MANIFEST.MF1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/properties/PropertyTester.java37
3 files changed, 45 insertions, 0 deletions
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 aa98599a8..07f12c8c7 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
@@ -38,6 +38,7 @@ Export-Package: org.eclipse.tcf.te.launch.core.activator;x-internal:=true,
org.eclipse.tcf.te.launch.core.persistence.launchcontext,
org.eclipse.tcf.te.launch.core.persistence.projects,
org.eclipse.tcf.te.launch.core.preferences,
+ org.eclipse.tcf.te.launch.core.properties,
org.eclipse.tcf.te.launch.core.selection,
org.eclipse.tcf.te.launch.core.selection.interfaces,
org.eclipse.tcf.te.launch.core.steps,
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 756dde536..97452e1eb 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
@@ -39,6 +39,13 @@
properties="isValidLaunchConfigType"
type="java.lang.Object">
</propertyTester>
+ <propertyTester
+ class="org.eclipse.tcf.te.launch.core.properties.PropertyTester"
+ id="org.eclipse.tcf.te.launch.core.properties.PropertyTester"
+ namespace="org.eclipse.tcf.te.launch.core"
+ properties="isLaunched"
+ type="java.lang.Object">
+ </propertyTester>
</extension>
<!-- Launch Step contributions -->
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/properties/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/properties/PropertyTester.java
new file mode 100644
index 000000000..28e7ca609
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/properties/PropertyTester.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.launch.core.properties;
+
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+
+
+/**
+ * Launch framework property tester implementation.
+ */
+public class PropertyTester extends org.eclipse.core.expressions.PropertyTester {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+
+ // "isLaunched": Checks if the debugger has been attached for the given context
+ if ("isLaunched".equals(property) && expectedValue instanceof Boolean) { //$NON-NLS-1$
+ IDebugService dbgService = ServiceManager.getInstance().getService(receiver, IDebugService.class, false);
+ if (dbgService != null) {
+ return ((Boolean)expectedValue).booleanValue() == dbgService.isLaunched(receiver);
+ }
+ }
+
+ return false;
+ }
+}

Back to the top