Bug 54946 Contextual launch contribution should not set adaptable=true
The contextual launch contribution sets adaptable=true (see below). This means the selection is always converted to an IResource. This results in a loss of information, since then the enablement can only be expressed in terms of IResource and not in terms of the original type. For exampe, the JUnit contextual launch needs to support launching an individual IMethod. It should be up to the enablement expression to do the adaptation. <extension point="org.eclipse.ui.popupMenus"> <objectContribution objectClass="org.eclipse.core.resources.IResource" adaptable="true" id="org.eclipse.debug.ui.contextualLaunch"> <action label="%LaunchMenu.label" style="pulldown" class="org.eclipse.debug.internal.ui.actions.ContextualLaunchObjectActionDelega te" menubarPath="additions" enablesFor="1" id="org.eclipse.debug.ui.contextualLaunch.submenu"> </action> </objectContribution> </extension>
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/JavaTypeExtender.java
/*******************************************************************************
 * Copyright (c) 2004 International Business Machines Corp. and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v0.5 
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 ******************************************************************************/
package org.eclipse.jdt.internal.junit.ui;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.junit.util.TestSearchEngine;
/**
 * Contributes an "isTest" property for ITypes.
 */
public class JavaTypeExtender extends PropertyTester  {