KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > launching > RuntimeClasspathProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.launching;
12
13  
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.core.runtime.IConfigurationElement;
16 import org.eclipse.debug.core.ILaunchConfiguration;
17 import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
18 import org.eclipse.jdt.launching.IRuntimeClasspathProvider;
19
20 /**
21  * Proxy to a runtime classpath provider extension.
22  */

23 public class RuntimeClasspathProvider implements IRuntimeClasspathProvider {
24
25     private IConfigurationElement fConfigurationElement;
26     
27     private IRuntimeClasspathProvider fDelegate;
28     
29     /**
30      * Constructs a new resolver on the given configuration element
31      */

32     public RuntimeClasspathProvider(IConfigurationElement element) {
33         fConfigurationElement = element;
34     }
35         
36     /**
37      * Returns the resolver delegate (and creates if required)
38      */

39     protected IRuntimeClasspathProvider getProvider() throws CoreException {
40         if (fDelegate == null) {
41             fDelegate = (IRuntimeClasspathProvider)fConfigurationElement.createExecutableExtension("class"); //$NON-NLS-1$
42
}
43         return fDelegate;
44     }
45     
46     public String JavaDoc getIdentifier() {
47         return fConfigurationElement.getAttribute("id"); //$NON-NLS-1$
48
}
49     /**
50      * @see IRuntimeClasspathProvider#computeUnresolvedClasspath(ILaunchConfiguration)
51      */

52     public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException {
53         return getProvider().computeUnresolvedClasspath(configuration);
54     }
55
56     /**
57      * @see IRuntimeClasspathProvider#resolveClasspath(IRuntimeClasspathEntry[], ILaunchConfiguration)
58      */

59     public IRuntimeClasspathEntry[] resolveClasspath(IRuntimeClasspathEntry[] entries, ILaunchConfiguration configuration) throws CoreException {
60         return getProvider().resolveClasspath(entries, configuration);
61     }
62
63 }
64
Popular Tags