}
protected ISourceContainer[] createSourceContainers() throws CoreException {
ArrayList<ISourceContainer> containers = new ArrayList<ISourceContainer>();
ISourceContainer projectContainer = new ProjectSourceContainer(project,
false);
containers.add(projectContainer);
IBuildpathEntry[] entries = DLTKCore.create(project).getRawBuildpath();
if (entries != null) {
for (IBuildpathEntry element : entries) {
if (element.getEntryKind() == IBuildpathEntry.BPE_LIBRARY) {
IPath path = element.getPath();
File file = new File(path.toOSString());
if (element.getContentKind() == IProjectFragment.K_BINARY) {
containers.add(new ExternalArchiveSourceContainer(file
.getAbsolutePath(), false));
} else {
containers
.add(new DirectorySourceContainer(file, false));
}
} else if (element.getEntryKind() == IBuildpathEntry.BPE_PROJECT) {
IResource resource = ResourcesPlugin.getWorkspace()
.getRoot().findMember(
element.getPath().lastSegment());
if (resource instanceof IProject) {
IProject includeProject = (IProject) resource;
containers.add(new ProjectSourceContainer(
includeProject, false));
}
} else if (element.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) {
IPath path = element.getPath();
containers.add(new PHPVariableSourceContainer(path));