Author: mareshkau
Date: 2009-12-02 11:00:10 -0500 (Wed, 02 Dec 2009)
New Revision: 19001
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestForUsingComponentsLibrariesWithDefaultNamespace.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHasInParents.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5352
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html 2009-12-02
15:41:47 UTC (rev 19000)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html 2009-12-02
16:00:10 UTC (rev 19001)
@@ -10,5 +10,6 @@
<a
href="jsf2test/pages/components/outputScript.xhtml">h:outputScript</a><br>
<a
href="jsf2test/pages/components/outputStylesheet.xhtml">h:outputStylesheet</a><br>
<a href="jsf2test/pages/JBIDE/5135/jbide5135.xhtml">Resource Test
Page</a><br>
+ <a href="jsf2test/pages/JBIDE/5352/jbide5352.xhtml">Test Page with
template name resolving for default tags</a><br>
</body>
</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml 2009-12-02
16:00:10 UTC (rev 19001)
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core">
+<body
xmlns="http://java.sun.com/jsf/html" id="jbide5353Test">
+ <f:view>
+ <outputText value="Default namespace detection test page" />
+ <h1></h1>
+ <inputText value="Test" />
+ </f:view>
+</body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml.xml 2009-12-02
16:00:10 UTC (rev 19001)
@@ -0,0 +1,23 @@
+<tests>
+ <test id="jbide5353Test">
+<DIV ID="jbide5353Test">
+<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width:
100%;">
+<TR>
+<TD>
+<DIV>
+<SPAN CLASS="vpe-text">
+Default namespace detection test page
+</SPAN>
+<DIV CLASS="__any__tag__caption" STYLE="border: 1px solid green;
-moz-user-modify: read-only;">
+h1<BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green;
-moz-user-modify: read-only;"/>
+
+</DIV>
+<INPUT VALUE="Test"/>
+
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+ </test>
+</tests>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml 2009-12-02
16:00:10 UTC (rev 19001)
@@ -0,0 +1,46 @@
+<document
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns="http://jboss.com/products/seam/pdf"
id="jbide5352Test">
+
+ <image alignment="right" wrap="true"
value="/jboss.jpg" />
+ <font size="24"><paragraph spacingAfter="50">Table
Test</paragraph></font>
+
+ <table columns="4">
+ <f:facet name="defaultCell">
+ <cell horizontalAlignment="center"
verticalAlignment="middle" />
+ </f:facet>
+ <cell backgroundColor="yellow"
colspan="2"><paragraph>cell 1</paragraph></cell>
+ <cell><paragraph>cell 2</paragraph></cell>
+ <cell><paragraph>cell 3</paragraph></cell>
+ <cell><paragraph>cell 4</paragraph></cell>
+ <cell backgroundColor="red"
colspan="2"><paragraph>cell 5</paragraph></cell>
+ <cell><paragraph>cell 6</paragraph></cell>
+ <cell><paragraph>cell 7</paragraph></cell>
+ <cell><paragraph>cell 8</paragraph></cell>
+ <cell backgroundColor="green"
colspan="2"><paragraph>cell 9</paragraph></cell>
+ </table>
+
+ <paragraph spacingBefore="10" spacingAfter="10">This is
another table. It should be large enough to span multiple pages with the headers repeated
on other page</paragraph>
+
+
+ <table widths="1 4" columns="2" headerRows="1">
+ <cell grayFill=".3" paddingBottom="10"
horizontalAlignment="center" colspan="2">
+ <font size="20"><paragraph
alignment="center">This is a header</paragraph></font>
+ </cell>
+
+
+ <ui:repeat value="#{lists.numbers}" var="week">
+ <cell rotation="90" horizontalAlignment="center"
verticalAlignment="middle" grayFill=".7">
+ <font size="30"><paragraph>Week
#{week}</paragraph></font>
+ </cell>
+ <cell paddingLeft="0" paddingRight="0"
paddingTop="0" paddingBottom="0">
+ <table widths="1.25 4" columns="2"
widthPercentage="100">
+ <ui:repeat value="#{lists.daysOfWeek}"
var="day">
+ <cell paddingBottom="6">#{day}</cell>
+ <cell paddingBottom="6">Blah blah
blah</cell>
+ </ui:repeat>
+ </table>
+ </cell>
+ </ui:repeat>
+ </table>
+</document>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml 2009-12-02
16:00:10 UTC (rev 19001)
@@ -0,0 +1,138 @@
+<tests>
+ <test id="jbide5352Test">
+ <DIV STYLE="margin: 36px;">
+<SPAN STYLE="">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+Table Test
+</SPAN>
+</DIV>
+</SPAN>
+<DIV>
+<TABLE CELLSPACING="0px" ALIGN="center"
WIDTH="100%">
+</TABLE>
+<DIV STYLE="display: none;">
+</DIV>
+<TD COLSPAN="2" STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 1
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 2
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 3
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 4
+</SPAN>
+</DIV>
+</TD>
+<TD COLSPAN="2" STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 5
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 6
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 7
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 8
+</SPAN>
+</DIV>
+</TD>
+<TD COLSPAN="2" STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 9
+</SPAN>
+</DIV>
+</TD>
+</DIV>
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+This is another table. It should be large enough to span multiple pages with the headers
repeated on other page
+</SPAN>
+</DIV>
+<DIV>
+<TABLE CELLSPACING="0px" ALIGN="center"
WIDTH="100%">
+</TABLE>
+<TD ALIGN="center" COLSPAN="2" STYLE="border: 2px solid
black;">
+<SPAN STYLE="">
+<DIV ALIGN="center"><BR/>
+
+<SPAN CLASS="vpe-text">
+This is a header
+</SPAN>
+</DIV>
+</SPAN>
+</TD>
+<TD ALIGN="center" VALIGN="middle" STYLE="border: 2px solid
black;">
+<SPAN STYLE="">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+Week #{week}
+</SPAN>
+</DIV>
+</SPAN>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV>
+<TABLE CELLSPACING="0px" ALIGN="center"
WIDTH="100%">
+</TABLE>
+<TD STYLE="border: 2px solid black;">
+<SPAN CLASS="vpe-text">
+#{day}
+</SPAN>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<SPAN CLASS="vpe-text">
+Blah blah blah
+</SPAN>
+</TD>
+</DIV>
+</TD>
+</DIV>
+</DIV>
+ </test>
+</tests>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-12-02
15:41:47 UTC (rev 19000)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-12-02
16:00:10 UTC (rev 19001)
@@ -72,6 +72,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.MozDirtyTest_JBIDE5105;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.NullPointerWithStyleProperty_JBIDE5193;
+import
org.jboss.tools.jsf.vpe.jsf.test.jbide.TestForUsingComponentsLibrariesWithDefaultNamespace;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.VpeI18nTest_JBIDE4887;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1467Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1501Test;
@@ -106,6 +107,7 @@
TestSuite suite = new TestSuite("Tests for Vpe Jsf components");
//$NON-NLS-1$
// $JUnit-BEGIN$
+ suite.addTestSuite(TestForUsingComponentsLibrariesWithDefaultNamespace.class);
suite.addTestSuite(EditingSPecialSymbolsVPE_JBIDE3810.class);
suite.addTestSuite(MozDirtyTest_JBIDE5105.class);
suite.addTestSuite(VpeI18nTest_JBIDE4887.class);
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestForUsingComponentsLibrariesWithDefaultNamespace.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestForUsingComponentsLibrariesWithDefaultNamespace.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestForUsingComponentsLibrariesWithDefaultNamespace.java 2009-12-02
16:00:10 UTC (rev 19001)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.ui.test.ComponentContentTest;
+
+/**
+ * @author mareshkau
+ * Test for JBIDE-5352
+ */
+public class TestForUsingComponentsLibrariesWithDefaultNamespace extends
ComponentContentTest{
+
+ public TestForUsingComponentsLibrariesWithDefaultNamespace(String name) {
+ super(name);
+ }
+
+ public void testCheckContetnForDefaultNamespace() throws Throwable{
+ performContentTest("JBIDE/5352/table.xhtml"); //$NON-NLS-1$
+ performContentTest("JBIDE/5352/jbide5352.xhtml"); //$NON-NLS-1$
+
+ }
+
+ @Override
+ protected String getTestProjectName() {
+ return JsfAllTests.IMPORT_JSF_20_PROJECT_NAME;
+ }
+
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2009-12-02
15:41:47 UTC (rev 19000)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2009-12-02
16:00:10 UTC (rev 19001)
@@ -371,9 +371,12 @@
return ATTRIBUTE_TEMPLATE_NAME;
case Node.ELEMENT_NODE:
String sourcePrefix = sourceNode.getPrefix();
-
- if (sourcePrefix == null
- || ((IDOMElement)sourceNode).isJSPTag()
+ //added by Maksim Areshkau as fix for JBIDE-5352
+ if(sourcePrefix==null) {
+ sourcePrefix=""; //$NON-NLS-1$
+ }
+
+ if (((IDOMElement)sourceNode).isJSPTag()
|| "jsp".equals(sourcePrefix)) { //$NON-NLS-1$
return sourceNode.getNodeName();
}
@@ -383,7 +386,7 @@
TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(sourcePrefix, taglibs);
if(sourceNodeTaglib == null) {
- return null;
+ return sourceNode.getNodeName();
}
String sourceNodeUri = sourceNodeTaglib.getUri();
@@ -403,7 +406,7 @@
&&CustomTLDReference.isExistInJsf2CustomComponenets(pageContext,sourceNodeUri,sourceNode.getLocalName())
) {
return VpeTemplateManager.JSF2_CUSTOM_TEMPLATE;
}
- return null;
+ return sourceNode.getNodeName();
default :
return null;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHasInParents.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHasInParents.java 2009-12-02
15:41:47 UTC (rev 19000)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHasInParents.java 2009-12-02
16:00:10 UTC (rev 19001)
@@ -27,6 +27,11 @@
while (parentNode != null) {
String parentSourcePrefix = parentNode.getPrefix();
+ //added by Maksim Areshkau, as fix for JBIDE-5352
+ //
+ if(parentSourcePrefix==null) {
+ parentSourcePrefix=""; //$NON-NLS-1$
+ }
List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(parentNode,
pageContext);
TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2009-12-02
15:41:47 UTC (rev 19000)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2009-12-02
16:00:10 UTC (rev 19001)
@@ -177,12 +177,15 @@
*/
private static void processAttribute(List<TaglibData> taglibs, Attr attr) {
- String startStr = "xmlns:"; //$NON-NLS-1$
+ String startStr = "xmlns"; //$NON-NLS-1$
String name = attr.getName();
if (!name.startsWith(startStr)) {
return;
}
name = name.substring(startStr.length());
+ if(name.startsWith(":")){ //$NON-NLS-1$
+ name = name.substring(1);//remove : in start of name
+ }
addTaglib(taglibs , attr.getValue(), name, true);
return;
}