[jbosstools-commits] JBoss Tools SVN: r36051 - in trunk/jsf: plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Oct 27 13:18:43 EDT 2011


Author: dmaliarevich
Date: 2011-10-27 13:18:43 -0400 (Thu, 27 Oct 2011)
New Revision: 36051

Modified:
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlOutTemplate.java
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/resources/jstlTests/WebContent/pages/components/out.jsp
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/resources/jstlTests/WebContent/pages/components/out.jsp.xml
Log:
https://issues.jboss.org/browse/JBIDE-9417 - <c:out> template was updated, junit was updated.

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java	2011-10-27 17:14:56 UTC (rev 36050)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfInputTextTemplate.java	2011-10-27 17:18:43 UTC (rev 36051)
@@ -29,11 +29,8 @@
 
 	public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
 			nsIDOMDocument visualDocument) {
-
 		Element sourceElement = (Element) sourceNode;
-
 		nsIDOMElement input = visualDocument.createElement(HTML.TAG_INPUT);
-
 		/*
          * https://jira.jboss.org/jira/browse/JBIDE-3225
          * Component should render its children.
@@ -41,29 +38,19 @@
 		VpeCreationData creationData = VisualDomUtil
 				.createTemplateWithTextContainer(sourceElement,
 						input, HTML.TAG_SPAN, visualDocument);
-
 		copyGeneralJsfAttributes(sourceElement, input);
 		ComponentUtil.copyDisabled(sourceElement, input);
-
 		copyAttribute(input, sourceElement, JSF.ATTR_VALUE, HTML.ATTR_VALUE);
 		copyAttribute(input, sourceElement, JSF.ATTR_SIZE, HTML.ATTR_SIZE);
 		copyAttribute(input, sourceElement, JSF.ATTR_DIR, HTML.ATTR_DIR);
-
 		VpeElementData elementData = new VpeElementData();
 		if (sourceElement.hasAttribute(JSF.ATTR_VALUE)) {
-
 			Attr attr = sourceElement.getAttributeNode(JSF.ATTR_VALUE);
-			elementData
-					.addNodeData(new AttributeData(attr, input, true));
-
+			elementData.addNodeData(new AttributeData(attr, input, true));
 		} else {
-
-			elementData.addNodeData(new AttributeData(JSF.ATTR_VALUE,
-					input, true));
-
+			elementData.addNodeData(new AttributeData(JSF.ATTR_VALUE, input, true));
 		}
 		creationData.setElementData(elementData);
-
 		return creationData;
 	}
 

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlOutTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlOutTemplate.java	2011-10-27 17:14:56 UTC (rev 36050)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlOutTemplate.java	2011-10-27 17:18:43 UTC (rev 36051)
@@ -13,13 +13,13 @@
 import org.jboss.tools.jsf.vpe.jsf.template.AbstractOutputJsfTemplate;
 import org.jboss.tools.vpe.editor.context.VpePageContext;
 import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
 import org.jboss.tools.vpe.editor.util.VisualDomUtil;
 import org.mozilla.interfaces.nsIDOMDocument;
 import org.mozilla.interfaces.nsIDOMElement;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
-
 /**
  * Class for creating Out content
  *
@@ -27,27 +27,17 @@
  */
 public class JstlOutTemplate extends AbstractOutputJsfTemplate {
 
-    /**
-     * Create html instead c:out component.
-     *
-     * @param pageContext
-     *            Contains the information on edited page.
-     * @param sourceNode
-     *            The current node of the source tree.
-     * @param visualDocument
-     *            The document of the visual tree.
-     * @return The information on the created node of the visual tree.
-     */
+	@Override
     public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
-        // convert to Element
         Element sourceElement = (Element) sourceNode;
-        // create span element
-        nsIDOMElement span = VisualDomUtil.createBorderlessContainer(visualDocument);
-
+        nsIDOMElement span = VisualDomUtil.createBorderlessContainer(visualDocument, HTML.TAG_DIV);
+        span.setAttribute(HTML.ATTR_STYLE, "display: inline"); //$NON-NLS-1$
         VpeCreationData creationData = new VpeCreationData(span);
-
+        /*
+         * https://issues.jboss.org/browse/JBIDE-9417
+         */
+        setEscapeAttributeName("escapeXml"); //$NON-NLS-1$
 		processOutputAttribute(pageContext, visualDocument, sourceElement, span, creationData);
-
         return creationData;
     }
 }
\ No newline at end of file

Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/resources/jstlTests/WebContent/pages/components/out.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/resources/jstlTests/WebContent/pages/components/out.jsp	2011-10-27 17:14:56 UTC (rev 36050)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/resources/jstlTests/WebContent/pages/components/out.jsp	2011-10-27 17:18:43 UTC (rev 36051)
@@ -12,5 +12,16 @@
 	<c:out value="cout_value" id="id1">
 		some out
 	</c:out>
