[jbosstools-commits] JBoss Tools SVN: r43266 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages and 5 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Aug 28 11:38:20 EDT 2012


Author: dmaliarevich
Date: 2012-08-28 11:38:20 -0400 (Tue, 28 Aug 2012)
New Revision: 43266

Modified:
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5015/login.xhtml.xml
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516/jbide5516.xhtml.xml
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp.xml
   trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml
   trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
https://issues.jboss.org/browse/JBIDE-3225 - h:commandButton was put into SPAN, type="submit" was added, junits were updated.

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java	2012-08-28 15:23:31 UTC (rev 43265)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java	2012-08-28 15:38:20 UTC (rev 43266)
@@ -13,6 +13,7 @@
 import org.jboss.tools.vpe.editor.context.VpePageContext;
 import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
 import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
 import org.jboss.tools.vpe.editor.util.HTML;
 import org.jboss.tools.vpe.editor.util.VisualDomUtil;
 import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
@@ -36,8 +37,11 @@
 			input.setAttribute(HTML.ATTR_CLASS, sourceElement.getAttribute(JSF.ATTR_STYLE_CLASS));
 		}
 		if (sourceElement.hasAttribute(JSF.ATTR_DISABLED)) {
+			/*
+			 * CommandButton is Disabled
+			 */
 			String disabled = sourceElement.getAttribute(JSF.ATTR_DISABLED);
-			if ("true".equalsIgnoreCase(disabled)) { //$NON-NLS-1$
+			if (Constants.TRUE.equalsIgnoreCase(disabled)) {
 				input.setAttribute(JSF.ATTR_DISABLED, JSF.ATTR_DISABLED);
 			}
 		}
@@ -45,20 +49,30 @@
 			input.setAttribute(JSF.ATTR_DIR, sourceElement.getAttribute(JSF.ATTR_DIR));
 		} 
 		if (sourceElement.hasAttribute(JSF.ATTR_IMAGE)) {
-//		1) attr: +image -> type=image
+			/*
+			 * TYPE is IMAGE
+			 */
 			input.setAttribute(JSF.ATTR_TYPE,JSF.ATTR_IMAGE);
 			input.setAttribute(JSF.ATTR_SRC, 
 					VpeStyleUtil.addFullPathToImgSrc(
 							sourceElement.getAttribute(JSF.ATTR_IMAGE), pageContext, true));
-		} else if (sourceElement.hasAttribute(JSF.ATTR_TYPE)) { 
-//		2) attr: +type -> type=type
-			input.setAttribute(JSF.ATTR_TYPE, sourceElement.getAttribute(JSF.ATTR_TYPE));
+		} else if (sourceElement.hasAttribute(JSF.ATTR_TYPE)) {
+			/*
+			 * TYPE attribute presents
+			 */
+			String type = sourceElement.getAttribute(JSF.ATTR_TYPE);
+			if (Constants.EMPTY.equalsIgnoreCase(type)) {
+				type = HTML.VALUE_TYPE_SUBMIT;
+			}
+			input.setAttribute(JSF.ATTR_TYPE, type);
 			if (sourceElement.hasAttribute(JSF.ATTR_VALUE)) {
 				input.setAttribute(JSF.ATTR_VALUE, sourceElement.getAttribute(JSF.ATTR_VALUE));
 			}
 		} else {
-//		3) attr: -type -> type=button
-			input.setAttribute(JSF.ATTR_TYPE, JSF.VALUE_BUTTON);
+			/*
+			 * No TYPE attribute is specified
+			 */
+			input.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_SUBMIT);
 			if (sourceElement.hasAttribute(JSF.ATTR_VALUE)) {
 				input.setAttribute(JSF.ATTR_VALUE, sourceElement.getAttribute(JSF.ATTR_VALUE));
 			}
@@ -69,7 +83,7 @@
 		 * Components should render usual text inside
 		 */
 		VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
-				sourceElement, input, HTML.TAG_DIV, visualDocument);
+				sourceElement, input, HTML.TAG_SPAN, visualDocument);
 		
 		return creationData;
 	}

Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml	2012-08-28 15:23:31 UTC (rev 43265)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml	2012-08-28 15:38:20 UTC (rev 43266)
@@ -4,44 +4,44 @@
 			<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
 <!-- h:inputHidden id="currentPage" replace, because if on page two fields, two elements with equal id has been used, but should be used only one -->
 <TABLE BORDER="0"
-					STYLE="margin-right: auto; margin-left: auto; -moz-user-modify: read-write;">
-					<TBODY>
-						<TR>
-							<TD>
-								<DIV CLASS="vpe-text">
-									<DIV CLASS="vpe-text">
-									</DIV>
-									<INPUT TYPE="submit" VALUE="&lt;&lt;" />
+	STYLE="margin-right: auto; margin-left: auto; -moz-user-modify: read-write;">
+	<TBODY>
+		<TR>
+			<TD>
+				<SPAN CLASS="vpe-text">
+					<SPAN CLASS="vpe-text">
+					</SPAN>
+					<INPUT TYPE="submit" VALUE="&lt;&lt;" />
 
