From: Martin W. <mar...@us...> - 2005-09-02 15:59:25
|
Update of /cvsroot/aseclipseplugin/org.asdt.core/src/org/asdt/core/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14673/src/org/asdt/core/resources Modified Files: ClasspathManager.java PackageManager.java AS2TypeManager.java Log Message: Cleaned up javadoc comments. Refactor word list classes. Standardised spelling of 'classpathes' to classpath. Index: AS2TypeManager.java =================================================================== RCS file: /cvsroot/aseclipseplugin/org.asdt.core/src/org/asdt/core/resources/AS2TypeManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AS2TypeManager.java 24 Aug 2005 02:22:27 -0000 1.9 --- AS2TypeManager.java 2 Sep 2005 15:59:13 -0000 1.10 *************** *** 33,36 **** --- 33,37 ---- import java.util.Iterator; import java.util.List; + import org.asdt.core.dom.ASClass; import org.asdt.core.dom.ASFunction; *************** *** 40,53 **** import org.asdt.core.dom.IAS2Element; import org.asdt.core.dom.QualifiedName; - import org.asdt.core.util.WordRegion; import org.asdt.core.util.ASPartitionScanner; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; - import org.eclipse.core.resources.IResourceChangeEvent; - import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.core.resources.IResourceVisitor; - import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Path; --- 41,51 ---- import org.asdt.core.dom.IAS2Element; import org.asdt.core.dom.QualifiedName; import org.asdt.core.util.ASPartitionScanner; + import org.asdt.core.util.WordRegion; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceVisitor; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Path; *************** *** 55,59 **** import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentPartitioner; - import org.eclipse.jface.text.rules.DefaultPartitioner; import org.eclipse.jface.text.rules.FastPartitioner; --- 53,56 ---- *************** *** 311,315 **** * @param project * @param classpath - * @return if the comleation was sucessfull */ public void completeTypeDeclaration(QualifiedName type, ASClass asObject, IProject project, List classpath) --- 308,311 ---- *************** *** 494,499 **** * * @param project ! * @param classPath ! * @return */ public IResource[] getAllASClasses(IProject project, List classPathList) --- 490,495 ---- * * @param project ! * @param classPathList ! * @return all class within the project and its associated classpaths */ public IResource[] getAllASClasses(IProject project, List classPathList) *************** *** 506,512 **** * * @param project ! * @param classPath * @param name the classname or "*" for all classes ! * @return */ public IResource[] getASClassesWithName(IProject project, List classPathList,final String name) --- 502,508 ---- * * @param project ! * @param classPathList * @param name the classname or "*" for all classes ! * @return filtered list of classes within the project and its associated classpaths */ public IResource[] getASClassesWithName(IProject project, List classPathList,final String name) *************** *** 567,572 **** * * @param project ! * @param classPath ! * @return */ public IResource[] getAllASInterfaces(IProject project, List classPathList) --- 563,568 ---- * * @param project ! * @param classPathList ! * @return array of interface resources within the project and its associated classpaths */ public IResource[] getAllASInterfaces(IProject project, List classPathList) *************** *** 641,645 **** * @param parseBody * parse the class/interface body or not ! * @return */ public ASClass getASTypeForResource(IResource resource, boolean parseBody) --- 637,641 ---- * @param parseBody * parse the class/interface body or not ! * @return the actionscript class defined by the resource */ public ASClass getASTypeForResource(IResource resource, boolean parseBody) Index: PackageManager.java =================================================================== RCS file: /cvsroot/aseclipseplugin/org.asdt.core/src/org/asdt/core/resources/PackageManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PackageManager.java 23 Jul 2005 03:24:46 -0000 1.4 --- PackageManager.java 2 Sep 2005 15:59:13 -0000 1.5 *************** *** 58,66 **** * if packagename is empty or null, you will get all folders of * the root ! * @param editor ! * projects * @return the container for the package or null if it doesn't exist. */ ! public IContainer[] getWorkspaceFolderForPackage(String packageName, IProject project, List classPath) { if (packageName == null) --- 58,66 ---- * if packagename is empty or null, you will get all folders of * the root ! * @param project The containing project ! * @param classPathList The list of class paths to search * @return the container for the package or null if it doesn't exist. */ ! public IContainer[] getWorkspaceFolderForPackage(String packageName, IProject project, List classPathList) { if (packageName == null) *************** *** 70,75 **** // new Folderlist List folderList = new ArrayList(); // look in each sourcfolder for package ! for (Iterator iter = classPath.iterator(); iter.hasNext();) { // added support for "." path --- 70,76 ---- // new Folderlist List folderList = new ArrayList(); + // look in each sourcfolder for package ! for (Iterator iter = classPathList.iterator(); iter.hasNext();) { // added support for "." path *************** *** 87,90 **** --- 88,92 ---- currentFolder = classPathFolder; } + if (tokens.length > 0) { *************** *** 151,155 **** /** ! * Get name oft the files in the package * * @param packageName --- 153,157 ---- /** ! * Get name of the files in the package * * @param packageName *************** *** 158,162 **** * @param classPath * the classpathes ! * @return */ public String[] getFileNamesForPackage(String packageName, IProject project, List classPath) --- 160,164 ---- * @param classPath * the classpathes ! * @return array of file names within the package */ public String[] getFileNamesForPackage(String packageName, IProject project, List classPath) *************** *** 231,240 **** /** ! * checks if the package exist in the project within the spezific classPath * * @param project * @param packageName ! * @param sourcePath ! * @return */ public boolean packageExists(IProject project, String packageName, String classPath) --- 233,242 ---- /** ! * checks if the package exist in the project within the specific classPath * * @param project * @param packageName ! * @param classPath ! * @return existence of the package within the project and the supplied classpath */ public boolean packageExists(IProject project, String packageName, String classPath) Index: ClasspathManager.java =================================================================== RCS file: /cvsroot/aseclipseplugin/org.asdt.core/src/org/asdt/core/resources/ClasspathManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClasspathManager.java 24 Jun 2005 22:40:13 -0000 1.4 --- ClasspathManager.java 2 Sep 2005 15:59:13 -0000 1.5 *************** *** 51,54 **** --- 51,61 ---- private final static String CLASSPATH_FILE = ".classpath"; + /** + * NOTE : I have left the spelling of this one as 'classpathes' so as not + * to break any existing classpath files. Although it appears that + * the root element name is only ever used when writing the file + * and is ignored when reading, so it could probably be changed + * without any impact. + */ private final static String ROOT_ELEMENT_NAME = "AS2Classpathes"; private final static String CLASSPATH_ELEMENT_NAME= "AS2Classpath"; *************** *** 66,70 **** /** ! * returns the list of classpathes (core and source) defined for the project * * @param project --- 73,77 ---- /** ! * returns the list of classpaths (core and source) defined for the project * * @param project *************** *** 79,93 **** /** ! * returns the list of classpathes (core and source) defined for the project and referenced projects with full path * * @param project * @return List for Strings */ ! public List getProjectAllClasspathes(IProject project) { ! List classPathes = new ArrayList(); ! // Get current projet classpathes ! classPathes.addAll(convertRelativeToAbsolute(project, getProjectClasspath(project))); // Check referenced projects --- 86,100 ---- /** ! * returns the list of classpaths (core and source) defined for the project and referenced projects with full path * * @param project * @return List for Strings */ ! public List getProjectAllClasspaths(IProject project) { ! List classPaths = new ArrayList(); ! // Get current projet classpaths ! classPaths.addAll(convertRelativeToAbsolute(project, getProjectClasspath(project))); // Check referenced projects *************** *** 101,106 **** // Check if it's AS Nature if (referencedProject.hasNature(IASCoreConstants.AS_NATURE_ID)) { ! List referencedClassPathes = getSourceClasspath(referencedProject); ! classPathes.addAll(convertRelativeToAbsolute(referencedProject, referencedClassPathes)); } } --- 108,113 ---- // Check if it's AS Nature if (referencedProject.hasNature(IASCoreConstants.AS_NATURE_ID)) { ! List referencedClassPaths = getSourceClasspath(referencedProject); ! classPaths.addAll(convertRelativeToAbsolute(referencedProject, referencedClassPaths)); } } *************** *** 110,127 **** ! return classPathes; } /** ! * Convert relative classpathes to absolute classpathes * * @param project ! * @param classPathes ! * @return */ ! public List convertRelativeToAbsolute(IProject project, List classPathes) { ! List pathes = new ArrayList(); ! for (Iterator iter = classPathes.iterator(); iter.hasNext();) { String path = (String) iter.next(); IContainer container; --- 117,134 ---- ! return classPaths; } /** ! * Convert relative classpaths to absolute classpaths * * @param project ! * @param classPaths ! * @return list of absolute classpaths */ ! public List convertRelativeToAbsolute(IProject project, List classPaths) { ! List paths = new ArrayList(); ! for (Iterator iter = classPaths.iterator(); iter.hasNext();) { String path = (String) iter.next(); IContainer container; *************** *** 132,156 **** if (container.getLocation() != null) ! pathes.add(container.getLocation()); } ! return pathes; } /** ! * returns the list of classpathes (only source) defined for the project * @param project * @return List for Strings */ public List getSourceClasspath(IProject project) { ! return getClasspathesFromFile(project); } /** ! * returns the list of classpathes (only core) defined for the project * this will return a list with just 1 element, the "core classpath", to * use this method for classpath ! * @param project ! * @return List for Strings */ public List getCoreClasspath() { --- 139,162 ---- if (container.getLocation() != null) ! paths.add(container.getLocation()); } ! return paths; } /** ! * returns the list of classpaths (only source) defined for the project * @param project * @return List for Strings */ public List getSourceClasspath(IProject project) { ! return getClasspathsFromFile(project); } /** ! * returns the list of classpaths (only core) defined for the project * this will return a list with just 1 element, the "core classpath", to * use this method for classpath ! * @return List of Strings */ public List getCoreClasspath() { *************** *** 162,167 **** } ! public List getClasspathesFromFile(IProject project) { ! ArrayList classPathes = new ArrayList(); SAXBuilder builder = new SAXBuilder(); File file = project.getFile(CLASSPATH_FILE).getLocation().toFile(); --- 168,173 ---- } ! public List getClasspathsFromFile(IProject project) { ! ArrayList classPaths = new ArrayList(); SAXBuilder builder = new SAXBuilder(); File file = project.getFile(CLASSPATH_FILE).getLocation().toFile(); *************** *** 169,177 **** Document doc = builder.build(file); Element root = doc.getRootElement(); ! java.util.List xmlClasspathes = root.getChildren(CLASSPATH_ELEMENT_NAME); ! for (Iterator iter = xmlClasspathes.iterator(); iter.hasNext();) { Element element = (Element) iter.next(); if (element.getAttributeValue(CLASSPATH_ELEMENT_TYPE_ATTRIBUTE_NAME).equals(CLASSPATH_ELEMENT_TYPE_ATTRIBUTE_VALUE)) { ! classPathes.add(element.getTextNormalize()); } --- 175,183 ---- Document doc = builder.build(file); Element root = doc.getRootElement(); ! java.util.List xmlClasspaths = root.getChildren(CLASSPATH_ELEMENT_NAME); ! for (Iterator iter = xmlClasspaths.iterator(); iter.hasNext();) { Element element = (Element) iter.next(); if (element.getAttributeValue(CLASSPATH_ELEMENT_TYPE_ATTRIBUTE_NAME).equals(CLASSPATH_ELEMENT_TYPE_ATTRIBUTE_VALUE)) { ! classPaths.add(element.getTextNormalize()); } *************** *** 183,195 **** } ! return classPathes; } ! public void setClassPathesToFile(IProject project, List classpathes) { Document doc = new Document(); Element root = new Element(ROOT_ELEMENT_NAME); ! for (Iterator iter = classpathes.iterator(); iter.hasNext();) { Element classPath = new Element(CLASSPATH_ELEMENT_NAME); classPath.setAttribute(CLASSPATH_ELEMENT_TYPE_ATTRIBUTE_NAME, CLASSPATH_ELEMENT_TYPE_ATTRIBUTE_VALUE); --- 189,201 ---- } ! return classPaths; } ! public void setClassPathsToFile(IProject project, List classpaths) { Document doc = new Document(); Element root = new Element(ROOT_ELEMENT_NAME); ! for (Iterator iter = classpaths.iterator(); iter.hasNext();) { Element classPath = new Element(CLASSPATH_ELEMENT_NAME); classPath.setAttribute(CLASSPATH_ELEMENT_TYPE_ATTRIBUTE_NAME, CLASSPATH_ELEMENT_TYPE_ATTRIBUTE_VALUE); |