[jbosstools-commits] JBoss Tools SVN: r23907 - in trunk/vpe: plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util and 2 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Wed Aug 4 03:48:18 EDT 2010
Author: dmaliarevich
Date: 2010-08-04 03:48:17 -0400 (Wed, 04 Aug 2010)
New Revision: 23907
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringTextAreaTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/hidden.jsp
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/input.jsp
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/label.jsp
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/textarea.jsp
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/textarea.jsp.xml
Log:
https://jira.jboss.org/browse/JBIDE-6711 , some templates and tests were updated.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringTextAreaTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringTextAreaTemplate.java 2010-08-04 07:11:10 UTC (rev 23906)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringTextAreaTemplate.java 2010-08-04 07:48:17 UTC (rev 23907)
@@ -52,26 +52,16 @@
(sourceElement.hasAttribute(Spring.ATTR_CSS_STYLE)
? sourceElement.getAttribute(Spring.ATTR_CSS_STYLE)
: Constants.EMPTY));
-
/*
- * Add text children to the text area
+ * Add value of the 'path' attribute to the textarea.
+ * No children are allowed for the form:textarea.
*/
- final NodeList childNodes = sourceNode.getChildNodes();
- final int childNodesLength = childNodes.getLength();
- for (int i = 0; i < childNodesLength; i++) {
- final Node child = childNodes.item(i);
- if (child.getNodeType() == Node.TEXT_NODE) {
- final nsIDOMNode text = visualDocument.createTextNode(child.getNodeValue());
- textarea.appendChild(text);
- }
+ if (sourceElement.hasAttribute(Spring.ATTR_PATH)) {
+ textarea.appendChild(visualDocument.createTextNode(sourceElement
+ .getAttribute(Spring.ATTR_PATH)));
}
final VpeCreationData creationData = new VpeCreationData(textarea);
-
- final VpeElementData textElementsData = new VpeElementData();
- textElementsData.addNodeData(new NodeData(sourceNode.getLastChild(), textarea));
- creationData.setElementData(textElementsData);
-
return creationData;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java 2010-08-04 07:11:10 UTC (rev 23906)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java 2010-08-04 07:48:17 UTC (rev 23907)
@@ -22,6 +22,7 @@
public static final String ATTR_ID = "id"; //$NON-NLS-1$
public static final String ATTR_ITEMS = "items"; //$NON-NLS-1$
public static final String ATTR_ITEM_LABEL = "itemLabel"; //$NON-NLS-1$
+ public static final String ATTR_PATH = "path"; //$NON-NLS-1$
public static final String ATTR_MULTIPLE = "multiple"; //$NON-NLS-1$
public static final String VALUE_TRUE = "true"; //$NON-NLS-1$
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-08-04 07:11:10 UTC (rev 23906)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-08-04 07:48:17 UTC (rev 23907)
@@ -127,7 +127,7 @@
<vpe:if test="@disabled='true'">
<vpe:template children="no" modify="no">
<input type="text" id="{@id}" class="{@cssClass}" style="{@cssStyle}"
- size="{@size}" dir="{@dir}" value="{@value}"
+ size="{@size}" dir="{@dir}" value="{@path}"
disabled="disabled" />
<vpe:resize>
<vpe:width width-attr="cssStyle.width" />
@@ -142,7 +142,7 @@
</vpe:if>
<vpe:template children="no" modify="no">
<input type="text" id="{@id}" class="{@cssClass}" style="{@cssStyle}"
- size="{@size}" dir="{@dir}" value="{@value}"/>
+ size="{@size}" dir="{@dir}" value="{@path}"/>
<vpe:resize>
<vpe:width width-attr="cssStyle.width" />
<vpe:height height-attr="cssStyle.height" />
@@ -393,7 +393,7 @@
</vpe:tag>
<vpe:tag name="form:textarea" case-sensitive="yes">
- <vpe:template children="yes" modify="yes"
+ <vpe:template children="no" modify="no"
class="org.jboss.tools.vpe.spring.template.SpringTextAreaTemplate">
<vpe:resize>
<vpe:width width-attr="cssStyle.width" />
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/hidden.jsp
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/hidden.jsp 2010-08-04 07:11:10 UTC (rev 23906)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/hidden.jsp 2010-08-04 07:48:17 UTC (rev 23907)
@@ -1,6 +1,6 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<body>
-<form:hidden id="hidden" value="hidden"/>
+<form:hidden id="hidden" path="hidden"/>
</body>
</html>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/input.jsp
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/input.jsp 2010-08-04 07:11:10 UTC (rev 23906)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/input.jsp 2010-08-04 07:48:17 UTC (rev 23907)
@@ -1,7 +1,7 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<body>
-<form:input id="input1" value="input"/>
-<form:input id="input2" value="input" disabled="true"/>
+<form:input id="input1" path="input"/>
+<form:input id="input2" path="input" disabled="true"/>
</body>
</html>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/label.jsp
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/label.jsp 2010-08-04 07:11:10 UTC (rev 23906)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/label.jsp 2010-08-04 07:48:17 UTC (rev 23907)
@@ -16,10 +16,10 @@
</style>
</head>
<body>
-<form:label id="label1" cssClass="green" cssStyle="font-weight: bold;">
+<form:label id="label1" cssClass="green" cssStyle="font-weight: bold;" path="label1">
Label 1
</form:label>
-<form:label id="label2" for="text" cssClass="blue" cssStyle="font-style: italic;">
+<form:label id="label2" for="text" cssClass="blue" cssStyle="font-style: italic;" path="label2">
Label 2
</form:label>
<input type="text" id="text" />
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/textarea.jsp
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/textarea.jsp 2010-08-04 07:11:10 UTC (rev 23906)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/textarea.jsp 2010-08-04 07:48:17 UTC (rev 23907)
@@ -15,9 +15,7 @@
</style>
</head>
<body>
-<form:textarea id="textArea1" cssClass="green" cssStyle="font-weight: bold;">
-textArea 1
-</form:textarea>
-<form:textarea id="textArea2" value="textArea 2" cssClass="blue" cssStyle="font-style: italic;"/>
+<form:textarea id="textArea1" cssClass="green" cssStyle="font-weight: bold;" path="textarea1" />
+<form:textarea id="textArea2" cssClass="blue" cssStyle="font-style: italic;" path="textarea2"/>
</body>
</html>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/textarea.jsp.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/textarea.jsp.xml 2010-08-04 07:11:10 UTC (rev 23906)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/textarea.jsp.xml 2010-08-04 07:48:17 UTC (rev 23907)
@@ -1,16 +1,12 @@
<tests>
<test id="textArea1">
<TEXTAREA ID="textArea1" CSSCLASS="green" CSSSTYLE="font-weight: bold;"
- CLASS="green" STYLE="font-weight: bold;">
- textArea 1
- <SPAN CLASS="vpe-text">
- textArea 1
- </SPAN>
+ PATH="textarea1" CLASS="green" STYLE="font-weight: bold;">
</TEXTAREA>
</test>
<test id="textArea2">
- <TEXTAREA ID="textArea2" VALUE="textArea 2" CSSCLASS="blue"
- CSSSTYLE="font-style: italic;" CLASS="blue" STYLE="font-style: italic;">
+ <TEXTAREA ID="textArea2" CSSCLASS="blue" CSSSTYLE="font-style: italic;"
+ PATH="textarea2" CLASS="blue" STYLE="font-style: italic;">
</TEXTAREA>
</test>
More information about the jbosstools-commits
mailing list