-								</DIV>
-							</TD>
-							<TD>
-								<DIV CLASS="vpe-text">
-									<DIV CLASS="vpe-text">
-									</DIV>
-									<INPUT TYPE="submit" VALUE="&lt;" />
+				</SPAN>
+			</TD>
+			<TD>
+				<SPAN CLASS="vpe-text">
+					<SPAN CLASS="vpe-text">
+					</SPAN>
+					<INPUT TYPE="submit" VALUE="&lt;" />
 
-								</DIV>
-							</TD>
-							<TD>
-								<DIV CLASS="vpe-text">
-									<DIV CLASS="vpe-text">
-									</DIV>
-									<INPUT TYPE="submit" VALUE="&gt;" />
+				</SPAN>
+			</TD>
+			<TD>
+				<SPAN CLASS="vpe-text">
+					<SPAN CLASS="vpe-text">
+					</SPAN>
+					<INPUT TYPE="submit" VALUE="&gt;" />
 
-								</DIV>
-							</TD>
-							<TD>
-								<DIV CLASS="vpe-text">
-									<DIV CLASS="vpe-text">
-									</DIV>
-									<INPUT TYPE="submit" VALUE="&gt;&gt;" />
+				</SPAN>
+			</TD>
+			<TD>
+				<SPAN CLASS="vpe-text">
+					<SPAN CLASS="vpe-text">
+					</SPAN>
+					<INPUT TYPE="submit" VALUE="&gt;&gt;" />
 
-								</DIV>
-							</TD>
-						</TR>
-					</TBODY>
-				</TABLE>
+				</SPAN>
+			</TD>
+		</TR>
+	</TBODY>
+</TABLE>
 			</DIV>
 			<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
 				<SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">

Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5015/login.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5015/login.xhtml.xml	2012-08-28 15:23:31 UTC (rev 43265)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5015/login.xhtml.xml	2012-08-28 15:38:20 UTC (rev 43266)
@@ -37,7 +37,7 @@
 
 </P>
 <P STYLE="-moz-user-modify: read-only;">
-<INPUT TYPE="button" VALUE="LOgin" STYLE="-moz-user-modify: read-only;"/>
+<INPUT TYPE="submit" VALUE="LOgin"/>
 
 </P>
 </DIV>

Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516/jbide5516.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516/jbide5516.xhtml.xml	2012-08-28 15:23:31 UTC (rev 43265)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516/jbide5516.xhtml.xml	2012-08-28 15:38:20 UTC (rev 43266)
@@ -1,41 +1,43 @@
 <tests>
 	<test id="jbide5516">
 		<DIV ID="jbide5516">
-			<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
-				<TABLE BORDER="0" STYLE="margin-right: auto; margin-left: auto;">
+			<DIV VPE:INCLUDE-ELEMENT="yes">
+
+				<TABLE BORDER="0"
+					STYLE="margin-right: auto; margin-left: auto;">
 					<TBODY>
 						<TR>
 							<TD>
-								<DIV CLASS="vpe-text">
-									<DIV CLASS="vpe-text">
-									</DIV>
+								<SPAN CLASS="vpe-text">
+									<SPAN CLASS="vpe-text">
+									</SPAN>
 									<INPUT TYPE="submit" VALUE="1" />
 
-								</DIV>
+								</SPAN>
 							</TD>
 							<TD>
-								<DIV CLASS="vpe-text">
-									<DIV CLASS="vpe-text">
-									</DIV>
+								<SPAN CLASS="vpe-text">
+									<SPAN CLASS="vpe-text">
+									</SPAN>
 									<INPUT TYPE="submit" VALUE="2" />
 
-								</DIV>
+								</SPAN>
 							</TD>
 							<TD>
-								<DIV CLASS="vpe-text">
-									<DIV CLASS="vpe-text">
-									</DIV>
+								<SPAN CLASS="vpe-text">
+									<SPAN CLASS="vpe-text">
+									</SPAN>
 									<INPUT TYPE="submit" VALUE="3" />
 
-								</DIV>
+								</SPAN>
 							</TD>
 							<TD>
-								<DIV CLASS="vpe-text">
-									<DIV CLASS="vpe-text">
-									</DIV>
+								<SPAN CLASS="vpe-text">
+									<SPAN CLASS="vpe-text">
+									</SPAN>
 									<INPUT TYPE="submit" VALUE="4" />
 
-								</DIV>
+								</SPAN>
 							</TD>
 						</TR>
 					</TBODY>

Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp.xml	2012-08-28 15:23:31 UTC (rev 43265)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp.xml	2012-08-28 15:38:20 UTC (rev 43266)
@@ -1,106 +1,114 @@
 <tests>
 	<test id="div1">
 		<DIV ID="div1" STYLE="-moz-user-modify: read-write;">
-			<INPUT TYPE="button" VALUE="commandButton1" />
+			<INPUT TYPE="submit" VALUE="commandButton1" />
 			<INPUT TYPE="button" VALUE="commandButton2" />
 			<INPUT TYPE="reset" VALUE="commandButton3" />
 			<INPUT TYPE="submit" VALUE="commandButton4" />
 			<INPUT TYPE="image" SRC="/.*ve/unresolved_image.gif/" />
