Author: scabanovich
Date: 2009-09-30 09:43:49 -0400 (Wed, 30 Sep 2009)
New Revision: 17819
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4934
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java 2009-09-30
13:42:53 UTC (rev 17818)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java 2009-09-30
13:43:49 UTC (rev 17819)
@@ -16,12 +16,11 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
+import org.jboss.tools.jst.web.tld.model.TLDUtil;
public class JSFProjectTagLibs extends JSFProjectResourceBundles {
private static final long serialVersionUID = 7805053632320764494L;
- static String FILE_FACELET_TAGLIB = "FileFaceletTaglib";
-
protected Iterator<XModelObject> getRoots() {
List<XModelObject> list = new ArrayList<XModelObject>();
XModelObject r = getModel().getByPath("FileSystems/WEB-INF");
@@ -48,13 +47,16 @@
}
Iterator<XModelObject> it = list.iterator();
- Set<String> set = new HashSet<String>();
+ Set<String> tlds = new HashSet<String>();
+ Set<String> facelets = new HashSet<String>();
while(it.hasNext()) {
XModelObject o = it.next();
String uri = o.getAttributeValue("uri");
- if(uri != null && uri.length() == 0 && isFaceletTaglibFile(o)) {
+ boolean isFacelet = TLDUtil.isFaceletTaglib(o);
+ if(uri != null && uri.length() == 0 && isFacelet) {
uri = o.getAttributeValue("library-class");
}
+ Set<String> set = isFacelet ? facelets : tlds;
if(set.contains(uri)) {
it.remove();
} else {
@@ -87,7 +89,7 @@
protected boolean acceptFile(XModelObject o) {
if("META-INF".equals(o.getParent().getAttributeValue("name"))) {
- if(isFaceletTaglibFile(o)) return true;
+ if(TLDUtil.isFaceletTaglib(o)) return true;
}
return isTLDFile(o);
}
@@ -97,11 +99,6 @@
return TLD_ENTITIES.indexOf(entity) >= 0;
}
- public static boolean isFaceletTaglibFile(XModelObject o) {
- String entity = o.getModelEntity().getName();
- return entity.startsWith(FILE_FACELET_TAGLIB);
- }
-
public Object getAdapter(Class adapter) {
if(adapter == IResource.class) {
XModelObject o = getModel().getByPath("FileSystems/WEB-INF");