use of org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer in project erlide_eclipse by erlang.
the class ErlangOtpSourceContainer method createSourceContainers.
@Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
final IPath lib = otpHome.addTrailingSeparator().append("lib").addTrailingSeparator();
final Set<String> moduleNames = modules(lib.toFile());
final List<IPath> moduleDirs = new ArrayList<>();
for (final String moduleName : moduleNames) {
final String h = highestVersion(lib.toFile(), moduleName);
if (h != null) {
moduleDirs.add(lib.addTrailingSeparator().append(h));
}
}
final List<ISourceContainer> r = new ArrayList<>();
for (final IPath dir : moduleDirs) {
r.add(new DirectorySourceContainer(dir.addTrailingSeparator().append("src"), false));
}
return r.toArray(new ISourceContainer[r.size()]);
}
use of org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer in project webtools.sourceediting by eclipse.
the class XSLTSourcePathComputerDelegate method computeSourceContainers.
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
List<ISourceContainer> containers = new ArrayList<ISourceContainer>();
String sourceFileExpr = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, (String) null);
IPath sourceFile = getSubstitutedPath(sourceFileExpr);
LaunchPipeline pipeline = hydratePipeline(configuration);
// TODO have some way of knowing whether it is an IResource or not
containers.add(new DirectorySourceContainer(sourceFile, false));
for (Iterator<?> iter = pipeline.getTransformDefs().iterator(); iter.hasNext(); ) {
LaunchTransform transform = (LaunchTransform) iter.next();
IPath path = transform.getPath();
ISourceContainer sourceContainer = null;
if (transform.getPathType().equals(LaunchTransform.RESOURCE_TYPE)) {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
IContainer container = resource.getParent();
if (container.getType() == IResource.PROJECT) {
sourceContainer = new ProjectSourceContainer((IProject) container, false);
} else if (container.getType() == IResource.FOLDER) {
sourceContainer = new FolderSourceContainer(container, false);
}
} else {
sourceContainer = new DirectorySourceContainer(path, false);
}
containers.add(sourceContainer);
}
return containers.toArray(new ISourceContainer[0]);
}
Aggregations