Author: yradtsevich
Date: 2009-12-30 04:16:44 -0500 (Wed, 30 Dec 2009)
New Revision: 19611
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstarctLinkJsfTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfLinkTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/ajax.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/button.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/button.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/event.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/link.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/link.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/metadata.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/validateBean.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/validateRequired.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/viewParam.xhtml
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandLinkTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2820
Templates and JUnit tests for the following tags have been added:
h:button
h:link
f:ajax
f:event
f:validateBean
f:validateRequired
f:viewParam
f:metadata
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstarctLinkJsfTemplate.java
(from rev 19552,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandLinkTemplate.java)
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstarctLinkJsfTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstarctLinkJsfTemplate.java 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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.template;
+
+import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+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;
+
+/**
+ * Abstract template for h:link and h:commandLink
+ *
+ * @author Dzmitry Sakovich (dsakovich(a)exadel.com)
+ *
+ */
+public abstract class AbstarctLinkJsfTemplate extends AbstractOutputJsfTemplate {
+
+ private static final String H_FORM = "h:form"; //$NON-NLS-1$
+ private static final String A4J_FORM = "a4j:form"; //$NON-NLS-1$
+ private static final String OUTSIDE_FORM_TEXT = ": This link is disabled as it
is not nested within a JSF form."; //$NON-NLS-1$
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+
+ Element element = (Element) sourceNode;
+ nsIDOMElement parentElement;
+
+ boolean disabled = ComponentUtil.string2boolean(ComponentUtil
+ .getAttribute(element, HTML.ATTR_DISABLED));
+ String value = ComponentUtil.getAttribute(element, HTML.ATTR_VALUE);
+ boolean hasParentForm = hasParentForm(pageContext, element);
+
+ if (!hasParentForm) {
+ parentElement = VisualDomUtil.createBorderlessContainer(visualDocument);
+ } else if (disabled) {
+ parentElement = VisualDomUtil.createBorderlessContainer(visualDocument);
+ } else {
+ parentElement = visualDocument.createElement(HTML.TAG_A);
+ }
+
+ // copy attributes
+ copyOutputJsfAttributes(parentElement, element);
+
+ VpeCreationData creationData;
+ if (!hasParentForm) {
+ nsIDOMElement topSpan = VisualDomUtil.createBorderlessContainer(visualDocument);
+ nsIDOMElement noteSpan = VisualDomUtil.createBorderlessContainer(visualDocument);
+ noteSpan.appendChild(visualDocument.createTextNode(OUTSIDE_FORM_TEXT));
+ topSpan.appendChild(parentElement);
+ topSpan.appendChild(noteSpan);
+ creationData = new VpeCreationData(topSpan);
+ } else {
+ creationData = new VpeCreationData(parentElement);
+ }
+
+ VpeChildrenInfo linkInfo = new VpeChildrenInfo(parentElement);
+ creationData.addChildrenInfo(linkInfo);
+
+ for (Node child : ComponentUtil.getChildren(element)) {
+ linkInfo.addSourceChild(child);
+ }
+ if (ComponentUtil.isNotBlank(value)) {
+ parentElement.appendChild(visualDocument.createTextNode(value));
+ }
+ return creationData;
+
+ }
+
+ private boolean hasParentForm(VpePageContext pageContext, Element sourceElement) {
+ Node parent = sourceElement.getParentNode();
+ while (parent != null && parent instanceof Element &&
parent.getNodeName() != null) {
+ String parentTemplateName =
VpeTemplateManager.getInstance().getTemplateName(pageContext, parent);
+ if (H_FORM.equals(parentTemplateName)
+ || A4J_FORM.equals(parentTemplateName)) {
+ return true;
+ }
+ parent = parent.getParentNode();
+ }
+ return false;
+ }
+
+ @Override
+ public boolean recreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+
+}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandLinkTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandLinkTemplate.java 2009-12-29
22:10:15 UTC (rev 19610)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandLinkTemplate.java 2009-12-30
09:16:44 UTC (rev 19611)
@@ -1,104 +1,19 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 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.template;
-
-import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
-import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
-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;
-
-/**
- * Template for jsf tag commandLink
- *
- * @author Dzmitry Sakovich (dsakovich(a)exadel.com)
- *
- */
-public class JsfCommandLinkTemplate extends AbstractOutputJsfTemplate {
-
- private static final String H_FORM = "h:form"; //$NON-NLS-1$
- private static final String A4J_FORM = "a4j:form"; //$NON-NLS-1$
- private static final String OUTSIDE_FORM_TEXT = ": This link is disabled as it
is not nested within a JSF form."; //$NON-NLS-1$
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
-
- Element element = (Element) sourceNode;
- nsIDOMElement parentElement;
-
- boolean disabled = ComponentUtil.string2boolean(ComponentUtil
- .getAttribute(element, HTML.ATTR_DISABLED));
- String value = ComponentUtil.getAttribute(element, HTML.ATTR_VALUE);
- boolean hasParentForm = hasParentForm(pageContext, element);
-
- if (!hasParentForm) {
- parentElement = VisualDomUtil.createBorderlessContainer(visualDocument);
- } else if (disabled) {
- parentElement = VisualDomUtil.createBorderlessContainer(visualDocument);
- } else {
- parentElement = visualDocument.createElement(HTML.TAG_A);
- }
-
- // copy attributes
- copyOutputJsfAttributes(parentElement, element);
-
- VpeCreationData creationData;
- if (!hasParentForm) {
- nsIDOMElement topSpan = VisualDomUtil.createBorderlessContainer(visualDocument);
- nsIDOMElement noteSpan = VisualDomUtil.createBorderlessContainer(visualDocument);
- noteSpan.appendChild(visualDocument.createTextNode(OUTSIDE_FORM_TEXT));
- topSpan.appendChild(parentElement);
- topSpan.appendChild(noteSpan);
- creationData = new VpeCreationData(topSpan);
- } else {
- creationData = new VpeCreationData(parentElement);
- }
-
- VpeChildrenInfo linkInfo = new VpeChildrenInfo(parentElement);
- creationData.addChildrenInfo(linkInfo);
-
- for (Node child : ComponentUtil.getChildren(element)) {
- linkInfo.addSourceChild(child);
- }
- if (ComponentUtil.isNotBlank(value)) {
- parentElement.appendChild(visualDocument.createTextNode(value));
- }
- return creationData;
-
- }
-
- private boolean hasParentForm(VpePageContext pageContext, Element sourceElement) {
- Node parent = sourceElement.getParentNode();
- while (parent != null && parent instanceof Element &&
parent.getNodeName() != null) {
- String parentTemplateName =
VpeTemplateManager.getInstance().getTemplateName(pageContext, parent);
- if (H_FORM.equals(parentTemplateName)
- || A4J_FORM.equals(parentTemplateName)) {
- return true;
- }
- parent = parent.getParentNode();
- }
- return false;
- }
-
- @Override
- public boolean recreateAtAttrChange(VpePageContext pageContext,
- Element sourceElement, nsIDOMDocument visualDocument,
- nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
- }
-
-}
+/*******************************************************************************
+ * 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.template;
+
+/**
+ * Template for h:commandLink
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class JsfCommandLinkTemplate extends AbstarctLinkJsfTemplate {
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfLinkTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfLinkTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfLinkTemplate.java 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * 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.template;
+
+/**
+ * Template for h:link
+ *
+ * @author yradtsevich
+ */
+public class JsfLinkTemplate extends AbstarctLinkJsfTemplate {
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2009-12-29
22:10:15 UTC (rev 19610)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -832,6 +832,32 @@
<vpe:template children="no" modify="no" />
</vpe:tag>
+ <!-- JSF 2.0 Core Tags -->
+ <vpe:tag name="f:ajax" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="f:event" case-sensitive="yes">
+ <vpe:template children="yes" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="f:validateBean" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="f:validateRequired" case-sensitive="yes">
+ <vpe:template children="yes" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="f:viewParam" case-sensitive="yes">
+ <vpe:template children="yes" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="f:metadata" case-sensitive="yes">
+ <vpe:template children="yes" modify="no" />
+ </vpe:tag>
+ <!-- End of JSF 2.0 Core Tags -->
+
<vpe:tag name="h:message">
<vpe:template children="no" modify="no">
<ul class="{@styleClass}" style="{@style}">
@@ -860,7 +886,7 @@
</vpe:template>
</vpe:tag>
- <!-- JSF 2.0 Tags -->
+ <!-- JSF 2.0 HTML Tags -->
<vpe:tag name="h:body" case-sensitive="yes">
<!-- The tag cannot have any attribute. -->
<!-- Checks for min tld version has been comented,
@@ -925,18 +951,155 @@
</vpe:template>
<!-- </vpe:if> -->
</vpe:tag>
- <!-- End of JSF 2.0 Tags -->
+ <vpe:tag name="h:button" 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: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: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:tag>
+
+ <vpe:tag name="h:link" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.jsf.template.JsfLinkTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes">
+ <vpe:container-child tag-name="outputText" />
+ </vpe:drop>
+ </vpe:dnd>
+ <vpe:textFormatting>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ </vpe:textFormatting>
+ <vpe:pseudoContent />
+ </vpe:template>
+ </vpe:tag>
+ <!-- End of JSF 2.0 HTML Tags -->
+
<!-- Jsf 2.0 composite tags -->
<vpe:tag name="composite:implementation"
case-sensitive="yes">
<!-- Checks for min tld version has been comented,
- becouse it's not specified correctly in jsf lib, mareshkau -->
- <!-- <vpe:if test="tld_version('min=2.0')"> -->
+ becouse it's not specified correctly in jsf lib, mareshkau
+ <vpe:if test="tld_version('min=2.0')"> -->
<vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.facelets.template.VpeCompositionTemplate"
namespaceIdentifier="org.jboss.tools.jsf.vpe.facelets">
</vpe:template>
-<!-- </vpe:if>-->
+<!-- </vpe:if>-->
</vpe:tag>
<vpe:tag name="composite:interface" case-sensitive="yes">
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/ajax.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/ajax.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/ajax.xhtml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,16 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+<h:head/>
+<h:body>
+ <h:form>
+ <h:inputText value="#{calc.query}" id="query">
+ <f:ajax id="ajax1" event="keyup" render="result"
listener="#{calc.evaluate}"/>
+ </h:inputText>
+ </h:form>
+</h:body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/button.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/button.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/button.xhtml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,25 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+<h:head>
+ <style>
+ .redClass {
+ color: red;
+ }
+ </style>
+</h:head>
+<h:body>
+ <h:form>
+ <h:button value="button" id="button1" />
+ <h:button value="button1" id="button2" type="button"
/>
+ <h:button value="button3" id="button3" type="reset"
/>
+ <h:button value="button4" id="button4" type="submit"
/>
+ <h:button value="button5" id="button5" image="" />
+ <h:button value="button6" id="button6"
styleClass="redClass" style="font-style:italic;" />
+ </h:form>
+</h:body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/button.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/button.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/button.xhtml.xml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,20 @@
+<tests>
+ <test id="button1">
+ <input type="button" value="button"/>
+ </test>
+ <test id="button2">
+ <input type="button" value="button1" />
+ </test>
+ <test id="button3">
+ <input type="reset" value="button3" />
+ </test>
+ <test id="button4">
+ <input type="submit" value="button4" />
+ </test>
+ <test id="button5">
+ <input type="image" SRC="/.*ve/unresolved_image.gif/" />
+ </test>
+ <test id="button6">
+ <INPUT TYPE="button" CLASS="redClass" STYLE="/.*font-style:
italic;.*/" VALUE="button6"/>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/event.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/event.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/event.xhtml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,16 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+<h:head/>
+<h:body>
+ <h:form>
+ <h:inputText value="#{calc.query}" id="query">
+ <f:event id="event1" type="preValidate"
listener="#{calc.preValidateQuery}"/>
+ </h:inputText>
+ </h:form>
+</h:body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/link.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/link.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/link.xhtml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,23 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+<h:head>
+ <style>
+ .redClass {
+ color: red;
+ }
+ </style>
+</h:head>
+<h:body>
+ <h:form>
+ <h:link id="link1" value="link1" disabled="true"
/>
+ <h:link id="link2" value="link2" disabled="false"
/>
+ <h:link id="link3" value="link3" styleClass="redClass"
style="font-style:italic;"/>
+ <h:link id="link4" value="link3"
rendered="false"/>
+ </h:form>
+</h:body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/link.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/link.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/link.xhtml.xml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,11 @@
+<tests>
+ <test id="link1">
+ <span CLASS="vpe-text">link1</span>
+ </test>
+ <test id="link2">
+ <a>link2</a>
+ </test>
+ <test id="link3">
+ <A STYLE="font-style: italic;"
CLASS="redClass">link3</A>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/metadata.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/metadata.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/metadata.xhtml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,15 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+<h:head/>
+<h:body>
+ <f:metadata id="metadata1"/>
+ <h:form>
+ <h:link value="h:link" alt="h:linkALTTEXT"
includeViewParams="true"/>
+ </h:form>
+</h:body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/validateBean.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/validateBean.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/validateBean.xhtml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,16 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+<h:head/>
+<h:body>
+ <h:form>
+ <h:inputText value="#{calc.query}" id="query">
+ <f:validateBean id="validateBean1"
binding="#{calcValidator}"/>
+ </h:inputText>
+ </h:form>
+</h:body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/validateRequired.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/validateRequired.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/validateRequired.xhtml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,16 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+<h:head/>
+<h:body>
+ <h:form>
+ <h:inputText value="#{calc.query}" id="query">
+ <f:validateRequired id="validateRequired1"/>
+ </h:inputText>
+ </h:form>
+</h:body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/viewParam.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/viewParam.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/components/viewParam.xhtml 2009-12-30
09:16:44 UTC (rev 19611)
@@ -0,0 +1,18 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+<h:head/>
+<h:body>
+ <f:metadata>
+ <f:viewParam id="viewParam1" name="viewParam1"
value="viewParamValue1" />
+ <f:viewParam name="viewParam2" value="viewParamValue2" />
+ </f:metadata>
+ <h:form>
+ <h:link value="h:link" alt="h:linkALTTEXT"
includeViewParams="true"/>
+ </h:form>
+</h:body>
+</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java 2009-12-29
22:10:15 UTC (rev 19610)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java 2009-12-30
09:16:44 UTC (rev 19611)
@@ -29,6 +29,30 @@
super(name);
setCheckWarning(false);
}
+
+ public void testAjax() throws Throwable {
+ performInvisibleTagTest("components/ajax.xhtml", "ajax1");
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testEvent() throws Throwable {
+ performInvisibleTagTest("components/event.xhtml", "event1");
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testValidateBean() throws Throwable {
+ performInvisibleTagTest("components/validateBean.xhtml",
"validateBean1"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testValidateRequired() throws Throwable {
+ performInvisibleTagTest("components/validateRequired.xhtml",
"validateRequired1"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testViewParam() throws Throwable {
+ performInvisibleTagTest("components/viewParam.xhtml",
"viewParam1"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testMetadata() throws Throwable {
+ performInvisibleTagTest("components/metadata.xhtml", "metadata1");
//$NON-NLS-1$ //$NON-NLS-2$
+ }
public void testBody1() throws Throwable {
performContentTest("components/body1.xhtml"); //$NON-NLS-1$
@@ -45,7 +69,16 @@
public void testHead2() throws Throwable {
performContentTest("components/head2.xhtml"); //$NON-NLS-1$
}
+
+ public void testButton() throws Throwable {
+ performContentTest("components/button.xhtml"); //$NON-NLS-1$
+ }
+ public void testLink() throws Throwable {
+ performContentTest("components/link.xhtml"); //$NON-NLS-1$
+ performInvisibleTagTest("components/link.xhtml", "link4");
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
public void testOutputScript() throws Throwable {
performInvisibleTagTest("components/outputScript.xhtml",
"outputScript1"); //$NON-NLS-1$ //$NON-NLS-2$
}