Refactory: remove unused classes, imports, fields and methods.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / JavaProject.java
index 94ae854..cdfdb9f 100644 (file)
@@ -74,7 +74,7 @@ import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.QualifiedName;
+//import org.eclipse.core.runtime.QualifiedName;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -391,19 +391,19 @@ public class JavaProject extends Openable implements IJavaProject,
        /**
         * Adds a builder to the build spec for the given project.
         */
-       protected void addToBuildSpec(String builderID) throws CoreException {
-
-               IProjectDescription description = getProject().getDescription();
-               ICommand javaCommand = getJavaCommand(description);
-
-               if (javaCommand == null) {
-
-                       // Add a Java command to the build spec
-                       ICommand command = description.newCommand();
-                       command.setBuilderName(builderID);
-                       setJavaCommand(description, command);
-               }
-       }
+//     protected void addToBuildSpec(String builderID) throws CoreException {
+//
+//             IProjectDescription description = getProject().getDescription();
+//             ICommand javaCommand = getJavaCommand(description);
+//
+//             if (javaCommand == null) {
+//
+//                     // Add a Java command to the build spec
+//                     ICommand command = description.newCommand();
+//                     command.setBuilderName(builderID);
+//                     setJavaCommand(description, command);
+//             }
+//     }
 
        /**
         * @see Openable
@@ -793,10 +793,10 @@ public class JavaProject extends Openable implements IJavaProject,
        /**
         * Compute the file name to use for a given shared property
         */
-       public String computeSharedPropertyFileName(QualifiedName qName) {
-
-               return '.' + qName.getLocalName();
-       }
+//     public String computeSharedPropertyFileName(QualifiedName qName) {
+//
+//             return '.' + qName.getLocalName();
+//     }
 
        /*
         * Returns whether the given resource is accessible through the children or
@@ -1218,12 +1218,12 @@ public class JavaProject extends Openable implements IJavaProject,
                        String typeName = path.lastSegment();
                        typeName = typeName.substring(0, typeName.length()
                                        - extension.length() - 1);
-                       String qualifiedName = null;
-                       if (packageName.length() > 0) {
-                               qualifiedName = packageName + "." + typeName; //$NON-NLS-1$
-                       } else {
-                               qualifiedName = typeName;
-                       }
+                       //String qualifiedName = null;
+//                     if (packageName.length() > 0) {
+//                             qualifiedName = packageName + "." + typeName; //$NON-NLS-1$
+//                     } else {
+//                             qualifiedName = typeName;
+//                     }
                        // IType type =
                        // getNameLookup().findType(
                        // qualifiedName,
@@ -1608,18 +1608,18 @@ public class JavaProject extends Openable implements IJavaProject,
         * Find the specific Java command amongst the build spec of a given
         * description
         */
-       private ICommand getJavaCommand(IProjectDescription description)
-                       throws CoreException {
-
-               ICommand[] commands = description.getBuildSpec();
-               for (int i = 0; i < commands.length; ++i) {
-                       if (commands[i].getBuilderName().equals(
-                                       PHPeclipsePlugin.BUILDER_PARSER_ID)) {
-                               return commands[i];
-                       }
-               }
-               return null;
-       }
+//     private ICommand getJavaCommand(IProjectDescription description)
+//                     throws CoreException {
+//
+//             ICommand[] commands = description.getBuildSpec();
+//             for (int i = 0; i < commands.length; ++i) {
+//                     if (commands[i].getBuilderName().equals(
+//                                     PHPeclipsePlugin.BUILDER_PARSER_ID)) {
+//                             return commands[i];
+//                     }
+//             }
+//             return null;
+//     }
 
        /**
         * Convenience method that returns the specific type of info for a Java
@@ -1905,21 +1905,21 @@ public class JavaProject extends Openable implements IJavaProject,
         * Returns the package fragment root prefixed by the given path, or an empty
         * collection if there are no such elements in the model.
         */
