01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.core;
11:
12: import org.eclipse.core.runtime.CoreException;
13: import org.eclipse.core.runtime.IPath;
14: import org.eclipse.core.runtime.OperationCanceledException;
15: import org.eclipse.jdt.core.ClasspathContainerInitializer;
16: import org.eclipse.jdt.core.IClasspathContainer;
17: import org.eclipse.jdt.core.IJavaProject;
18: import org.eclipse.jdt.core.JavaCore;
19:
20: public class ExternalJavaSearchInitializer extends
21: 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
33: .setClasspathContainer(
34: PDECore.JAVA_SEARCH_CONTAINER_PATH,
35: new IJavaProject[] { javaProject },
36: new IClasspathContainer[] { new ExternalJavaSearchClasspathContainer() },
37: null);
38: } catch (OperationCanceledException e) {
39: throw e;
40: }
41:
42: }
43:
44: }
|