blob: bc800fa366ce767bc3dd0fe8cec091d407c1fa6c [file] [log] [blame]
package org.eclipse.jdt.internal.launching;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.IRuntimeClasspathEntryResolver;
import org.eclipse.jdt.launching.IVMInstall;
/**
* Proxy to a runtime classpath entry resolver extension.
*/
public class RuntimeClasspathEntryResolver implements IRuntimeClasspathEntryResolver {
private IConfigurationElement fConfigurationElement;
private IRuntimeClasspathEntryResolver fDelegate;
/**
* Constructs a new resolver on the given configuration element
*/
public RuntimeClasspathEntryResolver(IConfigurationElement element) {
fConfigurationElement = element;
}
/**
* @see IRuntimeClasspathEntryResolver#resolveRuntimeClasspathEntry(IRuntimeClasspathEntry, ILaunchConfiguration)
*/
public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, ILaunchConfiguration configuration) throws CoreException {
return getResolver().resolveRuntimeClasspathEntry(entry, configuration);
}
/**
* Returns the resolver delegate (and creates if required)
*/
protected IRuntimeClasspathEntryResolver getResolver() throws CoreException {
if (fDelegate == null) {
fDelegate = (IRuntimeClasspathEntryResolver)fConfigurationElement.createExecutableExtension("class"); //$NON-NLS-1$
}
return fDelegate;
}
/**
* Returns the variable name this resolver is registered for, or <code>null</code>
*/
public String getVariableName() {
return fConfigurationElement.getAttribute("variable"); //$NON-NLS-1$
}
/**
* Returns the container id this resolver is registered for, or <code>null</code>
*/
public String getContainerId() {
return fConfigurationElement.getAttribute("container"); //$NON-NLS-1$
}
/**
* @see IRuntimeClasspathEntryResolver#resolveVMInstall(IClasspathEntry)
*/
public IVMInstall resolveVMInstall(IClasspathEntry entry) throws CoreException {
return getResolver().resolveVMInstall(entry);
}
/**
* @see IRuntimeClasspathEntryResolver#resolveRuntimeClasspathEntry(IRuntimeClasspathEntry, IJavaProject)
*/
public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, IJavaProject project) throws CoreException {
return getResolver().resolveRuntimeClasspathEntry(entry, project);
}
}