### Eclipse Workspace Patch 1.0
#P org.jboss.tools.jsf.vpe.jsf
Index: src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java
===================================================================
--- src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java	(revision 0)
+++ src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java	(revision 0)
@@ -0,0 +1,92 @@
+package org.jboss.tools.jsf.vpe.jsf.template;
+
+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.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class JsfCommandButton extends VpeAbstractTemplate {
+
+	@Override
+	public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+			nsIDOMDocument visualDocument) {
+		Element sourceElement = (Element) sourceNode;
+		nsIDOMElement input = visualDocument.createElement(HTML.TAG_INPUT);
+		
+		if (sourceElement.hasAttribute(JSF.ATTR_STYLE)) {
+			input.setAttribute(JSF.ATTR_STYLE, sourceElement.getAttribute(JSF.ATTR_STYLE));
+		}
+		if (sourceElement.hasAttribute(JSF.ATTR_STYLE_CLASS)) {
+			input.setAttribute(HTML.ATTR_CLASS, sourceElement.getAttribute(JSF.ATTR_STYLE_CLASS));
+		}
+		if (sourceElement.hasAttribute(JSF.ATTR_DISABLED)) {
+			String disabled = sourceElement.getAttribute(JSF.ATTR_DISABLED);
+			if ("true".equalsIgnoreCase(disabled)) { //$NON-NLS-1$
+				input.setAttribute(JSF.ATTR_DISABLED, JSF.ATTR_DISABLED);
+			}
+		}
+		if (sourceElement.hasAttribute(JSF.ATTR_DIR)) {
+			input.setAttribute(JSF.ATTR_DIR, sourceElement.getAttribute(JSF.ATTR_DIR));
+		} 
+		if (sourceElement.hasAttribute(JSF.ATTR_IMAGE)) {
+//		1) attr: +image -> type=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));
+			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);
+			if (sourceElement.hasAttribute(JSF.ATTR_VALUE)) {
+				input.setAttribute(JSF.ATTR_VALUE, sourceElement.getAttribute(JSF.ATTR_VALUE));
+			}
+		}
+		
+//		1) disabled='true' + no image + no type
+//		<input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
+//				class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}"
+//				disabled='disabled' />
+
+//		2) disabled='true' + no image + TYPE YES
+//		<input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
+//				class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}"
+//				disabled='disabled' />
+		
+//		3) disabled='true' + image YES
+//		<input type="image" src="{src(@image)}" class="{@styleClass}"
+//				style="{@style}" title="{tagstring()}" disabled='disabled' />
+		
+//		4) not diasbled + no image 
+//		<input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
+//		class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}" />
+		
+//		5) not diasbled + no type
+//		<input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
+//						class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}" />
+		
+//		6) not dis + with image
+//		<input type="image" src="{src(@image)}" class="{@styleClass}"
+//				style="{@style}" title="{tagstring()}" />
+		/*
+		 * https://issues.jboss.org/browse/JBIDE-3225
+		 * Components should render usual text inside
+		 */
+		VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+				sourceElement, input, HTML.TAG_DIV, visualDocument);
+		
+		return creationData;
+	}
+
+}
Index: src/org/jboss/tools/jsf/vpe/jsf/template/JSF.java
===================================================================
--- src/org/jboss/tools/jsf/vpe/jsf/template/JSF.java	(revision 43089)
+++ src/org/jboss/tools/jsf/vpe/jsf/template/JSF.java	(working copy)
@@ -34,7 +34,9 @@
 	public static final String ATTR_FOR = "for"; //$NON-NLS-1$
 
 	public static final String ATTR_ID = "id";//$NON-NLS-1$
-
+	
+	public static final String ATTR_IMAGE = "image"; //$NON-NLS-1$
+	
 	public static final String ATTR_ITEM_LABEL = "itemLabel"; //$NON-NLS-1$
 	
 	public static final String ATTR_ITEM_VALUE = "itemValue"; //$NON-NLS-1$
@@ -60,6 +62,8 @@
 	public static final String ATTR_LAYOUT = "layout"; //$NON-NLS-1$
 
 	public static final String ATTR_TITLE = "title"; //$NON-NLS-1$
+	
+	public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
 
 	public static final String ATTR_LANG = "lang"; //$NON-NLS-1$
 	
@@ -68,4 +72,9 @@
 	public static final String ATTR_DEFAULT = "default"; //$NON-NLS-1$
 	
 	public static final String CUSTOM_COMPONENT_ATTR_PREFIX="cc.attrs."; //$NON-NLS-1$
+	
+	public static final String ATTR_SRC = "src"; //$NON-NLS-1$
+	
+	public static final String VALUE_BUTTON = "button"; //$NON-NLS-1$
+	
 }
