1 11 package org.eclipse.debug.internal.core.sourcelookup; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IConfigurationElement; 15 import org.eclipse.core.runtime.IProgressMonitor; 16 import org.eclipse.debug.core.DebugPlugin; 17 import org.eclipse.debug.core.ILaunchConfiguration; 18 import org.eclipse.debug.core.sourcelookup.ISourceContainer; 19 import org.eclipse.debug.core.sourcelookup.ISourcePathComputer; 20 import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate; 21 22 25 public class SourcePathComputer implements ISourcePathComputer { 26 27 private ISourcePathComputerDelegate fDelegate = null; 29 30 private IConfigurationElement fElement = null; 32 33 38 public SourcePathComputer(IConfigurationElement element) { 39 fElement = element; 40 } 41 42 45 public String getId() { 46 return fElement.getAttribute("id"); } 48 49 54 private ISourcePathComputerDelegate getDelegate() throws CoreException { 55 if (fDelegate == null) { 56 fDelegate = (ISourcePathComputerDelegate) fElement.createExecutableExtension("class"); } 58 return fDelegate; 59 } 60 61 64 public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) { 65 try { 66 return getDelegate().computeSourceContainers(configuration, monitor); 67 } catch (CoreException e) { 68 DebugPlugin.log(e); 69 } 70 return new ISourceContainer[0]; 71 } 72 } 73 | Popular Tags |