Author: vrubezhny
Date: 2009-09-29 12:53:34 -0400 (Tue, 29 Sep 2009)
New Revision: 17806
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java
Log:
JBIDE-4923: Code assist for EL doesn't work in XML files.
Issue is fixed
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java 2009-09-29
16:48:35 UTC (rev 17805)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java 2009-09-29
16:53:34 UTC (rev 17806)
@@ -13,11 +13,13 @@
import java.io.File;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.INameSpace;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -65,13 +67,32 @@
return result.toArray(new IComponent[0]);
}
+ private static final List<String> EMPTY_PREFIXES = new ArrayList<String>();
/*
* (non-Javadoc)
* @see
org.jboss.tools.jst.web.kb.internal.taglib.AbstractTagLib#getPrefixes(org.jboss.tools.jst.web.kb.KbQuery,
org.jboss.tools.jst.web.kb.IPageContext)
*/
@Override
protected List<String> getPrefixes(KbQuery query, IPageContext context) {
- return null;
+
+ Map<String, List<INameSpace>> nameSpaces =
context.getNameSpaces(query.getOffset());
+ if(nameSpaces!=null) {
+ List<INameSpace> nameSpace = nameSpaces.get(getURI());
+ if(nameSpace!=null) {
+ for (INameSpace n : nameSpace) {
+ String sPrefix = n.getPrefix();
+
+ // JBIDE-4923: This fake URI is added by JSP- or FaceletPage- Content Assist
Processors
+ // due to indicate that HTML schemas are to be used is query.
+ // For the Xml Content Assist Processor we need to return an empty prefix list (but
not null)
+ // due to prevent HTML schemas usage
+ //
+ if ("".equals(sPrefix)) //$NON-NLS-1$
+ return null;
+ }
+ }
+ }
+ return EMPTY_PREFIXES;
}
/*
Show replies by date