+
+	<c:out value="escaped symbols defult behavior ==[ <,>,&,' ]==" id="id2"/>
+	<c:out value='escaped quotes defult behavior ==[ " ]==' id="id3" />
+	<c:out value="escaped symbols attr set to false ==[ <,>,&,' ]==" escapeXml="false" id="id4" />
+	<c:out value='escaped quotes attr set to false ==[ " ]==' escapeXml="false" id="id5" />
+	
+	<c:out value="escaped symbols defult behavior ==[ <xml><book> some&xml'inside </book></xml> ]==" id="id6" />
+	<c:out value='escaped quotes defult behavior ==[ <xml><book> "some xml inside" </book></xml> ]==' id="id7" />
+	<c:out value="escaped symbols attr set to false ==[ <xml><book> some&xml'inside </book></xml> ]==" escapeXml="false" id="id8" />
+	<c:out value='escaped quotes attr set to false ==[ <xml><book> "some xml inside" </book></xml> ]==' escapeXml="false" id="id9" />
+	
 </body>
 </html>

Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/resources/jstlTests/WebContent/pages/components/out.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/resources/jstlTests/WebContent/pages/components/out.jsp.xml	2011-10-27 17:14:56 UTC (rev 36050)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/resources/jstlTests/WebContent/pages/components/out.jsp.xml	2011-10-27 17:18:43 UTC (rev 36051)
@@ -1,7 +1,96 @@
 <tests>
 	<test id="id1">
-		<SPAN CLASS="vpe-text">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
 			cout_value
-        </SPAN>
+		</DIV>
 	</test>
+
+	<test id="id2">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
+			escaped symbols defult behavior ==[ &lt;,&gt;,&amp;,' ]==
+		</DIV>
+	</test>
+
+	<test id="id3">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
+			escaped quotes defult behavior ==[ " ]==
+		</DIV>
+	</test>
+
+	<test id="id4">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
+			<SPAN CLASS="vpe-text">
+				escaped symbols attr set to false ==[ &lt;,&gt;,&amp;,' ]==
+			</SPAN>
+		</DIV>
+	</test>
+
+	<test id="id5">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
+			<SPAN CLASS="vpe-text">
+				escaped quotes attr set to false ==[ " ]==
+			</SPAN>
+		</DIV>
+	</test>
+
+	<test id="id6">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
+			escaped symbols defult behavior ==[ &lt;xml&gt;&lt;book&gt; some&amp;xml'inside &lt;/book&gt;&lt;/xml&gt; ]==
+		</DIV>
+	</test>
+
+	<test id="id7">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
+			escaped quotes defult behavior ==[ &lt;xml&gt;&lt;book&gt; "some xml inside" &lt;/book&gt;&lt;/xml&gt; ]==
+		</DIV>
+	</test>
+
+	<test id="id8">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
+			<SPAN CLASS="vpe-text">
+				escaped symbols attr set to false ==[
+			</SPAN>
+			<DIV STYLE="-moz-user-modify: read-only; border: 1px solid green;">
+				<DIV CLASS="__any__tag__caption" STYLE="">
+					xml
+				</DIV>
+				<DIV STYLE="-moz-user-modify: read-only; border: 1px solid green;">
+					<DIV CLASS="__any__tag__caption" STYLE="">
+						book
+					</DIV>
+					<SPAN CLASS="vpe-text">
+						some&amp;xml'inside
+					</SPAN>
+				</DIV>
+			</DIV>
+			<SPAN CLASS="vpe-text">
+				]==
+			</SPAN>
+		</DIV>
+	</test>
+
+	<test id="id9">
+		<DIV CLASS="vpe-text" STYLE="display: inline;">
+			<SPAN CLASS="vpe-text">
+				escaped quotes attr set to false ==[
+			</SPAN>
+			<DIV STYLE="-moz-user-modify: read-only; border: 1px solid green;">
+				<DIV CLASS="__any__tag__caption" STYLE="">
+					xml
+				</DIV>
+				<DIV STYLE="-moz-user-modify: read-only; border: 1px solid green;">
+					<DIV CLASS="__any__tag__caption" STYLE="">
+						book
+					</DIV>
+					<SPAN CLASS="vpe-text">
+						"some xml inside"
+					</SPAN>
+				</DIV>
+			</DIV>
+			<SPAN CLASS="vpe-text">
+				]==
+			</SPAN>
+		</DIV>
+	</test>
+
 </tests>
\ No newline at end of file



More information about the jbosstools-commits mailing list