1 /*******************************************************************************2 * Copyright (c) 2000, 2007 IBM Corporation and others.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 *8 * Contributors:9 * IBM Corporation - initial API and implementation10 *******************************************************************************/11 package org.eclipse.pde.internal.core;12 13 import org.eclipse.core.runtime.CoreException;14 import org.eclipse.core.runtime.IPath;15 import org.eclipse.core.runtime.OperationCanceledException;16 import org.eclipse.jdt.core.ClasspathContainerInitializer;17 import org.eclipse.jdt.core.IClasspathContainer;18 import org.eclipse.jdt.core.IJavaProject;19 import org.eclipse.jdt.core.JavaCore;20 21 public class ExternalJavaSearchInitializer extends ClasspathContainerInitializer {22 23 ExternalJavaSearchClasspathContainer fContainer;24 25 /*26 * (non-Javadoc)27 * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)28 */29 public void initialize(IPath containerPath, IJavaProject javaProject)30 throws CoreException {31 try {32 JavaCore.setClasspathContainer(33 PDECore.JAVA_SEARCH_CONTAINER_PATH, 34 new IJavaProject[] {javaProject}, 35 new IClasspathContainer[]{new ExternalJavaSearchClasspathContainer()}, 36 null);37 } catch (OperationCanceledException e) {38 throw e;39 }40 41 }42 43 44 }45