Parser detects wrong include files now
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / PackageFragment.java
index ea8f6b4..405364b 100644 (file)
@@ -77,10 +77,10 @@ public class PackageFragment extends Openable implements IPackageFragment {
                                        if (extension != null) {
                                                if (extension.equalsIgnoreCase(extType)) {
                                                        IJavaElement childElement;
-//                                                     if (kind == IPackageFragmentRoot.K_SOURCE && Util.isValidCompilationUnitName(child.getName())) {
+//                                                     if (kind == IPackageFragmentRoot.K_SOURCE && ProjectPrefUtil.isValidCompilationUnitName(child.getName())) {
 //                                                             childElement = new CompilationUnit(this, child.getName(), DefaultWorkingCopyOwner.PRIMARY);
 //                                                             vChildren.add(childElement);
-//                                                     } else if (Util.isValidClassFileName(child.getName())) {
+//                                                     } else if (ProjectPrefUtil.isValidClassFileName(child.getName())) {
 //                                                             childElement = getClassFile(child.getName());
 //                                                             vChildren.add(childElement);
 //                                                     }
@@ -129,15 +129,15 @@ public class PackageFragment extends Openable implements IPackageFragment {
 //             for (int i = 0, max = members.length; i < max; i++) {
 //                     IResource child = members[i];
 //                     if (child.getType() != IResource.FOLDER
-//                                     && !Util.isExcluded(child, exclusionPatterns)) {
+//                                     && !ProjectPrefUtil.isExcluded(child, exclusionPatterns)) {
 //                             String extension = child.getProjectRelativePath().getFileExtension();
 //                             if (extension != null) {
 //                                     if (extension.equalsIgnoreCase(extType)) {
 //                                             IJavaElement childElement;
-////                                           if (kind == IPackageFragmentRoot.K_SOURCE && Util.isValidCompilationUnitName(child.getName())) {
+////                                           if (kind == IPackageFragmentRoot.K_SOURCE && ProjectPrefUtil.isValidCompilationUnitName(child.getName())) {
 ////                                                   childElement = getCompilationUnit(child.getName());
 ////                                                   vChildren.add(childElement);
-////                                           } else if (Util.isValidClassFileName(child.getName())) {
+////                                           } else if (ProjectPrefUtil.isValidClassFileName(child.getName())) {
 ////                                                   childElement = getClassFile(child.getName());
 ////                                                   vChildren.add(childElement);
 ////                                           }
@@ -165,7 +165,7 @@ public class PackageFragment extends Openable implements IPackageFragment {
  */
 //public void copy(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
 //     if (container == null) {
-//             throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$
+//             throw new IllegalArgumentException(ProjectPrefUtil.bind("operation.nullContainer")); //$NON-NLS-1$
 //     }
 //     IJavaElement[] elements= new IJavaElement[] {this};
 //     IJavaElement[] containers= new IJavaElement[] {container};
@@ -236,7 +236,7 @@ protected Object createElementInfo() {
  * @exception IllegalArgumentExcpetion if the name does not end with ".java"
  */
 public ICompilationUnit getCompilationUnit(String cuName) {
-       if (!  PHPFileUtil.isPHPFileName(cuName)) {
+       if (!  PHPFileUtil.isValidPHPUnitName(cuName)) {
                throw new IllegalArgumentException(Util.bind("convention.unit.notJavaName")); //$NON-NLS-1$
        }
        return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY);
@@ -291,7 +291,8 @@ public IPath getPath() {
        if (root.isArchive()) {
                return root.getPath();
        } else {
-               return root.getPath().append(this.getElementName().replace('.', '/'));
+//             return root.getPath().append(this.getElementName().replace('.', '/'));
+               return root.getPath().append(this.getElementName());
        }
 }
 /**
@@ -306,7 +307,8 @@ public IResource getResource() {
                if (elementName.length() == 0) {
                        return root.getResource();
                } else {
-                       return ((IContainer)root.getResource()).getFolder(new Path(this.getElementName().replace('.', '/')));
+//                     return ((IContainer)root.getResource()).getFolder(new Path(this.getElementName().replace('.', '/')));
+                       return ((IContainer)root.getResource()).getFolder(new Path(this.getElementName()));
                }
        }
 }
@@ -363,7 +365,7 @@ public boolean isDefaultPackage() {
  */
 //public void move(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
 //     if (container == null) {
-//             throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$
+//             throw new IllegalArgumentException(ProjectPrefUtil.bind("operation.nullContainer")); //$NON-NLS-1$
 //     }
 //     IJavaElement[] elements= new IJavaElement[] {this};
 //     IJavaElement[] containers= new IJavaElement[] {container};
@@ -398,7 +400,7 @@ public boolean isDefaultPackage() {
  */
 //public void rename(String name, boolean force, IProgressMonitor monitor) throws JavaModelException {
 //     if (name == null) {
-//             throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$
+//             throw new IllegalArgumentException(ProjectPrefUtil.bind("element.nullName")); //$NON-NLS-1$
 //     }
 //     IJavaElement[] elements= new IJavaElement[] {this};
 //     IJavaElement[] dests= new IJavaElement[] {this.getParent()};