From 55a8f89f929cd25df18876a8f9f56f09a3ed7815 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Sun, 29 Apr 2007 15:27:01 +0000 Subject: Modified to launch on a project context. --- launch/org.eclipse.cdt.launch/plugin.xml | 4 ++-- .../eclipse/cdt/launch/internal/CPropertyTester.java | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'launch') 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 @@ - + @@ -107,7 +107,7 @@ 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 main method, -- cgit v1.2.3