1 package net.sourceforge.phpdt.internal.ui.util;
3 import java.util.ArrayList;
6 import org.eclipse.core.resources.IFile;
7 import org.eclipse.core.resources.IResource;
8 import org.eclipse.core.resources.IResourceVisitor;
9 import org.eclipse.core.runtime.CoreException;
11 public class PHPElementVisitor implements IResourceVisitor {
12 protected List phpFiles = new ArrayList();
14 public PHPElementVisitor() {
18 public boolean visit(IResource resource) throws CoreException {
19 switch (resource.getType()) {
20 case IResource.PROJECT:
23 case IResource.FOLDER:
27 IFile fileResource = (IFile) resource;
28 if (PHPFileUtil.isPHPFile(fileResource)) {
29 phpFiles.add(fileResource);
38 public Object[] getCollectedPHPFiles() {
39 return phpFiles.toArray();