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);
// }
// 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);
//// }
*/
//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};
//}
/**
* @see IPackageFragment#getCompilationUnit(String)
- * @exception IllegalArgumentExcpetion if the name does not end with ".java"
+ * @exception IllegalArgumentExcpetion if the name does not end with a php file extension
*/
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);
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());
}
}
/**
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()));
}
}
}
*/
//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};
*/
//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()};