Bug 125974 Restrict Junit launch shortcut appearance in menu
The soon-to-be-attached patch improves the behavior for the Junit launch shortcut. It uses property tests from a lower level plug-in (jdt.launching), and adds a test to only appear for container when JUnit is on the buildpath.
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/JavaTypeExtender.java
/*******************************************************************************
 * Copyright (c) 2000, 2005 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
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.junit.ui;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.internal.junit.util.TestSearchEngine;
/**
 * Contributes an "isTest" property for ITypes.
 */
public class JavaTypeExtender extends PropertyTester  {