Author: mareshkau
Date: 2008-02-13 15:20:43 -0500 (Wed, 13 Feb 2008)
New Revision: 6305
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/XmlUtil.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-788
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-02-13
17:24:27 UTC (rev 6304)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-02-13
20:20:43 UTC (rev 6305)
@@ -644,15 +644,10 @@
}
public VpeTaglibManager getTaglibManager() {
- if (visualEditor != null) {
- IVisualController controller = visualEditor.getController();
- if (controller != null) {
- IVisualContext context = controller.getPageContext();
- if (context != null) {
- if(context instanceof VpeTaglibManager)
- return (VpeTaglibManager)context;
- }
- }
+ if(sourceEditor!=null) {
+ if(sourceEditor.getPageContext() instanceof VpeTaglibManager)
+
+ return (VpeTaglibManager)sourceEditor.getPageContext();
}
return null;
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-02-13
17:24:27 UTC (rev 6304)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-02-13
20:20:43 UTC (rev 6305)
@@ -78,8 +78,13 @@
* @param iDocument
*/
public void setDocument(IDocument iDocument) {
-
- setTaglibs(XmlUtil.getTaglibsForJSPDocument(iDocument));
+
+ List<TaglibData> taglibs =XmlUtil.getTaglibsForJSPDocument(iDocument);
+ //if we on jsp page we will set taglibs
+ //TODO Max Areshkau Find other passability to check if we on jsp page
+ if(taglibs!=null && taglibs.size()>0) {
+ setTaglibs(XmlUtil.getTaglibsForJSPDocument(iDocument));
+ }
try {
connector =
(WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR,
iDocument);
} catch (InstantiationException e) {
@@ -139,7 +144,7 @@
while (iter.hasNext()) {
TaglibData taglib = (TaglibData)iter.next();
if (!taglib.inList(clone)) {
- clone.add(taglib);
+ clone.add(taglib);
}
}
return clone;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/XmlUtil.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/XmlUtil.java 2008-02-13
17:24:27 UTC (rev 6304)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/XmlUtil.java 2008-02-13
20:20:43 UTC (rev 6305)
@@ -31,6 +31,10 @@
import org.xml.sax.InputSource;
public class XmlUtil {
+
+ private static final String XMLNS = "xmlns";
+
+ private static final String XMLNS_WITH_PREFIX = "xmlns:";
public static Element getDocumentElement(String xmlFileName) throws Exception {
FileInputStream inStream = null;
@@ -123,12 +127,18 @@
*/
private static void processAttribute(List<TaglibData> taglibs, Attr attr, boolean
bScopePrefix) {
- String startStr = "xmlns:";
String name = attr.getName();
- if (!name.startsWith(startStr)) {
+ if (!name.startsWith(XMLNS)) {
return;
}
- name = name.substring(startStr.length());
+
+ if(XMLNS.equals(name)) {
+
+ name="";
+ } else {
+
+ name=name.substring(XMLNS_WITH_PREFIX.length());
+ }
addTaglib(taglibs , attr.getValue(), name, true, bScopePrefix);
return;
}