use of org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer in project erlide_eclipse by erlang.
the class ErlangSourcePathComputerDelegate method computeSourceContainers.
@Override
public ISourceContainer[] computeSourceContainers(final ILaunchConfiguration configuration, final IProgressMonitor monitor) throws CoreException {
final List<ISourceContainer> containers = new ArrayList<>();
final IProject[] projects = LaunchUtils.getErlangLaunchConfigurationProjects(configuration);
for (final IProject p : projects) {
containers.add(new ProjectSourceContainer(p, false));
}
if (containers.isEmpty()) {
containers.add(new WorkspaceSourceContainer());
}
final String runtimeName = configuration.getAttribute(ErlRuntimeAttributes.RUNTIME_NAME, "").trim();
final RuntimeInfo info = BackendCore.getRuntimeInfoCatalog().getRuntime(runtimeName);
containers.add(new ErlangOtpSourceContainer(new Path(info.getOtpHome())));
return containers.toArray(new ISourceContainer[containers.size()]);
}
use of org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer 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