1 11 12 package org.eclipse.jdt.internal.launching; 13 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.core.runtime.IPath; 16 import org.eclipse.core.runtime.Path; 17 import org.eclipse.core.variables.VariablesPlugin; 18 import org.eclipse.debug.core.ILaunchConfiguration; 19 import org.eclipse.jdt.core.IClasspathEntry; 20 import org.eclipse.jdt.core.IJavaProject; 21 import org.eclipse.jdt.launching.IRuntimeClasspathEntry; 22 import org.eclipse.jdt.launching.IRuntimeClasspathEntryResolver; 23 import org.eclipse.jdt.launching.IVMInstall; 24 import org.eclipse.jdt.launching.JavaRuntime; 25 26 27 public class VariableClasspathResolver implements IRuntimeClasspathEntryResolver { 28 29 32 public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, ILaunchConfiguration configuration) throws CoreException { 33 return resolveRuntimeClasspathEntry(entry); 34 } 35 36 39 public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, IJavaProject project) throws CoreException { 40 return resolveRuntimeClasspathEntry(entry); 41 } 42 43 private IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry) throws CoreException{ 44 String variableString = ((VariableClasspathEntry)entry).getVariableString(); 45 String strpath = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(variableString); 46 IPath path = new Path(strpath).makeAbsolute(); 47 IRuntimeClasspathEntry archiveEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(path); 48 return new IRuntimeClasspathEntry[] { archiveEntry }; 49 } 50 51 54 public IVMInstall resolveVMInstall(IClasspathEntry entry) throws CoreException { 55 return null; 56 } 57 } 58 | Popular Tags |