Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorKen Ryall2007-04-29 15:27:01 +0000
committerKen Ryall2007-04-29 15:27:01 +0000
commit55a8f89f929cd25df18876a8f9f56f09a3ed7815 (patch)
tree96f1593edad02ea77640d4bdc0b134c8bff53ffc /launch
parent86f509df7bf786c78980e8ee52954057d74f9e51 (diff)
downloadorg.eclipse.cdt-55a8f89f929cd25df18876a8f9f56f09a3ed7815.tar.gz
org.eclipse.cdt-55a8f89f929cd25df18876a8f9f56f09a3ed7815.tar.xz
org.eclipse.cdt-55a8f89f929cd25df18876a8f9f56f09a3ed7815.zip
Modified to launch on a project context.
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/plugin.xml4
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java17
2 files changed, 18 insertions, 3 deletions
diff --git a/launch/org.eclipse.cdt.launch/plugin.xml b/launch/org.eclipse.cdt.launch/plugin.xml
index 21198619883..362f3650f79 100644
--- a/launch/org.eclipse.cdt.launch/plugin.xml
+++ b/launch/org.eclipse.cdt.launch/plugin.xml
@@ -82,7 +82,7 @@
<count value="1"/>
<iterate>
<or>
- <test property="org.eclipse.cdt.launch.isExecutable"/>
+ <test property="org.eclipse.cdt.launch.isCElement"/>
<instanceof value="org.eclipse.cdt.internal.core.model.CProject"/>
</or>
</iterate>
@@ -107,7 +107,7 @@
<extension point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
namespace="org.eclipse.cdt.launch"
- properties="isExecutable"
+ properties="isCElement"
type="org.eclipse.core.runtime.IAdaptable"
class="org.eclipse.cdt.launch.internal.CPropertyTester"
id="org.eclipse.cdt.launch.CPropertyTester">
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java
index bbdfe70e8d5..9d85b63de6a 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2007 IBM Corporation 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial implementation
+ * Ken Ryall (Nokia) - Modified to launch on a project context.
*******************************************************************************/
package org.eclipse.cdt.launch.internal;
@@ -26,12 +27,26 @@ public class CPropertyTester extends PropertyTester {
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if ("isCElement".equals(property)) { //$NON-NLS-1$
+ return isCElement(receiver);
+ }
if ("isExecutable".equals(property)) { //$NON-NLS-1$
return isExecutable(receiver);
}
return false;
}
+ private boolean isCElement(Object receiver) {
+ ICElement celement = null;
+ if (receiver instanceof IAdaptable) {
+ IResource res = (IResource) ((IAdaptable)receiver).getAdapter(IResource.class);
+ if (res != null) {
+ celement = CoreModel.getDefault().create(res);
+ }
+ }
+ return (celement != null);
+ }
+
/**
* Look for executable.
* @return true if the target resource has a <code>main</code> method,

Back to the top