-       protected IPackageFragmentRoot[] getPackageFragmentRoots(IPath path)
-
-       throws JavaModelException {
-               IPackageFragmentRoot[] roots = getAllPackageFragmentRoots();
-               ArrayList matches = new ArrayList();
-
-               for (int i = 0; i < roots.length; ++i) {
-                       if (path.isPrefixOf(roots[i].getPath())) {
-                               matches.add(roots[i]);
-                       }
-               }
-               IPackageFragmentRoot[] copy = new IPackageFragmentRoot[matches.size()];
-               matches.toArray(copy);
-               return copy;
-       }
+//     protected IPackageFragmentRoot[] getPackageFragmentRoots(IPath path)
+//
+//     throws JavaModelException {
+//             IPackageFragmentRoot[] roots = getAllPackageFragmentRoots();
+//             ArrayList matches = new ArrayList();
+//
+//             for (int i = 0; i < roots.length; ++i) {
+//                     if (path.isPrefixOf(roots[i].getPath())) {
+//                             matches.add(roots[i]);
+//                     }
+//             }
+//             IPackageFragmentRoot[] copy = new IPackageFragmentRoot[matches.size()];
+//             matches.toArray(copy);
+//             return copy;
+//     }
 
        /**
         * @see IJavaProject
@@ -2527,60 +2527,60 @@ public class JavaProject extends Openable implements IJavaProject,
        /*
         * @see IJavaProject
         */
-       public boolean isOnClasspath(IJavaElement element) {
-               IPath path = element.getPath();
-               switch (element.getElementType()) {
-               case IJavaElement.PACKAGE_FRAGMENT_ROOT:
-                       if (!((IPackageFragmentRoot) element).isArchive()) {
-                               // ensure that folders are only excluded if all of their
-                               // children are excluded
-                               path = path.append("*"); //$NON-NLS-1$
-                       }
-                       break;
-               case IJavaElement.PACKAGE_FRAGMENT:
-                       if (!((IPackageFragmentRoot) element.getParent()).isArchive()) {
-                               // ensure that folders are only excluded if all of their
-                               // children are excluded
-                               path = path.append("*"); //$NON-NLS-1$
-                       }
-                       break;
-               }
-               return this.isOnClasspath(path);
-       }
-
-       private boolean isOnClasspath(IPath path) {
-               IClasspathEntry[] classpath;
-               try {
-                       classpath = this
-                                       .getResolvedClasspath(true/* ignore unresolved variable */);
-               } catch (JavaModelException e) {
-                       return false; // not a Java project
-               }
-               for (int i = 0; i < classpath.length; i++) {
-                       IClasspathEntry entry = classpath[i];
-                       if (entry.getPath().isPrefixOf(path)
-                                       && !Util.isExcluded(path, null, ((ClasspathEntry) entry)
-                                                       .fullExclusionPatternChars(), true)) {
-                               return true;
-                       }
-               }
-               return false;
-       }
+//     public boolean isOnClasspath(IJavaElement element) {
+//             IPath path = element.getPath();
+//             switch (element.getElementType()) {
+//             case IJavaElement.PACKAGE_FRAGMENT_ROOT:
+//                     if (!((IPackageFragmentRoot) element).isArchive()) {
+//                             // ensure that folders are only excluded if all of their
+//                             // children are excluded
+//                             path = path.append("*"); //$NON-NLS-1$
+//                     }
+//                     break;
+//             case IJavaElement.PACKAGE_FRAGMENT:
+//                     if (!((IPackageFragmentRoot) element.getParent()).isArchive()) {
+//                             // ensure that folders are only excluded if all of their
+//                             // children are excluded
+//                             path = path.append("*"); //$NON-NLS-1$
+//                     }
+//                     break;
+//             }
+//             return this.isOnClasspath(path);
+//     }
+
+//     private boolean isOnClasspath(IPath path) {
+//             IClasspathEntry[] classpath;
+//             try {
+//                     classpath = this
+//                                     .getResolvedClasspath(true/* ignore unresolved variable */);
+//             } catch (JavaModelException e) {
+//                     return false; // not a Java project
+//             }
+//             for (int i = 0; i < classpath.length; i++) {
+//                     IClasspathEntry entry = classpath[i];
+//                     if (entry.getPath().isPrefixOf(path)
+//                                     && !Util.isExcluded(path, null, ((ClasspathEntry) entry)
+//                                                     .fullExclusionPatternChars(), true)) {
+//                             return true;
+//                     }
+//             }
+//             return false;
+//     }
 
        /*
         * @see IJavaProject
         */
