diff options
author | Uwe Stieber | 2012-11-23 11:59:29 +0000 |
---|---|---|
committer | Uwe Stieber | 2012-11-23 12:00:11 +0000 |
commit | 2c43a1b5e56a84729b0f47e032c05313bb454a43 (patch) | |
tree | cb01e35d5be04285dcc76672c296f5f3c650c728 /target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse | |
parent | 7aeb78abbc0eac3c2a64183220e6f01312206537 (diff) | |
download | org.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/src/org/eclipse')
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/properties/PropertyTester.java | 37 |
1 files changed, 37 insertions, 0 deletions
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; + } +} |