Author: dsakovich
Date: 2008-01-17 13:22:34 -0500 (Thu, 17 Jan 2008)
New Revision: 5775
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1615/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1615/JBIDE-1615.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1615Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1615
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1615/JBIDE-1615.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1615/JBIDE-1615.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1615/JBIDE-1615.xhtml 2008-01-17
18:22:34 UTC (rev 5775)
@@ -0,0 +1,63 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <style type="text/css">
+ .odd-row {
+ background-color: #ECF3FE;
+ }
+ .even-row {
+ background-color: #FCFFFE;
+ }
+ .active-row {
+ background-color: #FFEBDA;
+ }
+
+ </style>
+
+
+ <rich:separator lineType="solid" height="1" />
+
+ <h:outputText value="This demo shows how just four rich:jQuery queries allow
to
+ add zebra-style to a table and highlight rows under the mouse cursor." />
+
+
+ <rich:dataTable width="483" id="carList" rows="15"
+ value="#{dataTableScrollerBean.allCars}" var="category">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <h:column><h:outputText value="Make" /></h:column>
+ <h:column><h:outputText value="Model" /></h:column>
+ <h:column><h:outputText value="Price" /></h:column>
+ <h:column><h:outputText value="Mileage" /></h:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <h:column>
+ <h:outputText value="#{category.make}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{category.model}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{category.price}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{category.mileage}" />
+ </h:column>
+
+ </rich:dataTable>
+
+ <rich:jQuery selector="#carList tr:odd"
query="addClass('odd-row')" />
+ <rich:jQuery selector="#carList tr:even"
query="addClass('even-row')" />
+ <rich:jQuery selector="#carList tr"
+ query="mouseover(function(){jQuery(this).addClass('active-row')})"/>
+ <rich:jQuery selector="#carList tr"
+ query="mouseout(function(){jQuery(this).removeClass('active-row')})"/>
+
+
+ <rich:separator height="1" style="padding-top:10px" />
+</ui:composition>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-01-17
17:08:11 UTC (rev 5774)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-01-17
18:22:34 UTC (rev 5775)
@@ -17,6 +17,7 @@
import junit.framework.TestSuite;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1484Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1615Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1467Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1501Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1548Test;
@@ -43,6 +44,7 @@
suite.addTestSuite(JBIDE1484Test.class);
suite.addTestSuite(JsfJbide1548Test.class);
suite.addTestSuite(JsfJbide1568Test.class);
+ suite.addTestSuite(JBIDE1615Test.class);
// $JUnit-END$
//added by Max Areshkau
//add here projects which should be imported for junit tests
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1615Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1615Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1615Test.java 2008-01-17
18:22:34 UTC (rev 5775)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+
+public class JBIDE1615Test extends VpeTest {
+
+ public static final String IMPORT_PROJECT_NAME = "jsfTest";
+
+ private static final String TEST_PAGE_NAME =
"JBIDE/1615/JBIDE-1615.xhtml";
+
+ public JBIDE1615Test(String name) {
+
+ super(name);
+ }
+
+ //test method for JBIDE 1484
+ public void testJBIDE_1484() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
+ IMPORT_PROJECT_NAME);
+
+ assertNotNull("Could not open specified file " + file.getFullPath(),
+ file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+
+ //check that element is not null
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "span" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_SPAN);
+
+ assertEquals(13, elements.size());
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml 2008-01-17
17:08:11 UTC (rev 5774)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml 2008-01-17
18:22:34 UTC (rev 5775)
@@ -997,7 +997,7 @@
<vpe:column title="{tagstring()}"/>
</vpe:template>
</vpe:if>
- <vpe:if test="parentname()='rich:dataTable'">
+ <vpe:if
test="parentname()='rich:columnGroup'|parentname()='rich:dataTable'">
<vpe:template children="yes" modify="yes"
namespaceIdentifier="org.jboss.tools.jsf.vpe.richfaces"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesColumnTemplate">
</vpe:template>
</vpe:if>