-       public boolean isOnClasspath(IResource resource) {
-               IPath path = resource.getFullPath();
-
-               // ensure that folders are only excluded if all of their children are
-               // excluded
-               if (resource.getType() == IResource.FOLDER) {
-                       path = path.append("*"); //$NON-NLS-1$
-               }
-
-               return this.isOnClasspath(path);
-       }
+//     public boolean isOnClasspath(IResource resource) {
+//             IPath path = resource.getFullPath();
+//
+//             // ensure that folders are only excluded if all of their children are
+//             // excluded
+//             if (resource.getType() == IResource.FOLDER) {
+//                     path = path.append("*"); //$NON-NLS-1$
+//             }
+//
+//             return this.isOnClasspath(path);
+//     }
 
        private IPath getPluginWorkingLocation() {
                return this.project.getWorkingLocation(JavaCore.PLUGIN_ID);
@@ -2856,34 +2856,34 @@ public class JavaProject extends Openable implements IJavaProject,
         * Update the Java command in the build spec (replace existing one if
         * present, add one first if none).
         */
-       private void setJavaCommand(IProjectDescription description,
-                       ICommand newCommand) throws CoreException {
-
-               ICommand[] oldCommands = description.getBuildSpec();
-               ICommand oldJavaCommand = getJavaCommand(description);
-               ICommand[] newCommands;
-
-               if (oldJavaCommand == null) {
-                       // Add a Java build spec before other builders (1FWJK7I)
-                       newCommands = new ICommand[oldCommands.length + 1];
-                       System
-                                       .arraycopy(oldCommands, 0, newCommands, 1,
-                                                       oldCommands.length);
-                       newCommands[0] = newCommand;
-               } else {
-                       for (int i = 0, max = oldCommands.length; i < max; i++) {
-                               if (oldCommands[i] == oldJavaCommand) {
-                                       oldCommands[i] = newCommand;
-                                       break;
-                               }
-                       }
-                       newCommands = oldCommands;
-               }
-
-               // Commit the spec change into the project
-               description.setBuildSpec(newCommands);
-               getProject().setDescription(description, null);
-       }
+//     private void setJavaCommand(IProjectDescription description,
+//                     ICommand newCommand) throws CoreException {
+//
+//             ICommand[] oldCommands = description.getBuildSpec();
+//             ICommand oldJavaCommand = getJavaCommand(description);
+//             ICommand[] newCommands;
+//
+//             if (oldJavaCommand == null) {
+//                     // Add a Java build spec before other builders (1FWJK7I)
+//                     newCommands = new ICommand[oldCommands.length + 1];
+//                     System
+//                                     .arraycopy(oldCommands, 0, newCommands, 1,
+//                                                     oldCommands.length);
+//                     newCommands[0] = newCommand;
+//             } else {
+//                     for (int i = 0, max = oldCommands.length; i < max; i++) {
+//                             if (oldCommands[i] == oldJavaCommand) {
+//                                     oldCommands[i] = newCommand;
+//                                     break;
+//                             }
+//                     }
+//                     newCommands = oldCommands;
+//             }
+//
+//             // Commit the spec change into the project
+//             description.setBuildSpec(newCommands);
+//             getProject().setDescription(description, null);
+//     }
 
        /**
         * @see net.sourceforge.phpdt.core.IJavaProject#setOptions(Map)