-			<INPUT TYPE="" VALUE="commandButton6" />
+			<INPUT TYPE="submit" VALUE="commandButton6" />
 		</DIV>
 	</test>
 
 	<test id="div2">
+
 		<DIV ID="div2" STYLE="-moz-user-modify: read-write;">
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
-				</DIV>
-				<INPUT TYPE="button" VALUE="cb1" />
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
-				</DIV>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
+				</SPAN>
+				<INPUT TYPE="submit" VALUE="cb1" />
+
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
+				</SPAN>
 				<INPUT TYPE="button" VALUE="cb2" />
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
-				</DIV>
+
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
+				</SPAN>
 				<INPUT TYPE="reset" VALUE="cb3" />
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
-				</DIV>
+
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
+				</SPAN>
 				<INPUT TYPE="submit" VALUE="cb4" />
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
-				</DIV>
+
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
+				</SPAN>
 				<INPUT TYPE="image" SRC="/.*ve/unresolved_image.gif/" />
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
-				</DIV>
-				<INPUT TYPE="" VALUE="cb6" />
-			</DIV>
+
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
+				</SPAN>
+				<INPUT TYPE="submit" VALUE="cb6" />
+
+			</SPAN>
 		</DIV>
 	</test>
 
 	<test id="div3">
+
 		<DIV ID="div3" STYLE="-moz-user-modify: read-write;">
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
 					<SPAN CLASS="vpe-text">
 						with some text
 					</SPAN>
-				</DIV>
-				<INPUT TYPE="button" VALUE="cb1" />
+				</SPAN>
+				<INPUT TYPE="submit" VALUE="cb1" />
 
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
 					<SPAN CLASS="vpe-text">
 						with some text
 					</SPAN>
-				</DIV>
+				</SPAN>
 				<INPUT TYPE="button" VALUE="cb2" />
 
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
 					<SPAN CLASS="vpe-text">
 						with some text
 					</SPAN>
-				</DIV>
+				</SPAN>
 				<INPUT TYPE="reset" VALUE="cb3" />
 
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
 					<SPAN CLASS="vpe-text">
 						with some text
 					</SPAN>
-				</DIV>
+				</SPAN>
 				<INPUT TYPE="submit" VALUE="cb4" />
 
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
 					<SPAN CLASS="vpe-text">
 						with some text
 					</SPAN>
-				</DIV>
+				</SPAN>
 				<INPUT TYPE="image" SRC="/.*ve/unresolved_image.gif/" />
 
-			</DIV>
-			<DIV CLASS="vpe-text">
-				<DIV CLASS="vpe-text">
+			</SPAN>
+			<SPAN CLASS="vpe-text">
+				<SPAN CLASS="vpe-text">
 					<SPAN CLASS="vpe-text">
 						with some text
 					</SPAN>
-				</DIV>
-				<INPUT TYPE="" VALUE="cb6" />
+				</SPAN>
+				<INPUT TYPE="submit" VALUE="cb6" />
 
-			</DIV>
+			</SPAN>
 		</DIV>
 	</test>
 </tests>
\ No newline at end of file

Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml	2012-08-28 15:23:31 UTC (rev 43265)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml	2012-08-28 15:38:20 UTC (rev 43266)
@@ -57,7 +57,7 @@
 											<INPUT CLASS="barsearch" />
 										</TD>
 										<TD CLASS="dr-toolbar-int rich-toolbar-item" STYLE="">
-											<INPUT TYPE="button" CLASS="barsearchbutton" VALUE="Search"/>
+											<INPUT TYPE="submit" CLASS="barsearchbutton" VALUE="Search"/>
 										</TD>
 									</TR>
 								</TBODY>
@@ -266,7 +266,7 @@
 													</TD>
 													<TD CLASS="dr-toolbar-int rich-toolbar-item"
 														STYLE="color: PaleVioletRed; font-size: medium; font-style: italic; background-color: FloralWhite; font-family: Arial TUR; font-weight: bolder;">
-														<INPUT TYPE="button" CLASS="barsearchbutton" VALUE="Search"/>
+														<INPUT TYPE="submit" CLASS="barsearchbutton" VALUE="Search"/>
 
 													</TD>
 												</TR>

Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java	2012-08-28 15:23:31 UTC (rev 43265)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java	2012-08-28 15:38:20 UTC (rev 43266)
@@ -141,6 +141,7 @@
 	public static final String VALUE_TYPE_RADIO = "radio"; //$NON-NLS-1$
 	public static final String VALUE_TYPE_HIDDEN = "hidden"; //$NON-NLS-1$
 	public static final String VALUE_TYPE_BUTTON= "button"; //$NON-NLS-1$
+	public static final String VALUE_TYPE_SUBMIT= "submit"; //$NON-NLS-1$
 	public static final String VALUE_CLEAR_BOTH = "both"; //$NON-NLS-1$
 	public static final String VALUE_INLINE = "inline"; //$NON-NLS-1$
 	public static final String VALUE_BLOCK = "block"; //$NON-NLS-1$



More information about the jbosstools-commits mailing list