Author: scabanovich
Date: 2010-02-01 09:33:46 -0500 (Mon, 01 Feb 2010)
New Revision: 20051
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5764
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2010-02-01
14:32:51 UTC (rev 20050)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2010-02-01
14:33:46 UTC (rev 20051)
@@ -89,10 +89,41 @@
}
}
}
+ XModelObject[] ps = o.getChildren();
+ for (int i = 0; i < ps.length; i++) {
+ if(ps[i] == metaInf || ps[i].getFileType() != XModelObject.FOLDER) continue;
+ LoadedDeclarations ds1 = parseInPackages(ps[i], path, sp);
+ if(ds1 != null) ds.add(ds1);
+ }
return ds;
}
+ public LoadedDeclarations parseInPackages(XModelObject o, IPath path, IKbProject sp)
throws ScannerException {
+ LoadedDeclarations ds = new LoadedDeclarations();
+ XModelObject[] tlds = o.getChildren();
+ for (XModelObject tld: tlds) {
+ if(isFaceletTaglibFile(tld)) {
+ XMLScanner s = new XMLScanner();
+ LoadedDeclarations ds1 = s.parse(tld, path, sp);
+ ds = add(ds, ds1);
+ if(ds1 != null && !ds1.isEmpty()) {
+ System.out.println(tld.getPath() + ":" +
ds1.getLibraries().get(0).getURI());
+ }
+ } else if(tld.getFileType() == XModelObject.FOLDER) {
+ LoadedDeclarations ds1 = parseInPackages(tld, path, sp);
+ ds = add(ds, ds1);
+ }
+ }
+ return ds;
+ }
+ private LoadedDeclarations add(LoadedDeclarations total, LoadedDeclarations addition) {
+ if(addition == null || addition.isEmpty()) return total;
+ if(total == null) total = new LoadedDeclarations();
+ total.add(addition);
+ return total;
+ }
+
public static boolean isTLDFile(XModelObject o) {
if(o == null) return false;
String entity = o.getModelEntity().getName();
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java 2010-02-01
14:32:51 UTC (rev 20050)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java 2010-02-01
14:33:46 UTC (rev 20051)
@@ -32,4 +32,8 @@
libraries.addAll(ds.libraries);
}
+ public boolean isEmpty() {
+ return libraries.isEmpty();
+ }
+
}