Index: templates/vpe-templates-jsf.xml
===================================================================
--- templates/vpe-templates-jsf.xml	(revision 43089)
+++ templates/vpe-templates-jsf.xml	(working copy)
@@ -211,105 +211,18 @@
 	</vpe:tag>
 
 	<vpe:tag name="h:commandButton" case-sensitive="yes">
-		<!--
-			This is a very big if-statement. Its goal is to add support of
-			'disabled property' DO NOT FORGET TO EDIT 'ELSE' PART IN FUTURE
-			MODIFICATIONS
-		-->
-		<vpe:if test="(@disabled='true')">
-			<vpe:if test="not(attrpresent('image'))">
-				<vpe:if test="(@type='')">
-					<vpe:template children="no" modify="no">
-						<input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
-							class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}"
-							disabled='disabled' />
-						<vpe:resize>
+		<vpe:template children="yes" modify="no" 
+			class="org.jboss.tools.jsf.vpe.jsf.template.JsfCommandButton">
+			<vpe:resize>
 							<vpe:width width-attr="style.width" />
 							<vpe:height height-attr="style.height" />
-						</vpe:resize>
-						<vpe:dnd>
-							<vpe:drag start-enable="yes" />
-						</vpe:dnd>
-						<vpe:textFormatting use-default-formats="yes">
-						</vpe:textFormatting>
-					</vpe:template>
-				</vpe:if>
-				<vpe:if test="not(@type='')">
-					<vpe:template children="no" modify="no">
-						<input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
-							class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}"
-							disabled='disabled' />
-						<vpe:resize>
-							<vpe:width width-attr="style.width" />
-							<vpe:height height-attr="style.height" />
-						</vpe:resize>
-						<vpe:dnd>
-							<vpe:drag start-enable="yes" />
-						</vpe:dnd>
-						<vpe:textFormatting use-default-formats="yes">
-						</vpe:textFormatting>
-					</vpe:template>
-				</vpe:if>
-			</vpe:if>
-			<vpe:if test="attrpresent('image')">
-				<vpe:template children="no" modify="no">
-					<input type="image" src="{src(@image)}" class="{@styleClass}"
-						style="{@style}" title="{tagstring()}" disabled='disabled' />
-					<vpe:resize>
-						<vpe:width width-attr="style.width" />
-						<vpe:height height-attr="style.height" />
-					</vpe:resize>
-					<vpe:textFormatting use-default-formats="yes">
-					</vpe:textFormatting>
-				</vpe:template>
-			</vpe:if>
-		</vpe:if>
-		<!--else-->
-		<vpe:if test="not(attrpresent('image'))">
-			<vpe:if test="(@type='')">
-				<vpe:template children="no" modify="no">
-					<input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
-						class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}" />
-					<vpe:resize>
-						<vpe:width width-attr="style.width" />
-						<vpe:height height-attr="style.height" />
-					</vpe:resize>
-					<vpe:dnd>
+			</vpe:resize>
+			<vpe:dnd>
 						<vpe:drag start-enable="yes" />
-					</vpe:dnd>
-					<vpe:textFormatting use-default-formats="yes">
-					</vpe:textFormatting>
-				</vpe:template>
-			</vpe:if>
-			<vpe:if test="not(@type='')">
-				<vpe:template children="no" modify="no">
-					<input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
-						class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}" />
-					<vpe:resize>
-						<vpe:width width-attr="style.width" />
-						<vpe:height height-attr="style.height" />
-					</vpe:resize>
-					<vpe:dnd>
-						<vpe:drag start-enable="yes" />
-					</vpe:dnd>
-					<vpe:textFormatting use-default-formats="yes">
-					</vpe:textFormatting>
-				</vpe:template>
-			</vpe:if>
-		</vpe:if>
-		<vpe:if test="attrpresent('image')">
-			<vpe:template children="no" modify="no">
-				<input type="image" src="{src(@image)}" class="{@styleClass}"
-					style="{@style}" title="{tagstring()}" />
-				<vpe:resize>
-					<vpe:width width-attr="style.width" />
-					<vpe:height height-attr="style.height" />
-				</vpe:resize>
-				<vpe:textFormatting use-default-formats="yes">
-				</vpe:textFormatting>
-			</vpe:template>
-		</vpe:if>
-		<!--end-of-else-->
+			</vpe:dnd>
+			<vpe:textFormatting use-default-formats="yes">
+			</vpe:textFormatting>
+		</vpe:template>
 	</vpe:tag>
 
 	<!-- Проблема с вложенным параметром (31 of 4) -->
