woproject/projects/wolips/plugins/org.objectstyle.wolips.jdt/java/org/objectstyle/wolips/jdt/classpath/model Framework.java,1.2,1.3 FrameworkFilenameFilter.java,1.2,1.3
[email protected] Mon, 20 Mar 2006 15:27:11 -0800 (PST)
| Newsgroups | gmane.comp.web.webobjects.woproject.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.jdt/java/org/objectstyle/wolips/jdt/classpath/model
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26426/wolips/plugins/org.objectstyle.wolips.jdt/java/org/objectstyle/wolips/jdt/classpath/model
Modified Files:
Framework.java FrameworkFilenameFilter.java
Log Message:
http://objectstyle.org/jira/browse/WOL-210
Fixed and tested thouroughly for a few month on both Eclipse 3.1.x and Eclipse 3.2M5 version of WOLips.
Index: Framework.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.jdt/java/org/objectstyle/wolips/jdt/classpath/model/Framework.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Framework.java 11 Dec 2004 10:26:08 -0000 1.2
+++ Framework.java 20 Mar 2006 23:26:10 -0000 1.3
@@ -58,6 +58,7 @@
import java.util.ArrayList;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
/**
* @author ulrich
@@ -68,15 +69,17 @@
private String jarFiles[];
private String zipFiles[];
private String order;
- private IPath srcPath;
+ private String sourceFile;
private IPath javaDocPath;
+ private IPath srcPath;
private boolean exported = false;
- protected Framework(String name, Root root, String jarFiles[], String zipFiles[]) {
+ protected Framework(String name, Root root, String jarFiles[], String zipFiles[], String sourceFile) {
this.name = name;
this.root = root;
this.jarFiles = jarFiles;
this.zipFiles = zipFiles;
+ this.sourceFile = sourceFile;
}
/**
@@ -156,7 +159,7 @@
* @return Returns the srcPath.
*/
public IPath getSrcPath() {
- return srcPath;
+ return this.srcPath;
}
/**
* @param srcPath The srcPath to set.
@@ -164,4 +167,14 @@
public void setSrcPath(IPath srcPath) {
this.srcPath = srcPath;
}
+
+ /**
+ * @return
+ */
+ public IPath getSourcePath() {
+ IPath sourcePath = null;
+ if (sourceFile != null)
+ sourcePath = libraryPath(sourceFile);
+ return sourcePath;
+ }
}
\ No newline at end of file
Index: FrameworkFilenameFilter.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.jdt/java/org/objectstyle/wolips/jdt/classpath/model/FrameworkFilenameFilter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- FrameworkFilenameFilter.java 11 Dec 2004 10:26:08 -0000 1.2
+++ FrameworkFilenameFilter.java 20 Mar 2006 23:26:10 -0000 1.3
@@ -71,7 +71,7 @@
protected ArrayList frameworks() {
return this.arrayList;
}
-
+
/**
* @param file
* @param name
@@ -88,13 +88,20 @@
if (resDir.exists()) {
String jarFiles[] = resDir.list(new WildcardFilenameFilter(
- null, ".jar"));
+ null, ".jar", "src.jar"));
String zipFiles[] = resDir.list(new WildcardFilenameFilter(
null, ".zip"));
-
+
+ String srcFiles[] = resDir.list(new WildcardFilenameFilter(
+ "src", ".jar"));
+ String srcFile = null;
+ if (srcFiles != null && srcFiles.length > 0)
+ srcFile = srcFiles[0];
+
result = (0 != jarFiles.length) || (0 != zipFiles.length);
Framework framework = new Framework(name.substring(0, name.length() - ".framework".length()), this.root, jarFiles,
- zipFiles);
+ zipFiles, srcFile);
+
this.arrayList.add(framework);
}
@@ -113,22 +120,28 @@
}
private static final class WildcardFilenameFilter implements FilenameFilter {
- WildcardFilenameFilter(String prefix, String suffix) {
- this._prefix = prefix;
- this._suffix = suffix;
- }
+ WildcardFilenameFilter(String prefix, String suffix) {
+ this(prefix, suffix, null);
+ }
+ WildcardFilenameFilter(String prefix, String suffix, String exclude) {
+ this._prefix = prefix;
+ this._suffix = suffix;
+ this._exclude = exclude;
+ }
public boolean accept(File file, String name) {
String lowerName = name.toLowerCase();
- return (((null == this._prefix) || lowerName
- .startsWith(this._prefix)) && ((null == this._suffix) || lowerName
- .endsWith(this._suffix)));
+ return ( ((null == this._exclude) || (! lowerName.equals(this._exclude)))
+ && ((null == this._prefix) || lowerName.startsWith(this._prefix))
+ && ((null == this._suffix) || lowerName.endsWith(this._suffix)));
}
String _prefix;
String _suffix;
+
+ String _exclude;
}
}
\ No newline at end of file
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642