01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.jdt.internal.launching;
11:
12: import org.eclipse.core.runtime.CoreException;
13: import org.eclipse.core.runtime.IConfigurationElement;
14: import org.eclipse.debug.core.ILaunchConfiguration;
15: import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
16: import org.eclipse.jdt.launching.IRuntimeClasspathProvider;
17:
18: /**
19: * Proxy to a runtime classpath provider extension.
20: */
21: public class RuntimeClasspathProvider implements
22: IRuntimeClasspathProvider {
23:
24: private IConfigurationElement fConfigurationElement;
25:
26: private IRuntimeClasspathProvider fDelegate;
27:
28: /**
29: * Constructs a new resolver on the given configuration element
30: */
31: public RuntimeClasspathProvider(IConfigurationElement element) {
32: fConfigurationElement = element;
33: }
34:
35: /**
36: * Returns the resolver delegate (and creates if required)
37: */
38: protected IRuntimeClasspathProvider getProvider()
39: throws CoreException {
40: if (fDelegate == null) {
41: fDelegate = (IRuntimeClasspathProvider) fConfigurationElement
42: .createExecutableExtension("class"); //$NON-NLS-1$
43: }
44: return fDelegate;
45: }
46:
47: public String getIdentifier() {
48: return fConfigurationElement.getAttribute("id"); //$NON-NLS-1$
49: }
50:
51: /**
52: * @see IRuntimeClasspathProvider#computeUnresolvedClasspath(ILaunchConfiguration)
53: */
54: public IRuntimeClasspathEntry[] computeUnresolvedClasspath(
55: ILaunchConfiguration configuration) throws CoreException {
56: return getProvider().computeUnresolvedClasspath(configuration);
57: }
58:
59: /**
60: * @see IRuntimeClasspathProvider#resolveClasspath(IRuntimeClasspathEntry[], ILaunchConfiguration)
61: */
62: public IRuntimeClasspathEntry[] resolveClasspath(
63: IRuntimeClasspathEntry[] entries,
64: ILaunchConfiguration configuration) throws CoreException {
65: return getProvider().resolveClasspath(entries, configuration);
66: }
67:
68: }
|