JBoss Rich Faces SVN: r21235 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richDropDownMenu and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-26 10:24:37 -0500 (Wed, 26 Jan 2011)
New Revision: 21235
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/sideMenu.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/topMenu.xhtml
Log:
https://issues.jboss.org/browse/RFPL-957
* samples for ddm fixed
* added 31 new tests for drop down menu
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.properties 2011-01-26 15:08:33 UTC (rev 21234)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.properties 2011-01-26 15:24:37 UTC (rev 21235)
@@ -1,3 +1,25 @@
attr.dir.ltr=ltr
attr.dir.rtl=rtl
attr.dir.null=
+
+attr.direction.topLeft=topLeft
+attr.direction.topRight=topRight
+attr.direction.bottomLeft=bottomLeft
+attr.direction.bottomRight=bottomRight
+attr.direction.autoLeft=autoLeft
+attr.direction.autoRight=autoRight
+attr.direction.topAuto=topAuto
+attr.direction.bottomAuto=bottomAuto
+attr.direction.auto=auto
+attr.direction.null=
+
+attr.jointPoint.topLeft=topLeft
+attr.jointPoint.topRight=topRight
+attr.jointPoint.bottomLeft=bottomLeft
+attr.jointPoint.bottomRight=bottomRight
+attr.jointPoint.autoLeft=autoLeft
+attr.jointPoint.autoRight=autoRight
+attr.jointPoint.topAuto=topAuto
+attr.jointPoint.bottomAuto=bottomAuto
+attr.jointPoint.auto=auto
+attr.jointPoint.null=
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/sideMenu.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/sideMenu.xhtml 2011-01-26 15:08:33 UTC (rev 21234)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/sideMenu.xhtml 2011-01-26 15:24:37 UTC (rev 21235)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
@@ -56,8 +56,11 @@
<h:panelGrid styleClass="vertical-menu-cell" columnClasses="optionList" columns="1" cellspacing="0" cellpadding="0">
<rich:dropDownMenu id="menu1"
dir="#{richDropDownMenuBean.attributes['dir'].value}"
+ direction="#{richDropDownMenuBean.attributes['direction'].value}"
disabled="#{richDropDownMenuBean.attributes['disabled'].value}"
hideDelay="#{richDropDownMenuBean.attributes['hideDelay'].value}"
+ horizontalOffset="#{richDropDownMenuBean.attributes['horizontalOffset'].value}"
+ jointPoint="#{richDropDownMenuBean.attributes['jointPoint'].value}"
lang="#{richDropDownMenuBean.attributes['lang'].value}"
mode="#{richDropDownMenuBean.attributes['mode'].value}"
onclick="#{richDropDownMenuBean.attributes['onclick'].value}"
@@ -75,13 +78,14 @@
onmouseover="#{richDropDownMenuBean.attributes['onmouseover'].value}"
onmouseup="#{richDropDownMenuBean.attributes['onmouseup'].value}"
onshow="#{richDropDownMenuBean.attributes['onshow'].value}"
- popupWith="#{richDropDownMenuBean.attributes['popupWith'].value}"
+ popupWidth="#{richDropDownMenuBean.attributes['popupWidth'].value}"
rendered="#{richDropDownMenuBean.attributes['rendered'].value}"
showDelay="#{richDropDownMenuBean.attributes['showDelay'].value}"
showEvent="#{richDropDownMenuBean.attributes['showEvent'].value}"
style="#{richDropDownMenuBean.attributes['style'].value}"
styleClass="#{richDropDownMenuBean.attributes['styleClass'].value}"
title="#{richDropDownMenuBean.attributes['title'].value}"
+ verticalOffset="#{richDropDownMenuBean.attributes['verticalOffset'].value}"
>
<f:facet name="label">
<h:panelGroup>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/topMenu.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/topMenu.xhtml 2011-01-26 15:08:33 UTC (rev 21234)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/topMenu.xhtml 2011-01-26 15:24:37 UTC (rev 21235)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
@@ -56,8 +56,11 @@
<rich:toolbar id="toolbar" height="26px">
<rich:dropDownMenu id="menu1"
dir="#{richDropDownMenuBean.attributes['dir'].value}"
+ direction="#{richDropDownMenuBean.attributes['direction'].value}"
disabled="#{richDropDownMenuBean.attributes['disabled'].value}"
hideDelay="#{richDropDownMenuBean.attributes['hideDelay'].value}"
+ horizontalOffset="#{richDropDownMenuBean.attributes['horizontalOffset'].value}"
+ jointPoint="#{richDropDownMenuBean.attributes['jointPoint'].value}"
lang="#{richDropDownMenuBean.attributes['lang'].value}"
mode="#{richDropDownMenuBean.attributes['mode'].value}"
onclick="#{richDropDownMenuBean.attributes['onclick'].value}"
@@ -75,13 +78,14 @@
onmouseover="#{richDropDownMenuBean.attributes['onmouseover'].value}"
onmouseup="#{richDropDownMenuBean.attributes['onmouseup'].value}"
onshow="#{richDropDownMenuBean.attributes['onshow'].value}"
- popupWith="#{richDropDownMenuBean.attributes['popupWith'].value}"
+ popupWidth="#{richDropDownMenuBean.attributes['popupWidth'].value}"
rendered="#{richDropDownMenuBean.attributes['rendered'].value}"
showDelay="#{richDropDownMenuBean.attributes['showDelay'].value}"
showEvent="#{richDropDownMenuBean.attributes['showEvent'].value}"
style="#{richDropDownMenuBean.attributes['style'].value}"
styleClass="#{richDropDownMenuBean.attributes['styleClass'].value}"
title="#{richDropDownMenuBean.attributes['title'].value}"
+ verticalOffset="#{richDropDownMenuBean.attributes['verticalOffset'].value}"
>
<f:facet name="label">
<h:panelGroup>
@@ -90,13 +94,13 @@
</h:panelGroup>
</f:facet>
- <rich:menuItem label="New" action="#{richDropDownMenuBean.doNew}" icon="/resources/images/icons/create_doc.gif"/>
+ <rich:menuItem id="menuItem1" label="New" action="#{richDropDownMenuBean.doNew}" icon="/resources/images/icons/create_doc.gif"/>
- <rich:menuItem label="Open" action="#{richDropDownMenuBean.doOpen}" icon="/resources/images/icons/open.gif" />
+ <rich:menuItem id="menuItem2" label="Open" action="#{richDropDownMenuBean.doOpen}" icon="/resources/images/icons/open.gif" />
- <rich:menuGroup label="Open Recent..." disabled="true">
- <rich:menuItem label="Save" action="#{richDropDownMenuBean.doSave}" icon="/resources/images/icons/save.gif" />
- <rich:menuItem label="Save All" action="#{richDropDownMenuBean.doSaveAll}">
+ <rich:menuGroup id="menuGroup3" label="Open Recent..." disabled="true">
+ <rich:menuItem id="menuItem31" label="Save" action="#{richDropDownMenuBean.doSave}" icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem32" label="Save All" action="#{richDropDownMenuBean.doSaveAll}">
<f:facet name="icon">
<h:graphicImage library="images/icons" name="save_all.gif" />
</f:facet>
@@ -105,23 +109,23 @@
<rich:menuSeparator id="menuSeparator11" />
- <rich:menuGroup label="Save As...">
- <rich:menuItem label="Save" action="#{richDropDownMenuBean.doSave}" icon="/resources/images/icons/save.gif" />
- <rich:menuItem label="Save All" action="#{richDropDownMenuBean.doSaveAll}">
+ <rich:menuGroup id="menuGroup4" label="Save As...">
+ <rich:menuItem id="menuItem41" label="Save" action="#{richDropDownMenuBean.doSave}" icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem42" label="Save All" action="#{richDropDownMenuBean.doSaveAll}">
<f:facet name="icon">
<h:graphicImage library="images/icons" name="save_all.gif" />
</f:facet>
</rich:menuItem>
- <rich:menuItem label="Send Online" icon="/resources/images/icons/save.gif" disabled="true" />
+ <rich:menuItem id="menuItem43" label="Send Online" icon="/resources/images/icons/save.gif" disabled="true" />
</rich:menuGroup>
- <rich:menuItem label="Print" action="#{richDropDownMenuBean.doPrint}" disabled="true"/>
+ <rich:menuItem id="menuItem5" label="Print" action="#{richDropDownMenuBean.doPrint}" disabled="true"/>
- <rich:menuItem label="Close" action="#{richDropDownMenuBean.doClose}" />
+ <rich:menuItem id="menuItem6" label="Close" action="#{richDropDownMenuBean.doClose}" />
<rich:menuSeparator id="menuSeparator12" />
- <rich:menuItem label="Exit" action="#{richDropDownMenuBean.doExit}" />
+ <rich:menuItem id="menuItem7" label="Exit" action="#{richDropDownMenuBean.doExit}" />
</rich:dropDownMenu>
@@ -131,23 +135,23 @@
Links
</h:panelGrid>
</f:facet>
- <rich:menuItem submitMode="none" onclick="document.location.href='http://jboss.org/richfaces'">
+ <rich:menuItem id="menuItemRFLink" submitMode="none" onclick="document.location.href='http://jboss.org/richfaces'">
<h:outputLink value="http://jboss.org/richfaces">
<h:outputText value="RichFaces Home Page"></h:outputText>
</h:outputLink>
</rich:menuItem>
- <rich:menuItem submitMode="none" onclick="document.location.href='http://community.jboss.org/en/richfaces?view=discussions'">
+ <rich:menuItem id="menuItemForumLink" submitMode="none" onclick="document.location.href='http://community.jboss.org/en/richfaces?view=discussions'">
<h:outputLink value="http://community.jboss.org/en/richfaces?view=discussions">RichFaces Forum</h:outputLink>
</rich:menuItem>
</rich:dropDownMenu>
<rich:toolbarGroup id="rightGroup" location="right">
<rich:dropDownMenu id="menu3" label="Search" direction="bottomLeft" jointPoint="bottomRight" styleClass="search" mode="client">
- <rich:menuItem>
+ <rich:menuItem id="menuItemInput">
<h:inputText id="searchinput" />
<button type="button">Search</button>
</rich:menuItem>
- <rich:menuItem label="Enter your search criteria here" disabled="true"/>
+ <rich:menuItem id="menuItemLabel" label="Enter your search criteria here" disabled="true"/>
</rich:dropDownMenu>
</rich:toolbarGroup>
</rich:toolbar>
@@ -158,7 +162,7 @@
Current Selection:
<h:outputText id="output" style="font-weight:bold" value="#{richDropDownMenuBean.current}"></h:outputText>
</a4j:outputPanel>
-
+
<br /><br />
</ui:define>
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java 2011-01-26 15:24:37 UTC (rev 21235)
@@ -0,0 +1,326 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richDropDownMenu;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.css.CssProperty;
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.EventFiredCondition;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/richDropDownMenu/topMenu.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichDropDownMenu extends AbstractMetamerTest {
+
+ private JQueryLocator fileMenu = pjq("div[id$=menu1]");
+ private JQueryLocator fileMenuLabel = pjq("div[id$=menu1] div.rf-ddm-lbl-dec");
+ private JQueryLocator fileMenuList = pjq("div[id$=menu1_list]");
+ private JQueryLocator group = pjq("div[id$=menuGroup4]");
+ private JQueryLocator groupList = pjq("div[id$=menuGroup4_list]");
+ private JQueryLocator icon = fileMenu.getDescendant(jq("img.pic"));
+ private JQueryLocator emptyIcon = fileMenu.getDescendant(jq("> span.rf-ddm-itm-ic > div.rf-ddm-emptyIcon"));
+ private JQueryLocator menuItem41 = pjq("div[id$=menuItem41]");
+ private JQueryLocator output = pjq("span[id$=output]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richDropDownMenu/topMenu.xhtml");
+ }
+
+ @Test
+ public void testInit() {
+ assertTrue(selenium.isElementPresent(fileMenu), "Drop down menu \"File\" should be present on the page.");
+ assertTrue(selenium.isVisible(fileMenu), "Drop down menu \"File\" should be visible on the page.");
+
+ assertTrue(selenium.isElementPresent(group), "Menu group \"Save As...\" should be present on the page.");
+ assertFalse(selenium.isVisible(group), "Menu group \"Save As...\" should not be visible on the page.");
+
+ assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be expanded.");
+ guardNoRequest(selenium).mouseOver(fileMenuLabel);
+ assertTrue(selenium.isDisplayed(fileMenuList), "Menu should be expanded.");
+
+ assertTrue(selenium.isElementPresent(group), "Menu group \"Save As...\" should be present on the page.");
+ assertTrue(selenium.isVisible(group), "Menu group \"Save As...\" should be visible on the page.");
+
+ assertTrue(selenium.isElementPresent(menuItem41), "Menu item \"Save\" should be present on the page.");
+ assertFalse(selenium.isVisible(menuItem41), "Menu item \"Save\" should not be visible on the page.");
+
+ assertFalse(selenium.isDisplayed(groupList), "Submenu should not be expanded.");
+ guardNoRequest(selenium).mouseOver(group);
+ assertTrue(selenium.isDisplayed(groupList), "Submenu should be expanded.");
+
+ assertTrue(selenium.isElementPresent(menuItem41), "Menu item \"Save\" should be present on the page.");
+ assertTrue(selenium.isVisible(menuItem41), "Menu item \"Save\" should be visible on the page.");
+
+ assertTrue(selenium.isElementPresent(icon), "Icon of menu group should not be present on the page.");
+
+ assertTrue(selenium.isElementPresent(fileMenuLabel), "Label of menu should be present on the page.");
+ assertTrue(selenium.isVisible(fileMenuLabel), "Label of menu should be visible on the page.");
+
+ assertEquals(selenium.getText(fileMenuLabel), "File", "Label of the menu");
+ }
+
+ @Test
+ public void testDir() {
+ testDir(fileMenu);
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10305")
+ public void testDisabled() {
+ selenium.click(pjq("input[type=radio][name$=disabledInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.belongsClass(fileMenu, "rf-ddm-itm-dis"), "Menu should have class \"rf-ddm-itm-dis\".");
+ assertTrue(selenium.isElementPresent(emptyIcon), "Empty icon should be present.");
+ assertFalse(selenium.isElementPresent(icon), "Icon should not be present.");
+ }
+
+ @Test
+ public void testHideDelay() {
+ selenium.type(pjq("input[id$=hideDelayInput]"), "3000");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ selenium.mouseOut(fileMenuLabel);
+ assertTrue(selenium.isDisplayed(fileMenuList), "Menu should be expanded.");
+ waitFor(3000);
+ assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be expanded.");
+ }
+
+ @Test
+ public void testLang() {
+ testLang(fileMenu);
+ }
+
+ @Test
+ public void testModeAjax() {
+ selenium.mouseOver(fileMenuLabel);
+ guardXhr(selenium).click(menuItem41);
+
+ waitGui.failWith("Output did not change.").until(textEquals.locator(output).text("Save"));
+ }
+
+ @Test
+ public void testModeNone() {
+ selenium.type(pjq("input[id$=modeInput]"), "");
+ selenium.waitForPageToLoad();
+
+ testModeServer();
+ }
+
+ @Test
+ public void testModeServer() {
+ selenium.type(pjq("input[id$=modeInput]"), "server");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ guardHttp(selenium).click(menuItem41);
+ assertEquals(selenium.getText(output), "Save", "Output did not change");
+ }
+
+ @Test
+ public void testModeClient() {
+ selenium.type(pjq("input[id$=modeInput]"), "client");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ guardNoRequest(selenium).click(menuItem41);
+ }
+
+ @Test
+ public void testOnclick() {
+ testFireEvent(Event.CLICK, fileMenu);
+ }
+
+ @Test
+ public void testOndblclick() {
+ testFireEvent(Event.DBLCLICK, fileMenu);
+ }
+
+ @Test
+ public void testOngrouphide() {
+ selenium.type(pjq("input[id$=ongrouphideInput]"), "metamerEvents += \"grouphide \"");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ selenium.mouseOver(group);
+ waitGui.interval(2000).withDelay(true).failWith("Menu group was not opened.").until(isDisplayed.locator(groupList));
+ selenium.mouseOut(group);
+
+ waitGui.failWith("Attribute ongrouphide does not work correctly").until(new EventFiredCondition(new Event("grouphide")));
+ }
+
+ @Test
+ public void testOngroupshow() {
+ selenium.type(pjq("input[id$=ongroupshowInput]"), "metamerEvents += \"groupshow \"");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ selenium.mouseOver(group);
+ waitGui.interval(2000).withDelay(true).failWith("Menu group was not opened.").until(isDisplayed.locator(group));
+
+ waitGui.failWith("Attribute ongroupshow does not work correctly").until(new EventFiredCondition(new Event("groupshow")));
+ }
+
+ @Test
+ public void testOnhide() {
+ selenium.type(pjq("input[id$=onhideInput]"), "metamerEvents += \"hide \"");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ selenium.mouseOut(fileMenuLabel);
+
+ waitGui.failWith("Attribute onhide does not work correctly").until(new EventFiredCondition(new Event("hide")));
+ }
+
+ @Test
+ public void testOnitemclick() {
+ testFireEvent(Event.CLICK, menuItem41, "itemclick");
+ }
+
+ @Test
+ public void testOnkeydown() {
+ testFireEvent(Event.KEYDOWN, fileMenu);
+ }
+
+ @Test
+ public void testOnkeypress() {
+ testFireEvent(Event.KEYPRESS, fileMenu);
+ }
+
+ @Test
+ public void testOnkeyup() {
+ testFireEvent(Event.KEYUP, fileMenu);
+ }
+
+ @Test
+ public void testOnmousedown() {
+ testFireEvent(Event.MOUSEDOWN, fileMenu);
+ }
+
+ @Test
+ public void testOnmousemove() {
+ testFireEvent(Event.MOUSEMOVE, fileMenu);
+ }
+
+ @Test
+ public void testOnmouseout() {
+ testFireEvent(Event.MOUSEOUT, fileMenu);
+ }
+
+ @Test
+ public void testOnmouseover() {
+ testFireEvent(Event.MOUSEOVER, fileMenu);
+ }
+
+ @Test
+ public void testOnmouseup() {
+ testFireEvent(Event.MOUSEUP, fileMenu);
+ }
+
+ @Test
+ public void testOnshow() {
+ selenium.type(pjq("input[id$=onshowInput]"), "metamerEvents += \"show \"");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+
+ waitGui.failWith("Attribute onshow does not work correctly").until(new EventFiredCondition(new Event("show")));
+ }
+
+ @Test
+ public void testPopupWidth() {
+ assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH), "250px", "Default width of menu");
+
+ selenium.type(pjq("input[id$=popupWidthInput]"), "150");
+ selenium.waitForPageToLoad();
+ assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH), "150px", "Width of menu");
+
+ selenium.type(pjq("input[id$=popupWidthInput]"), "423");
+ selenium.waitForPageToLoad();
+ assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH), "423px", "Width of menu");
+ }
+
+ @Test
+ public void testRendered() {
+ selenium.click(pjq("input[type=radio][name$=renderedInput][value=false]"));
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(fileMenu), "Menu should not be rendered when rendered=false.");
+ assertTrue(selenium.isDisplayed(fileMenu), "Menu should be displayed when item 1 is not rendered.");
+ }
+
+ @Test
+ public void testShowDelay() {
+ selenium.type(pjq("input[id$=showDelayInput]"), "3000");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be expanded.");
+ waitGui.interval(3000).withDelay(true).failWith("Menu was not opened.").until(isDisplayed.locator(fileMenuList));
+ }
+
+ @Test
+ public void testShowEvent() {
+ selenium.type(pjq("input[id$=showEventInput]"), "click");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be expanded.");
+
+ selenium.click(fileMenuLabel);
+ waitGui.withDelay(true).failWith("Menu was not expanded.").until(isDisplayed.locator(fileMenuList));
+ }
+
+ @Test
+ public void testStyle() {
+ testStyle(fileMenu, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ testStyleClass(fileMenu, "styleClass");
+ }
+
+ @Test
+ public void testTitle() {
+ testTitle(fileMenu);
+ }
+}
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
___________________________________________________________________
Name: svn:keywords
+ Revision
13 years, 11 months
JBoss Rich Faces SVN: r21234 - trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2011-01-26 10:08:33 -0500 (Wed, 26 Jan 2011)
New Revision: 21234
Modified:
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js
Log:
RF-10252: styles and buttons for datascroller were fixed
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss 2011-01-26 14:38:58 UTC (rev 21233)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss 2011-01-26 15:08:33 UTC (rev 21234)
@@ -1,123 +1,131 @@
-.rf-ds{
- white-space:nowrap;
- display:inline-block;
- font-size:'#{richSkin.generalSizeFont}';
- padding:1px;
- font-family:'#{richSkin.generalFamilyFont}';
- background:'#{richSkin.tableBackgroundColor}';
+.rf-ds {
+ white-space: nowrap;
+ display: inline-block;
+ font-size: '#{richSkin.generalSizeFont}';
+ padding: 1px;
+ font-family: '#{richSkin.generalFamilyFont}';
+ background: '#{richSkin.tableBackgroundColor}';
}
a.rf-ds-nmb-btn {
- color: '#{richSkin.generalTextColor}';
+ color: '#{richSkin.generalTextColor}';
}
a.rf-ds-btn {
- color: '#{richSkin.generalTextColor}';
+ color: '#{richSkin.generalTextColor}';
}
-.rf-ds-cont {
- white-space: nowrap;
- display: inline-block;
- font-size: '#{richSkin.generalSizeFont}';
- padding: 1px;
- font-family: '#{richSkin.generalFamilyFont}';
- background: '#{richSkin.tableBackgroundColor}';
+.rf-ds-cont {
+ white-space: nowrap;
+ display: inline-block;
+ font-size: '#{richSkin.generalSizeFont}';
+ padding: 1px;
+ font-family: '#{richSkin.generalFamilyFont}';
+ background: '#{richSkin.tableBackgroundColor}';
}
.rf-ds-cont-dec {
- border-width: 1px;
- border-style: solid;
- border-color: '#{richSkin.tableBorderColor}';
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.tableBorderColor}';
}
-.rf-ds-btn {
- cursor: pointer;
- padding: 2px 10px 3px 10px;
- border-width: 1px;
- border-style: solid;
- border-color: '#{richSkin.tableBorderColor}';
- display: inline-block;
+.rf-ds-btn {
+ cursor: pointer;
+ padding: 2px 10px 3px 10px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.tableBorderColor}';
+ display: inline-block;
- background-position: top left;
- background-repeat: repeat-x;
- background-color: '#{richSkin.headerBackgroundColor}';
- background-image: "url(#{resource['org.richfaces.images:dsBtnGrad.png']})";
+ background-position: top left;
+ background-repeat: repeat-x;
+ background-color: '#{richSkin.headerBackgroundColor}';
+ background-image: "url(#{resource['org.richfaces.images:dsBtnGrad.png']})";
- font-size: '#{richSkin.generalSizeFont}';
- font-family: '#{richSkin.generalFamilyFont}';
- color: '#{richSkin.generalTextColor}';
- text-decoration: none;
- font-weight: normal;
+ font-size: '#{richSkin.generalSizeFont}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ color: '#{richSkin.generalTextColor}';
+ text-decoration: none;
+ font-weight: normal;
}
+.rf-ds-btn:hover {
+ color: #fff;
+}
+
+.rf-ds-dis:hover {
+ color: '#{richSkin.tableBorderColor}';
+ cursor: default;
+}
+
.rf-ds-btn-first, .rf-ds-btn-fastrwd, .rf-ds-btn-prev {
- margin-right: 1px;
+ margin-right: 1px;
}
.rf-ds-btn-next, .rf-ds-btn-fastfwd, .rf-ds-btn-last {
- margin-left: 1px;
+ margin-left: 1px;
}
-.rf-ds-nmb-btn {
- cursor: pointer;
- width: 2em;
- text-align: center;
- margin-left: 1px;
- margin-right: 1px;
- padding: 2px 2px 3px 2px;
- border-width: 1px;
- border-style: solid;
- border-color: transparent;
- border-top-width: 1px;
- border-top-style: solid;
- border-top-color: '#{richSkin.tableBorderColor}';
+.rf-ds-nmb-btn {
+ cursor: pointer;
+ width: 2em;
+ text-align: center;
+ margin-left: 1px;
+ margin-right: 1px;
+ padding: 2px 2px 3px 2px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: transparent;
+ border-top-width: 1px;
+ border-top-style: solid;
+ border-top-color: '#{richSkin.tableBorderColor}';
- background-color: '#{richSkin.tableBackgroundColor}';
- background-image: "url(#{resource['org.richfaces.images:dsDigGrad.png']})";
+ background-color: '#{richSkin.tableBackgroundColor}';
+ background-image: "url(#{resource['org.richfaces.images:dsDigGrad.png']})";
-
- background-position: top left;
- background-repeat: repeat-x;
+ background-position: top left;
+ background-repeat: repeat-x;
- display: inline-block;
- font-size: '#{richSkin.generalSizeFont}';
- font-family: '#{richSkin.generalFamilyFont}';
- text-decoration: none;
- color: '#{richSkin.generalTextColor}';
- font-weight: normal;
-
+ display: inline-block;
+ font-size: '#{richSkin.generalSizeFont}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ text-decoration: none;
+ color: '#{richSkin.generalTextColor}';
+ font-weight: normal;
+
}
-.rf-ds-hov {
- border-width : 1px;
- border-style: solid;
- border-color: '#{richSkin.tableBorderColor}';
- background-position: top left;
- background-repeat: repeat-x;
- background-color: '#{richSkin.tableBackgroundColor}';
- background-image: "url(#{resource['org.richfaces.images:dsBtnGradOver.png']})";
+.rf-ds-nmb-btn:hover {
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.tableBorderColor}';
+ background-position: top left;
+ background-repeat: repeat-x;
+ background-color: '#{richSkin.tableBackgroundColor}';
+ background-image: "url(#{resource['org.richfaces.images:dsBtnGradOver.png']})";
}
-.rf-ds-press {
- border-width: 1px;
- border-style: solid;
- border-color: '#{richSkin.tableBorderColor}';
- background: '#{richSkin.additionalBackgroundColor}';
+.rf-ds-press {
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.tableBorderColor}';
+ background: '#{richSkin.additionalBackgroundColor}';
}
-.rf-ds-act {
- cursor: default;
- font-weight: bold;
- border-width: 1px;
- bordr-style: solid;
- border-color: transparent;
- border-bottom-width: 1px;
- border-bottom-style: solid;
- border-bottom-color: '#{richSkin.tableBorderColor}';
- background: none;
+.rf-ds-act, .rf-ds-act:hover {
+ cursor: default;
+ font-weight: bold;
+ border-width: 1px;
+ bordr-style: solid;
+ border-color: transparent;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ border-bottom-color: '#{richSkin.tableBorderColor}';
+ background: none;
}
-.rf-ds-dis{
- color: '#{richSkin.tableBorderColor}';
- cursor: default;
+.rf-ds-dis {
+ color: '#{richSkin.tableBorderColor}';
+ cursor: default;
}
\ No newline at end of file
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js 2011-01-26 14:38:58 UTC (rev 21233)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js 2011-01-26 15:08:33 UTC (rev 21234)
@@ -35,11 +35,11 @@
return eventData;
};
- var addToggledClasses = function(el, event) {
- if (event.type == 'mousedown' || event.type == 'mouseup') {
- el.toggleClass('rf-ds-press');
- } else if(event.type == 'mouseover' || event.type == 'mouseout') {
- el.toggleClass('rf-ds-hov');
+ var togglePressClass = function(el, event) {
+ if (event.type == 'mousedown'){
+ el.addClass('rf-ds-press');
+ } else if (event.type == 'mouseup' || event.type =='mouseout'){
+ el.removeClass('rf-ds-press');
}
};
@@ -60,12 +60,11 @@
if (options.buttons) {
- $(dataScrollerElement).delegate('.rf-ds-btn', 'mouseover mouseout mouseup mousedown', function(event) {
+ $(dataScrollerElement).delegate('.rf-ds-btn', 'mouseup mousedown mouseout', function(event) {
if ($(this).hasClass('rf-ds-dis')) {
- $(this).removeClass('rf-ds-hov');
$(this).removeClass('rf-ds-press');
} else {
- addToggledClasses($(this), event);
+ togglePressClass($(this), event);
}
});
@@ -75,8 +74,8 @@
if (options.digitals) {
- $(dataScrollerElement).delegate('.rf-ds-nmb-btn', 'mouseover mouseout mouseup mousedown', function(event) {
- addToggledClasses($(this), event);
+ $(dataScrollerElement).delegate('.rf-ds-nmb-btn', 'mouseup mousedown mouseout', function(event) {
+ togglePressClass($(this), event);
});
initButtons(options.digitals, css, this);
13 years, 11 months
JBoss Rich Faces SVN: r21233 - in trunk/ui/output/ui/src: main/java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-26 09:38:58 -0500 (Wed, 26 Jan 2011)
New Revision: 21233
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/accordionItem.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml
Log:
RF-10243 switchable panels: add new icon type and change defaults in CollapsiblePanel and Accordion
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2011-01-26 14:38:58 UTC (rev 21233)
@@ -241,7 +241,7 @@
@Attribute(generate = false)
public String getItemLeftIcon() {
- return (String) getStateHelper().eval(Properties.itemLeftIcon, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.itemLeftIcon, PanelIcons.transparent.toString());
}
public void setItemLeftIcon(String itemLeftIcon) {
@@ -250,7 +250,7 @@
@Attribute(generate = false)
public String getItemRightIcon() {
- return (String) getStateHelper().eval(Properties.itemRightIcon, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.itemRightIcon, PanelIcons.transparent.toString());
}
public void setItemRightIcon(String itemRightIcon) {
@@ -259,7 +259,7 @@
@Attribute(generate = false)
public String getItemLeftIconDisabled() {
- return (String) getStateHelper().eval(Properties.itemLeftIconDisabled, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.itemLeftIconDisabled, PanelIcons.transparent.toString());
}
public void setItemLeftIconDisabled(String itemLeftIconDisabled) {
@@ -268,7 +268,7 @@
@Attribute(generate = false)
public String getItemRightIconDisabled() {
- return (String) getStateHelper().eval(Properties.itemRightIconDisabled, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.itemRightIconDisabled, PanelIcons.transparent.toString());
}
public void setItemRightIconDisabled(String itemRightIconDisabled) {
@@ -283,7 +283,7 @@
@Attribute(generate = false)
public String getTopItemLeftIcon() {
- return (String) getStateHelper().eval(Properties.topItemLeftIcon, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topItemLeftIcon, PanelIcons.transparent.toString());
}
public void setTopItemLeftIcon(String topItemLeftIcon) {
@@ -292,7 +292,7 @@
@Attribute(generate = false)
public String getTopItemRightIcon() {
- return (String) getStateHelper().eval(Properties.topItemRightIcon, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topItemRightIcon, PanelIcons.transparent.toString());
}
public void setTopItemRightIcon(String topItemRightIcon) {
@@ -301,7 +301,7 @@
@Attribute(generate = false)
public String getTopItemLeftIconDisabled() {
- return (String) getStateHelper().eval(Properties.topItemLeftIconDisabled, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topItemLeftIconDisabled, PanelIcons.transparent.toString());
}
public void setTopItemLeftIconDisabled(String topItemLeftIconDisabled) {
@@ -310,7 +310,7 @@
@Attribute(generate = false)
public String getTopItemRightIconDisabled() {
- return (String) getStateHelper().eval(Properties.topItemRightIconDisabled, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topItemRightIconDisabled, PanelIcons.transparent.toString());
}
public void setTopItemRightIconDisabled(String topItemRightIconDisabled) {
@@ -325,7 +325,7 @@
@Attribute(generate = false)
public String getGroupLeftIconExpanded() {
- return (String) getStateHelper().eval(Properties.groupLeftIconExpanded, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.groupLeftIconExpanded, PanelIcons.transparent.toString());
}
public void setGroupLeftIconExpanded(String groupLeftIconExpanded) {
@@ -334,7 +334,7 @@
@Attribute(generate = false)
public String getGroupRightIconExpanded() {
- return (String) getStateHelper().eval(Properties.groupRightIconExpanded, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.groupRightIconExpanded, PanelIcons.transparent.toString());
}
public void setGroupRightIconExpanded(String groupRightIconExpanded) {
@@ -343,7 +343,7 @@
@Attribute(generate = false)
public String getGroupLeftIconCollapsed() {
- return (String) getStateHelper().eval(Properties.groupLeftIconCollapsed, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.groupLeftIconCollapsed, PanelIcons.transparent.toString());
}
public void setGroupLeftIconCollapsed(String groupLeftIconCollapsed) {
@@ -352,7 +352,7 @@
@Attribute(generate = false)
public String getGroupRightIconCollapsed() {
- return (String) getStateHelper().eval(Properties.groupRightIconCollapsed, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.groupRightIconCollapsed, PanelIcons.transparent.toString());
}
public void setGroupRightIconCollapsed(String groupRightIconCollapsed) {
@@ -361,7 +361,7 @@
@Attribute(generate = false)
public String getGroupLeftIconDisabled() {
- return (String) getStateHelper().eval(Properties.groupLeftIconDisabled, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.groupLeftIconDisabled, PanelIcons.transparent.toString());
}
public void setGroupLeftIconDisabled(String groupLeftIconDisabled) {
@@ -370,7 +370,7 @@
@Attribute(generate = false)
public String getGroupRightIconDisabled() {
- return (String) getStateHelper().eval(Properties.groupRightIconDisabled, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.groupRightIconDisabled, PanelIcons.transparent.toString());
}
public void setGroupRightIconDisabled(String groupRightIconDisabled) {
@@ -385,7 +385,7 @@
@Attribute(generate = false)
public String getTopGroupLeftIconExpanded() {
- return (String) getStateHelper().eval(Properties.topGroupLeftIconExpanded, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topGroupLeftIconExpanded, PanelIcons.transparent.toString());
}
public void setTopGroupLeftIconExpanded(String topGroupLeftIconExpanded) {
@@ -394,7 +394,7 @@
@Attribute(generate = false)
public String getTopGroupRightIconExpanded() {
- return (String) getStateHelper().eval(Properties.topGroupRightIconExpanded, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topGroupRightIconExpanded, PanelIcons.transparent.toString());
}
public void setTopGroupRightIconExpanded(String topGroupRightIconExpanded) {
@@ -403,7 +403,7 @@
@Attribute(generate = false)
public String getTopGroupLeftIconCollapsed() {
- return (String) getStateHelper().eval(Properties.topGroupLeftIconCollapsed, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topGroupLeftIconCollapsed, PanelIcons.transparent.toString());
}
public void setTopGroupLeftIconCollapsed(String topGroupLeftIconCollapsed) {
@@ -412,7 +412,7 @@
@Attribute(generate = false)
public String getTopGroupRightIconCollapsed() {
- return (String) getStateHelper().eval(Properties.topGroupRightIconCollapsed, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topGroupRightIconCollapsed, PanelIcons.transparent.toString());
}
public void setTopGroupRightIconCollapsed(String topGroupRightIconCollapsed) {
@@ -421,7 +421,7 @@
@Attribute(generate = false)
public String getTopGroupLeftIconDisabled() {
- return (String) getStateHelper().eval(Properties.topGroupLeftIconDisabled, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topGroupLeftIconDisabled, PanelIcons.transparent.toString());
}
public void setTopGroupLeftIconDisabled(String topGroupLeftIconDisabled) {
@@ -430,7 +430,7 @@
@Attribute(generate = false)
public String getTopGroupRightIconDisabled() {
- return (String) getStateHelper().eval(Properties.topGroupRightIconDisabled, PanelIcons.DEFAULT.toString());
+ return (String) getStateHelper().eval(Properties.topGroupRightIconDisabled, PanelIcons.transparent.toString());
}
public void setTopGroupRightIconDisabled(String topGroupRightIconDisabled) {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java 2011-01-26 14:38:58 UTC (rev 21233)
@@ -36,16 +36,24 @@
//TODO nick - should this be "-ico-exp"? also why expanded icon state is connected with right icon alignment?
encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico", iconInactive, iconActive, panel.isDisabled() ? State.headerDisabled : State.header);
}
-
+
@Override
protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String cssClass, String attrIconCollapsedValue, String attrIconExpandedValue, PanelIcons.State state) throws IOException {
- writer.startElement(TD_ELEM, null);
- writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
+ if (isIconRendered(attrIconCollapsedValue) ||
+ isIconRendered(attrIconExpandedValue)) {
+ writer.startElement(TD_ELEM, null);
+ writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
- encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix + "-act", state);
- encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix + "-inact", state);
+ if (isIconRendered(attrIconCollapsedValue)) {
+ encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix + "-act", state);
+ }
+
+ if (isIconRendered(attrIconExpandedValue)) {
+ encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix + "-inact", state);
+ }
- writer.endElement(TD_ELEM);
+ writer.endElement(TD_ELEM);
+ }
}
@Override
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-26 14:38:58 UTC (rev 21233)
@@ -66,16 +66,25 @@
public static final String BEFORE_SWITCH = "beforeswitch";
private final TableIconsRendererHelper<AbstractCollapsiblePanel> headerRenderer = new TableIconsRendererHelper<AbstractCollapsiblePanel>("header", "rf-cp") {
-
+
protected void encodeHeaderLeftIcon(ResponseWriter writer, FacesContext context, AbstractCollapsiblePanel panel) throws IOException {
+ String leftIconCollapsed = panel.getLeftIconCollapsed();
+ if (leftIconCollapsed == null || leftIconCollapsed.trim().length() == 0) {
+ leftIconCollapsed = PanelIcons.chevronUp.toString();
+ }
+ String leftIconExpanded = panel.getLeftIconExpanded();
+ if (leftIconExpanded == null || leftIconExpanded.trim().length() == 0) {
+ leftIconExpanded = PanelIcons.chevronDown.toString();
+ }
+
encodeTdIcon(writer, context, cssClassPrefix + "-ico",
- panel.getLeftIconCollapsed(), panel.getLeftIconExpanded(), PanelIcons.State.header);
+ leftIconCollapsed, leftIconExpanded, PanelIcons.State.header);
}
protected void encodeHeaderRightIcon(ResponseWriter writer, FacesContext context, AbstractCollapsiblePanel panel) throws IOException {
//TODO nick - should this be "-ico-exp"? also why expanded icon state is connected with right icon alignment?
encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico",
- panel.getRightIconCollapsed(), panel.getRightIconExpanded(), PanelIcons.State.header);
+ panel.getRightIconCollapsed(), panel.getRightIconExpanded(), PanelIcons.State.header);
}
@Override
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java 2011-01-26 14:38:58 UTC (rev 21233)
@@ -27,6 +27,14 @@
String iconCollapsed = group.isDisabled() ? group.getLeftIconDisabled() : group.getLeftIconCollapsed();
String iconExpanded = group.isDisabled() ? group.getLeftIconDisabled() : group.getLeftIconExpanded();
+ if (iconCollapsed == null || iconCollapsed.trim().length() == 0) {
+ iconCollapsed = PanelIcons.transparent.toString();
+ }
+
+ if (iconExpanded == null || iconExpanded.trim().length() == 0) {
+ iconExpanded = PanelIcons.transparent.toString();
+ }
+
encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconCollapsed, iconExpanded, getState(group));
}
@@ -34,6 +42,13 @@
String iconCollapsed = group.isDisabled() ? group.getRightIconDisabled() : group.getRightIconCollapsed();
String iconExpanded = group.isDisabled() ? group.getRightIconDisabled() : group.getRightIconExpanded();
+ if (iconCollapsed == null || iconCollapsed.trim().length() == 0) {
+ iconCollapsed = PanelIcons.transparent.toString();
+ }
+
+ if (iconExpanded == null || iconExpanded.trim().length() == 0) {
+ iconExpanded = PanelIcons.transparent.toString();
+ }
//TODO nick - should this be "-ico-exp"? also why expanded icon state is connected with right icon alignment?
encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico", iconCollapsed, iconExpanded, getState(group));
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2011-01-26 14:38:58 UTC (rev 21233)
@@ -103,6 +103,9 @@
String icon = menuItem.isDisabled() ? menuItem.getRightIconDisabled() : menuItem.getRightIcon();
String cssClasses = concatClasses(classPrefix + "-exp-ico", menuItem.getLeftIconClass());
+ if (icon == null || icon.trim().length() == 0) {
+ icon = PanelIcons.transparent.toString();
+ }
encodeTdIcon(writer, context, cssClasses, icon, getState(menuItem));
}
@@ -110,11 +113,26 @@
String icon = menuItem.isDisabled() ? menuItem.getLeftIconDisabled() : menuItem.getLeftIcon();
String cssClasses = concatClasses(classPrefix + "-ico", menuItem.getLeftIconClass());
+ if (icon == null || icon.trim().length() == 0) {
+ icon = PanelIcons.transparent.toString();
+ }
encodeTdIcon(writer, context, cssClasses, icon, getState(menuItem));
}
-
+
+ private boolean isIconRendered(String attrIconValue) {
+ if (attrIconValue != null && attrIconValue.trim().length() > 0 &&
+ !PanelIcons.none.toString().equals(attrIconValue)) {
+ return true;
+ }
+ return false;
+ }
+
//TODO nick - the same as in PanelMenuGroupRenderer
public void encodeTdIcon(ResponseWriter writer, FacesContext context, String classPrefix, String attrIconValue, PanelIcons.State state) throws IOException {
+ if (!isIconRendered(attrIconValue)) {
+ return;
+ }
+
writer.startElement(TD_ELEM, null);
try {
PanelIcons icon = PanelIcons.valueOf(attrIconValue);
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java 2011-01-26 14:38:58 UTC (rev 21233)
@@ -84,15 +84,31 @@
protected abstract void encodeHeaderRightIcon(ResponseWriter writer, FacesContext context, T menuItem) throws IOException;
protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String cssClass, String attrIconCollapsedValue, String attrIconExpandedValue, PanelIcons.State state) throws IOException {
- writer.startElement(TD_ELEM, null);
- writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
+ if (isIconRendered(attrIconCollapsedValue) ||
+ isIconRendered(attrIconExpandedValue)) {
- encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix + "-colps", state);
- encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix + "-exp", state);
+ writer.startElement(TD_ELEM, null);
+ writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
+
+ if (isIconRendered(attrIconCollapsedValue)) {
+ encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix + "-colps", state);
+ }
+ if (isIconRendered(attrIconExpandedValue)) {
+ encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix + "-exp", state);
+ }
+
+ writer.endElement(TD_ELEM);
+ }
+ }
- writer.endElement(TD_ELEM);
+ protected boolean isIconRendered(String attrIconValue) {
+ if (attrIconValue != null && attrIconValue.trim().length() > 0 &&
+ !PanelIcons.none.toString().equals(attrIconValue)) {
+ return true;
+ }
+ return false;
}
-
+
protected void encodeIdIcon(ResponseWriter writer, FacesContext context, String attrIconValue, String styleClass, PanelIcons.State state) throws IOException {
if (attrIconValue == null || attrIconValue.trim().length() <= 0) {
encodeDivIcon(writer, PanelIcons.none, styleClass, state);
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/accordionItem.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/accordionItem.xmlunit.xml 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/accordionItem.xmlunit.xml 2011-01-26 14:38:58 UTC (rev 21233)
@@ -3,18 +3,10 @@
<table class="rf-ac-itm-gr">
<tbody>
<tr>
- <td class="rf-ac-itm-ico">
- <div class="rf-ac-itm-ico-act rf-ico-none"></div>
- <div class="rf-ac-itm-ico-inact rf-ico-none"></div>
- </td>
<td class="rf-ac-itm-lbl">
<div class="rf-ac-itm-lbl-act">item</div>
<div class="rf-ac-itm-lbl-inact">item</div>
</td>
- <td class="rf-ac-itm-exp-ico">
- <div class="rf-ac-itm-ico-act rf-ico-none-hdr"></div>
- <div class="rf-ac-itm-ico-inact rf-ico-none-hdr"></div>
- </td>
</tr>
</tbody>
</table>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml 2011-01-26 14:38:58 UTC (rev 21233)
@@ -8,17 +8,13 @@
<tbody>
<tr>
<td class="rf-cp-ico">
- <div class="rf-cp-ico-colps rf-ico-none-hdr"></div>
- <div class="rf-cp-ico-exp rf-ico-none-hdr"></div>
+ <div class="rf-cp-ico-colps rf-ico-chevron-up-hdr"></div>
+ <div class="rf-cp-ico-exp rf-ico-chevron-down-hdr"></div>
</td>
<td class="rf-cp-lbl">
<div class="rf-cp-lbl-exp"></div>
<div class="rf-cp-lbl-colps"></div>
</td>
- <td class="rf-cp-exp-ico">
- <div class="rf-cp-ico-colps rf-ico-none-hdr"></div>
- <div class="rf-cp-ico-exp rf-ico-none-hdr"></div>
- </td>
</tr>
</tbody>
</table>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml 2011-01-26 14:38:58 UTC (rev 21233)
@@ -5,13 +5,13 @@
<tbody>
<tr>
<td class="rf-pm-gr-ico">
- <div class="rf-pm-ico-colps rf-ico-none"></div>
- <div class="rf-pm-ico-exp rf-ico-none"></div>
+ <div class="rf-pm-ico-colps rf-ico-transparent"></div>
+ <div class="rf-pm-ico-exp rf-ico-transparent"></div>
</td>
<td class="rf-pm-gr-lbl">Group Label</td>
<td class="rf-pm-gr-exp-ico">
- <div class="rf-pm-ico-colps rf-ico-none"></div>
- <div class="rf-pm-ico-exp rf-ico-none"></div>
+ <div class="rf-pm-ico-colps rf-ico-transparent"></div>
+ <div class="rf-pm-ico-exp rf-ico-transparent"></div>
</td>
</tr>
</tbody>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml 2011-01-26 14:38:58 UTC (rev 21233)
@@ -5,13 +5,13 @@
<tbody>
<tr>
<td class="rf-pm-top-gr-ico">
- <div class="rf-pm-ico-colps rf-ico-none-hdr"></div>
- <div class="rf-pm-ico-exp rf-ico-none-hdr"></div>
+ <div class="rf-pm-ico-colps rf-ico-transparent-hdr"></div>
+ <div class="rf-pm-ico-exp rf-ico-transparent-hdr"></div>
</td>
<td class="rf-pm-top-gr-lbl">Group Label</td>
<td class="rf-pm-top-gr-exp-ico">
- <div class="rf-pm-ico-colps rf-ico-none-hdr"></div>
- <div class="rf-pm-ico-exp rf-ico-none-hdr"></div>
+ <div class="rf-pm-ico-colps rf-ico-transparent-hdr"></div>
+ <div class="rf-pm-ico-exp rf-ico-transparent-hdr"></div>
</td>
</tr>
</tbody>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml 2011-01-26 14:38:58 UTC (rev 21233)
@@ -5,13 +5,13 @@
<tbody>
<tr>
<td class="rf-pm-gr-ico">
- <div class="rf-pm-ico-colps rf-ico-none"></div>
- <div class="rf-pm-ico-exp rf-ico-none"></div>
+ <div class="rf-pm-ico-colps rf-ico-transparent"></div>
+ <div class="rf-pm-ico-exp rf-ico-transparent"></div>
</td>
<td class="rf-pm-gr-lbl"></td>
<td class="rf-pm-gr-exp-ico">
- <div class="rf-pm-ico-colps rf-ico-none"></div>
- <div class="rf-pm-ico-exp rf-ico-none"></div>
+ <div class="rf-pm-ico-colps rf-ico-transparent"></div>
+ <div class="rf-pm-ico-exp rf-ico-transparent"></div>
</td>
</tr>
</tbody>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml 2011-01-26 13:29:40 UTC (rev 21232)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml 2011-01-26 14:38:58 UTC (rev 21233)
@@ -2,9 +2,9 @@
<table class="rf-pm-itm-gr">
<tbody>
<tr>
- <td class="rf-pm-itm-ico rf-ico-none"></td>
+ <td class="rf-pm-itm-ico rf-ico-transparent"></td>
<td class="rf-pm-itm-lbl">My MY Item</td>
- <td class="rf-pm-itm-exp-ico rf-ico-none"></td>
+ <td class="rf-pm-itm-exp-ico rf-ico-transparent"></td>
</tr>
</tbody>
</table>
13 years, 11 months
JBoss Rich Faces SVN: r21232 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richTabPanel and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-26 08:29:40 -0500 (Wed, 26 Jan 2011)
New Revision: 21232
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordion/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
Log:
* onbegin, onbeforedomupdate and oncomplete added to panel samples
* testData fixed
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordion/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordion/simple.xhtml 2011-01-26 12:23:50 UTC (rev 21231)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordion/simple.xhtml 2011-01-26 13:29:40 UTC (rev 21232)
@@ -63,8 +63,11 @@
itemRightIconInactive="#{richAccordionBean.attributes['itemRightIconInactive'].value}"
lang="#{richAccordionBean.attributes['lang'].value}"
limitRender="#{richAccordionBean.attributes['limitRender'].value}"
+ onbeforedomupdate="#{richAccordionBean.attributes['onbeforedomupdate'].value}"
onbeforeitemchange="#{richAccordionBean.attributes['onbeforeitemchange'].value}"
+ onbegin="#{richAccordionBean.attributes['onbegin'].value}"
onclick="#{richAccordionBean.attributes['onclick'].value}"
+ oncomplete="#{richAccordionBean.attributes['oncomplete'].value}"
ondblclick="#{richAccordionBean.attributes['ondblclick'].value}"
onitemchange="#{richAccordionBean.attributes['onitemchange'].value}"
onmousedown="#{richAccordionBean.attributes['onmousedown'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml 2011-01-26 12:23:50 UTC (rev 21231)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml 2011-01-26 13:29:40 UTC (rev 21232)
@@ -53,8 +53,11 @@
itemChangeListener="#{richBean.itemChangeListener}"
lang="#{richTabPanelBean.attributes['lang'].value}"
limitRender="#{richTabPanelBean.attributes['limitRender'].value}"
+ onbeforedomupdate="#{richTabPanelBean.attributes['onbeforedomupdate'].value}"
onbeforeitemchange="#{richTabPanelBean.attributes['onbeforeitemchange'].value}"
+ onbegin="#{richTabPanelBean.attributes['onbegin'].value}"
onclick="#{richTabPanelBean.attributes['onclick'].value}"
+ oncomplete="#{richTabPanelBean.attributes['oncomplete'].value}"
ondblclick="#{richTabPanelBean.attributes['ondblclick'].value}"
onitemchange="#{richTabPanelBean.attributes['onitemchange'].value}"
onmousedown="#{richTabPanelBean.attributes['onmousedown'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml 2011-01-26 12:23:50 UTC (rev 21231)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml 2011-01-26 13:29:40 UTC (rev 21232)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
@@ -89,8 +89,11 @@
itemChangeListener="#{richBean.itemChangeListener}"
lang="#{richTogglePanelBean.attributes['lang'].value}"
limitRender="#{richTogglePanelBean.attributes['limitRender'].value}"
+ onbeforedomupdate="#{richTogglePanelBean.attributes['onbeforedomupdate'].value}"
onbeforeitemchange="#{richTogglePanelBean.attributes['onbeforeitemchange'].value}"
+ onbegin="#{richTogglePanelBean.attributes['onbegin'].value}"
onclick="#{richTogglePanelBean.attributes['onclick'].value}"
+ oncomplete="#{richTogglePanelBean.attributes['oncomplete'].value}"
ondblclick="#{richTogglePanelBean.attributes['ondblclick'].value}"
onitemchange="#{richTogglePanelBean.attributes['onitemchange'].value}"
onmousedown="#{richTogglePanelBean.attributes['onmousedown'].value}"
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2011-01-26 12:23:50 UTC (rev 21231)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2011-01-26 13:29:40 UTC (rev 21232)
@@ -214,7 +214,7 @@
selenium.type(pjq("input[type=text][id$=dataInput]"), "RichFaces 4");
selenium.waitForPageToLoad();
- selenium.type(pjq("input[type=text][id$=onitemchangeInput]"), "data = event.data");
+ selenium.type(pjq("input[type=text][id$=oncompleteInput]"), "data = event.data");
selenium.waitForPageToLoad();
guardXhr(selenium).click(itemHeaders[2]);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-01-26 12:23:50 UTC (rev 21231)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-01-26 13:29:40 UTC (rev 21232)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -221,7 +221,7 @@
selenium.type(pjq("input[type=text][id$=dataInput]"), "RichFaces 4");
selenium.waitForPageToLoad();
- selenium.type(pjq("input[type=text][id$=onitemchangeInput]"), "data = event.data");
+ selenium.type(pjq("input[type=text][id$=oncompleteInput]"), "data = event.data");
selenium.waitForPageToLoad();
guardXhr(selenium).click(inactiveHeaders[2]);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2011-01-26 12:23:50 UTC (rev 21231)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2011-01-26 13:29:40 UTC (rev 21232)
@@ -285,7 +285,7 @@
selenium.type(pjq("input[type=text][id$=dataInput]"), "RichFaces 4");
selenium.waitForPageToLoad();
- selenium.type(pjq("input[type=text][id$=onitemchangeInput]"), "data = event.data");
+ selenium.type(pjq("input[type=text][id$=oncompleteInput]"), "data = event.data");
selenium.waitForPageToLoad();
guardXhr(selenium).click(tc3);
13 years, 11 months
JBoss Rich Faces SVN: r21231 - trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2011-01-26 07:23:50 -0500 (Wed, 26 Jan 2011)
New Revision: 21231
Modified:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml
Log:
RF-9559: unit test AutocompleteRendererTest is fixed
Modified: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml 2011-01-26 12:18:17 UTC (rev 21230)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml 2011-01-26 12:23:50 UTC (rev 21231)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<div class="rf-au-fld" id="form:myAutocomplete">
- <input class="rf-au-fnt rf-au-inp" id="form:myAutocompleteValue" name="form:myAutocompleteValue" type="hidden"/>
- <div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
+ <input id="form:myAutocompleteValue" name="form:myAutocompleteValue" type="hidden"/>
+ <div class="rf-au-fld-btn">
<input autocomplete="off" class="rf-au-fnt rf-au-inp" id="form:myAutocompleteInput" name="form:myAutocomplete" type="text"/>
<div class="rf-au-btn" id="form:myAutocompleteButton">
<div class="rf-au-btn-arrow">
Modified: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml 2011-01-26 12:18:17 UTC (rev 21230)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml 2011-01-26 12:23:50 UTC (rev 21231)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<div class="rf-au-fld" id="form:myAutocomplete">
- <input class="rf-au-fnt rf-au-inp" id="form:myAutocompleteValue" name="form:myAutocompleteValue" type="hidden"/>
- <div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
+ <input id="form:myAutocompleteValue" name="form:myAutocompleteValue" type="hidden"/>
+ <div class="rf-au-fld-btn">
<input autocomplete="off" class="rf-au-fnt rf-au-inp" id="form:myAutocompleteInput" name="form:myAutocomplete" type="text"/>
<div class="rf-au-btn" id="form:myAutocompleteButton">
<div class="rf-au-btn-arrow">
13 years, 11 months
JBoss Rich Faces SVN: r21230 - management/design-4x/dataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: Ochikvina
Date: 2011-01-26 07:18:17 -0500 (Wed, 26 Jan 2011)
New Revision: 21230
Modified:
management/design-4x/dataScroller/dataScroller.html
Log:
Added hovering for the left(right)most buttons.
Modified: management/design-4x/dataScroller/dataScroller.html
===================================================================
--- management/design-4x/dataScroller/dataScroller.html 2011-01-26 09:11:23 UTC (rev 21229)
+++ management/design-4x/dataScroller/dataScroller.html 2011-01-26 12:18:17 UTC (rev 21230)
@@ -12,6 +12,9 @@
.ds_right{ margin-left : 1px;}
.ds_digital{ text-decoration : none; cursor : pointer; width : 2em; text-align : center; margin-left : 1px; margin-right : 1px; padding : 2px 2px 3px 2px; border : 1px solid transparent; border-top : 1px solid #A6A6A6/*tableBorderColor*/; background : url(images/bg_field.png) top left repeat-x/*gradient - from additionalBackgroundColor to tableBackgroundColor, background-color - tableBackgroundColor*/; display : inline-block; font-size : 11px/*generalSizeFont*/; font-family : verdana/*generalFamilyFont*/; color : #000000/*generalTextColor*/;}
.ds_over{ border : 1px solid #A6A6A6/*tableBorderColor*/; background : url(images/bg_field.png) top left repeat-x #FFFFFF; /*gradient - from additionalBackgroundColor to tableBackgroundColor, background-color - tableBackgroundColor*/;}
+.ds_but_over{
+ color:#ffffff;
+}
.ds_press{ border : 1px solid #A6A6A6/*tableBorderColor*/; background : #ECF3FA; /*background-color - additionalBackgroundColor*/;}
.ds_current{ cursor : default; font-weight : bold; border : 1px solid transparent; border-bottom : 1px solid #A6A6A6/*tableBorderColor*/; background : none;}
.ds_disabled{ color : #A6A6A6/*tableBorderColor*/; cursor : default;}
@@ -59,10 +62,10 @@
class="ds_digital ds_disabled">
10
</a><a href="#"
- class="ds_button ds_right" onmousedown="this.className='ds_button ds_right ds_over'" onmouseup="this.className='ds_button ds_right'" onmouseout="this.className='ds_button ds_right'">
+ class="ds_button ds_right" onmouseover="this.className='ds_button ds_right ds_but_over'" onmousedown="this.className='ds_button ds_right ds_over'" onmouseup="this.className='ds_button ds_right'" onmouseout="this.className='ds_button ds_right'">
»
</a><a href="#"
- class="ds_button ds_right" onmousedown="this.className='ds_button ds_right ds_over'" onmouseup="this.className='ds_button ds_right'" onmouseout="this.className='ds_button ds_right'">
+ class="ds_button ds_right" onmouseover="this.className='ds_button ds_right ds_but_over'" onmousedown="this.className='ds_button ds_right ds_over'" onmouseup="this.className='ds_button ds_right'" onmouseout="this.className='ds_button ds_right'">
»»
</a>
</span>
13 years, 11 months
JBoss Rich Faces SVN: r21229 - in trunk/examples/richfaces-showcase/src/main/webapp: images/dnd and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-26 04:11:23 -0500 (Wed, 26 Jan 2011)
New Revision: 21229
Added:
trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/
trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/accept.gif
trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/default.gif
trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/reject.gif
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragIndicator-sample.xhtml
Log:
dnd indicator updated.
Added: trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/accept.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/accept.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/default.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/default.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/reject.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/richfaces-showcase/src/main/webapp/images/dnd/reject.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-01-26 08:52:22 UTC (rev 21228)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-01-26 09:11:23 UTC (rev 21229)
@@ -83,9 +83,6 @@
<rich:popupPanel header="Edit Car Details" id="editPane">
<h:form>
- <a4j:outputPanel ajaxRendered="true">
- <h:messages />
- </a4j:outputPanel>
<h:panelGrid columns="3" id="editGrid">
<h:outputText value="Vendor" />
<h:outputText value="#{carsBean.editedCar.vendor}" />
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragIndicator-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragIndicator-sample.xhtml 2011-01-26 08:52:22 UTC (rev 21228)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragIndicator-sample.xhtml 2011-01-26 09:11:23 UTC (rev 21229)
@@ -6,7 +6,7 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
- <h:outputStylesheet>
+ <style>
.panelc { width:25%; }
.valign { vertical-align:top; }
.dropTargetPanel { width: 90%; }
@@ -22,9 +22,25 @@
border:1px solid gray;
padding:2px
}
- .accept{border:2px solid green}
- .reject{border:2px solid red}
- </h:outputStylesheet>
+ .rf-ind-drag.default{
+ padding-left:30px;
+ background-image: url("#{facesContext.externalContext.requestContextPath}/images/dnd/default.gif");
+ background-position: 5px;
+ background-repeat: no-repeat;
+ }
+ .accept{
+ background-image: url("#{facesContext.externalContext.requestContextPath}/images/dnd/accept.gif");
+ background-position: 5px;
+ background-repeat: no-repeat;
+ border:2px solid green
+ }
+ .reject{
+ border:2px solid red;
+ background-image: url("#{facesContext.externalContext.requestContextPath}/images/dnd/reject.gif");
+ background-position: 5px;
+ background-repeat: no-repeat;
+ }
+ </style>
<rich:dragIndicator id="ind" acceptClass="accept" rejectClass="reject" draggingClass="default">
Drag the item to proper area..
</rich:dragIndicator>
13 years, 11 months
JBoss Rich Faces SVN: r21228 - trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-26 03:52:22 -0500 (Wed, 26 Jan 2011)
New Revision: 21228
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
indicator sample
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-26 08:51:35 UTC (rev 21227)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-26 08:52:22 UTC (rev 21228)
@@ -574,6 +574,10 @@
<id>dragDrop</id>
<name>Drag and Drop usage example</name>
</sample>
+ <sample new="true">
+ <id>dragIndicator</id>
+ <name>Drag Indicator usage example</name>
+ </sample>
</samples>
</demo>
</demos>
@@ -620,7 +624,7 @@
<name>Passing hash options to rich:popupPanel</name>
</sample>
</samples>
- </demo>
+ </demo>
<demo>
<id>jquery</id>
<name>rich:jQuery</name>
13 years, 11 months
JBoss Rich Faces SVN: r21227 - in trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop: samples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-26 03:51:35 -0500 (Wed, 26 Jan 2011)
New Revision: 21227
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/dragIndicator.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragIndicator-sample.xhtml
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/dragDrop.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragDrop-sample.xhtml
Log:
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/dragDrop.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/dragDrop.xhtml 2011-01-26 00:52:53 UTC (rev 21226)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/dragDrop.xhtml 2011-01-26 08:51:35 UTC (rev 21227)
@@ -8,6 +8,21 @@
<p>The Richfaces Drag-n-Drop component suite includes three
components: <b>dragSource</b>, <b>dropTarget </b>and <b>dragIndicator</b>.</p>
+ <p>That demo shows most important feature of the RichFaces drag and
+ drop mechanism. You could mark several different components as
+ 'draggable' and define different drag <b>type</b>'s for them via
+ attribute. Then you could add corresponding drop zones and use <b>acceptType</b>'s
+ attributes to define which drop zone will process corresponding dragged
+ elements.</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+
<p><b>rich:dragSource </b>is used to point to the JSF component
that becomes draggable. If you want to add a draggable feature to the
existing component, attach dragSupport as a child component to it.</p>
@@ -22,9 +37,12 @@
dragSupport.</p>
<p><b>rich:dragIndicator</b> is a special visual representation of
- a dragged object. By default it creates a copy of dragged elements. But
- the markup could be redefined(<u>not implemented in first release</u>).</p>
-
+ a dragged object. By default if the component not defined we create a
+ copy of dragged elements. But the markup could be redefined by defining
+ the markup of the indicator using nested components.</p>
+ <fieldset><legend>Note:</legend> That sample shows simple
+ usage without indicator defined. We just using predefined CSS classes
+ to customize look for different states.</fieldset>
<p>Note: The parent component for dragSupport and dropSupport
should be designed to render its children and has two attribute
"onmouseover" and "onmouseout". You can use <a4j:outputPanel> as
@@ -38,18 +56,5 @@
over the headers of three panels. If the draggable framework is
suitable for a certain framework family, it will be accepted and moved
from source panel to the target list.</p>
- <ui:include src="#{demoNavigator.sampleIncludeURI}" />
- <ui:include src="/templates/includes/source-view.xhtml">
- <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
- <ui:param name="sourceType" value="xhtml" />
- <ui:param name="openLabel" value="View Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
- <p>That demo shows most important feature of the RichFaces drag and
- drop mechanism. You could mark several different components as
- 'draggable' and define different drag <b>type</b>'s for them via
- attribute. Then you could add corresponding drop zones and use <b>acceptType</b>'s
- attributes to define which drop zone will process corresponding dragged
- elements.</p>
</ui:composition>
</html>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/dragIndicator.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/dragIndicator.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/dragIndicator.xhtml 2011-01-26 08:51:35 UTC (rev 21227)
@@ -0,0 +1,20 @@
+<!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">
+
+<ui:composition>
+ <p>This sample uses the same code but also there is custom
+ indicator defined. That custom indicator uses styling attributes for look customization.
+ However it's still possible to use the same predefined classes as for
+ previous sample.'</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragDrop-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragDrop-sample.xhtml 2011-01-26 00:52:53 UTC (rev 21226)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragDrop-sample.xhtml 2011-01-26 08:51:35 UTC (rev 21227)
@@ -14,9 +14,18 @@
text-align: center;
padding-top: 5px;
}
+ .rf-ind-drag{
+ font-size:11px;
+ cursor:pointer;
+ width:100px;
+ border:1px solid gray;
+ padding:2px
+ }
+ .rf-ind-acpt{border:2px solid green}
+ .rf-ind-rejt{border:2px solid red}
</h:outputStylesheet>
<h:form id="form">
-
+
<h:panelGrid columnClasses="panelc valign, valign, valign, valign" columns="4" width="100%">
<rich:panel style="width:133px">
@@ -25,11 +34,8 @@
</f:facet>
<h:dataTable id="src" columns="1" value="#{dragDropBean.source}"
var="fm" footerClass="footerClass">
-
<h:column>
- <a4j:outputPanel
- style="width:100px;border:1px solid gray;padding:2px"
- layout="block">
+ <a4j:outputPanel layout="block" styleClass="rf-ind-drag">
<rich:dragSource type="#{fm.family}"
dragValue="#{fm}" />
<h:outputText value="#{fm.name}"></h:outputText>
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragIndicator-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragIndicator-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dragDrop/samples/dragIndicator-sample.xhtml 2011-01-26 08:51:35 UTC (rev 21227)
@@ -0,0 +1,112 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:outputStylesheet>
+ .panelc { width:25%; }
+ .valign { vertical-align:top; }
+ .dropTargetPanel { width: 90%; }
+ .footerClass {
+ text-align: center;
+ padding-top: 5px;
+ }
+
+ .default{
+ font-size:11px;
+ cursor:pointer;
+ width:100px;
+ border:1px solid gray;
+ padding:2px
+ }
+ .accept{border:2px solid green}
+ .reject{border:2px solid red}
+ </h:outputStylesheet>
+ <rich:dragIndicator id="ind" acceptClass="accept" rejectClass="reject" draggingClass="default">
+ Drag the item to proper area..
+ </rich:dragIndicator>
+ <h:form id="form">
+
+ <h:panelGrid columnClasses="panelc valign, valign, valign, valign" columns="4" width="100%">
+
+ <rich:panel style="width:133px">
+ <f:facet name="header">
+ <h:outputText value="Source List" />
+ </f:facet>
+ <h:dataTable id="src" columns="1" value="#{dragDropBean.source}"
+ var="fm" footerClass="footerClass">
+ <h:column>
+ <a4j:outputPanel layout="block" styleClass="default">
+ <rich:dragSource type="#{fm.family}" dragIndicator="ind"
+ dragValue="#{fm}" />
+ <h:outputText value="#{fm.name}"></h:outputText>
+ </a4j:outputPanel>
+ </h:column>
+ <f:facet name="footer">
+ <a4j:commandButton action="#{dragDropBean.reset}"
+ value="Start Over" render="src,phptable,cftable,dnettable" />
+ </f:facet>
+ </h:dataTable>
+ </rich:panel>
+
+ <rich:panel styleClass="dropTargetPanel">
+ <f:facet name="header">
+ <h:outputText value="PHP Frameworks" />
+ </f:facet>
+ <rich:dropTarget acceptedTypes="php" dropValue="PHP"
+ dropListener="#{dragDropEventBean.processDrop}"
+ render="phptable, src" />
+
+ <h:dataTable id="phptable" columns="1"
+ value="#{dragDropBean.targetPHP}" var="fm">
+ <h:column>
+ <h:outputText value="#{fm.name}"></h:outputText>
+ </h:column>
+ </h:dataTable>
+
+
+ </rich:panel>
+
+ <rich:panel styleClass="dropTargetPanel">
+ <f:facet name="header">
+ <h:outputText value=".NET Frameworks" />
+ </f:facet>
+ <rich:dropTarget acceptedTypes="dotNet" dropValue="DNET"
+ dropListener="#{dragDropEventBean.processDrop}"
+ render="dnettable, src" />
+
+ <h:dataTable id="dnettable" columns="1"
+ value="#{dragDropBean.targetDotNet}" var="fm">
+ <h:column>
+ <h:outputText value="#{fm.name}"></h:outputText>
+ </h:column>
+ </h:dataTable>
+
+
+ </rich:panel>
+
+ <rich:panel styleClass="dropTargetPanel">
+ <f:facet name="header">
+ <h:outputText value="ColdFusion Frameworks" />
+ </f:facet>
+ <rich:dropTarget acceptedTypes="cf" dropValue="CF"
+ dropListener="#{dragDropEventBean.processDrop}"
+ render="cftable, src" />
+
+ <h:dataTable id="cftable" columns="1"
+ value="#{dragDropBean.targetCF}" var="fm">
+ <h:column>
+ <h:outputText value="#{fm.name}"></h:outputText>
+ </h:column>
+ </h:dataTable>
+ </rich:panel>
+ </h:panelGrid>
+
+ </h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages></h:messages>
+ </a4j:outputPanel>
+</ui:composition>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r21226 - in trunk: ui/validator/ui/src/main/java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-25 19:52:53 -0500 (Tue, 25 Jan 2011)
New Revision: 21226
Added:
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/ok.png
Modified:
trunk/core/impl/src/main/resources/META-INF/skins/DEFAULT.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/NULL.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/blueSky.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/classic.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/plain.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/ruby.skin.properties
trunk/core/impl/src/main/resources/META-INF/skins/wine.skin.properties
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/msg.ecss
trunk/ui/validator/ui/src/main/templates/message.template.xml
Log:
CODING IN PROGRESS - issue RF-10064: Finish rich:message HTML design
https://issues.jboss.org/browse/RF-10064
Modified: trunk/core/impl/src/main/resources/META-INF/skins/DEFAULT.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/DEFAULT.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/DEFAULT.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -78,6 +78,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/core/impl/src/main/resources/META-INF/skins/NULL.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/NULL.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/NULL.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -72,6 +72,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/core/impl/src/main/resources/META-INF/skins/blueSky.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/blueSky.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/blueSky.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -70,6 +70,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/core/impl/src/main/resources/META-INF/skins/classic.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/classic.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/classic.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -70,6 +70,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/core/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -74,6 +74,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/core/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -71,6 +71,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/core/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -72,6 +72,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/core/impl/src/main/resources/META-INF/skins/plain.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/plain.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/plain.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -69,5 +69,7 @@
warningColor=#{null}
warningBackgroundColor=#{null}
+errorColor=#{null}
+
editorBackgroundColor=#{null}
editBackgroundColor=#{null}
\ No newline at end of file
Modified: trunk/core/impl/src/main/resources/META-INF/skins/ruby.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/ruby.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/ruby.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -69,6 +69,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/core/impl/src/main/resources/META-INF/skins/wine.skin.properties
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/skins/wine.skin.properties 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/core/impl/src/main/resources/META-INF/skins/wine.skin.properties 2011-01-26 00:52:53 UTC (rev 21226)
@@ -71,6 +71,8 @@
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
+errorColor=#FF0000
+
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java 2011-01-26 00:52:53 UTC (rev 21226)
@@ -29,6 +29,7 @@
import javax.faces.application.FacesMessage;
import javax.faces.application.FacesMessage.Severity;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIMessage;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.Renderer;
@@ -55,15 +56,10 @@
*/
public class MessageRendererBase extends Renderer {
- private static final ImmutableMap<Severity, SeverityAttributes> SEVERITY_MAP = ImmutableMap
- .of(FacesMessage.SEVERITY_INFO,
- attrs("info", "inf", null),
- FacesMessage.SEVERITY_WARN,
- attrs("warn","wrn", null),
- FacesMessage.SEVERITY_ERROR,
- attrs("error","err", null),
- FacesMessage.SEVERITY_FATAL,
- attrs("fatal","ftl",null));
+ private static final ImmutableMap<Severity, SeverityAttributes> SEVERITY_MAP = ImmutableMap.of(
+ FacesMessage.SEVERITY_INFO, attrs("info", "inf", null), FacesMessage.SEVERITY_WARN, attrs("warn", "wrn", null),
+ FacesMessage.SEVERITY_ERROR, attrs("error", "err", null), FacesMessage.SEVERITY_FATAL,
+ attrs("fatal", "ftl", null));
protected Iterator<FacesMessage> getMessages(FacesContext context, String forClientId, UIComponent component) {
@@ -92,7 +88,10 @@
}
/**
- * <p class="changed_added_4_0">TODO - make Generator aware of Iterator.</p>
+ * <p class="changed_added_4_0">
+ * TODO - make Generator aware of Iterator.
+ * </p>
+ *
* @param context
* @param component
* @return
@@ -126,54 +125,81 @@
protected void encodeMessage(FacesContext facesContext, UIComponent component, Object msg) throws IOException {
// TODO fix generator to properly detect iteration variable type
FacesMessage message = (FacesMessage) msg;
+ UIMessage uiMessage = (UIMessage) component;
ResponseWriter responseWriter = facesContext.getResponseWriter();
- responseWriter.writeText(message.getSummary(),"value");
+ // tooltip
+ boolean wroteTooltip = Boolean.TRUE.equals(uiMessage.getAttributes().get("tooltip"));
+ String summary = message.getSummary();
+ if(wroteTooltip && !Strings.isNullOrEmpty(summary)){
+ responseWriter.writeAttribute("title", summary,null);
+ }
+ if (!wroteTooltip && uiMessage.isShowSummary()) {
+ writeMessageLabel(responseWriter, summary, "rf-msg-sum");
+ }
+ if (uiMessage.isShowDetail()) {
+ writeMessageLabel(responseWriter, message.getDetail(), "rf-msg-des");
+ }
}
+ private void writeMessageLabel(ResponseWriter responseWriter, String label, String styleClass) throws IOException {
+ if (!Strings.isNullOrEmpty(label)) {
+ responseWriter.startElement("span", null);
+ responseWriter.writeAttribute("class", styleClass, null);
+ responseWriter.writeText(label, null);
+ responseWriter.endElement("span");
+ }
+ }
+
protected void encodeScript(FacesContext facesContext, UIComponent component) throws IOException {
JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
JSFunction messageObject = new JSObject("RichFaces.ui.Message", component.getClientId(facesContext));
String forId = (String) component.getAttributes().get("for");
- if(!Strings.isNullOrEmpty(forId)){
+ if (!Strings.isNullOrEmpty(forId)) {
UIComponent target = RendererUtils.getInstance().findComponentFor(component, forId);
- if(null != target){
- messageObject.addParameter(ImmutableMap.<String, String>of("forComponentId",target.getClientId(facesContext)));
+ if (null != target) {
+ messageObject.addParameter(ImmutableMap.<String, String> of("forComponentId",
+ target.getClientId(facesContext)));
}
}
-// RendererUtils.getInstance().writeScript(facesContext, component, messageObject);
+ // RendererUtils.getInstance().writeScript(facesContext, component, messageObject);
javaScriptService.addPageReadyScript(facesContext, messageObject);
}
-
- protected String getMsgClass(FacesContext facesContext, UIComponent component, Object msg) throws IOException{
+
+ protected String getMsgClass(FacesContext facesContext, UIComponent component, Object msg) throws IOException {
FacesMessage message = (FacesMessage) msg;
SeverityAttributes severityAttributes = SEVERITY_MAP.get(message.getSeverity());
- String styleClass = buildSeverityAttribute(component, severityAttributes.skinClass, severityAttributes.classAttribute, ' ');
+ String styleClass =
+ buildSeverityAttribute(component, severityAttributes.skinClass, severityAttributes.classAttribute, ' ');
return styleClass;
}
-
- protected String getMsgStyle(FacesContext facesContext, UIComponent component, Object msg) throws IOException{
+
+ protected String getMsgStyle(FacesContext facesContext, UIComponent component, Object msg) throws IOException {
FacesMessage message = (FacesMessage) msg;
SeverityAttributes severityAttributes = SEVERITY_MAP.get(message.getSeverity());
- String style = buildSeverityAttribute(component, severityAttributes.skinStyle, severityAttributes.styleAttribute, ';');
+ String style =
+ buildSeverityAttribute(component, severityAttributes.skinStyle, severityAttributes.styleAttribute, ';');
return style;
}
private String buildSeverityAttribute(UIComponent component, String skinValue, String attrName, char delimiter) {
StringBuilder style = new StringBuilder();
- if(null != skinValue){
- style.append(skinValue).append(delimiter);
+ if (!Strings.isNullOrEmpty(skinValue)) {
+ style.append(skinValue);
}
Object componentStyle = component.getAttributes().get(attrName);
- if(null != componentStyle){
+ if (null != componentStyle && !Strings.isNullOrEmpty(componentStyle.toString())) {
+ if (!Strings.isNullOrEmpty(skinValue)) {
+ style.append(delimiter);
+ }
style.append(componentStyle);
}
return style.toString();
}
- static SeverityAttributes attrs(String attPrefix, String skinSuffix,String skinStyle) {
+ static SeverityAttributes attrs(String attPrefix, String skinSuffix, String skinStyle) {
SeverityAttributes attrs =
- new SeverityAttributes(attPrefix+"Style", attPrefix+"Class", "rf-msg-"+skinSuffix, skinStyle,
- null, null);
+ new SeverityAttributes(attPrefix + "Style", attPrefix + "Class", "rf-msg-" + skinSuffix, skinStyle, null,
+ null);
return attrs;
}
Modified: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/msg.ecss
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/msg.ecss 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/msg.ecss 2011-01-26 00:52:53 UTC (rev 21226)
@@ -1,14 +1,46 @@
+ /*--- RF Message styles ---*/
.rf-msg {
+ font-family:'#{richSkin.generalFamilyFont}';/*generalFamilyFont*/
+ font-size:'#{richSkin.generalSizeFont}';/*generalSizeFont*/
+ height:18ex;
+ }
+ /* all messages */
+.rf-msg-err, rf-msg-ftl, rf-msg-inf, rf-msg-wrn {
+ display:inline-block;
+ padding-right:2px;
+ padding-left:20px;
+ vertical-align:middle;
+ background-repeat:no-repeat;
+ background-position:left center ;
}
+
.rf-msg-err {
- list-style-image: url(#{resource['org.richfaces:error.png']});
+ background-image: url(#{resource['org.richfaces:error.png']});
+ color:'#{richSkin.errorColor}';
}
.rf-msg-ftl {
- list-style-image: url(#{resource['org.richfaces:error.png']});
+ background-image: url(#{resource['org.richfaces:fatal.png']});
+ color:'#{richSkin.errorColor}';
}
.rf-msg-inf {
- list-style-image: url(#{resource['org.richfaces:error.png']});
+ background-image: url(#{resource['org.richfaces:info.png']});
+ color:'#{richSkin.generalTextColor}';
}
-.rf-msg-ftl {
- list-style-image: url(#{resource['org.richfaces:error.png']});
-}
\ No newline at end of file
+.rf-msg-wrn {
+ background-image: url(#{resource['org.richfaces:warning.png']});
+ color:'#{richSkin.warningColor}';
+}
+.rf-msg-ok {
+ background-image: url(#{resource['org.richfaces:ok.png']});
+ color:'#{richSkin.generalTextColor}';
+ width:20px;
+ display:inline-block;
+ vertical-align:middle;
+ background-repeat:no-repeat;
+ background-position:left center ;
+}
+
+.rf-msg-sum{ /*Summary*/
+}
+.rf-msg-des{ /*Description*/
+}
Added: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/ok.png
===================================================================
(Binary files differ)
Property changes on: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/ok.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/ui/validator/ui/src/main/templates/message.template.xml
===================================================================
--- trunk/ui/validator/ui/src/main/templates/message.template.xml 2011-01-25 19:14:02 UTC (rev 21225)
+++ trunk/ui/validator/ui/src/main/templates/message.template.xml 2011-01-26 00:52:53 UTC (rev 21226)
@@ -20,19 +20,21 @@
<cdk:superclass>org.richfaces.renderkit.MessageRendererBase</cdk:superclass>
<cdk:component-family>javax.faces.Message</cdk:component-family>
<cdk:renderer-type>org.richfaces.MessageRenderer</cdk:renderer-type>
+ <cdk:resource-dependency library="org.richfaces"
+ name="msg.ecss" />
<cdk:resource-dependency library="org.richfaces"
name="message.reslib" />
</cc:interface>
<cc:implementation>
- <ul id="#{clientId}" class="rf-msg #{component.attributes['styleClass']}"
+ <span id="#{clientId}" class="rf-msg #{component.attributes['styleClass']}"
cdk:passThroughWithExclusions="id class">
<c:forEach var="msg"
items="#{getVisibleMessages(facesContext,component)}">
- <li class="#{getMsgClass(facesContext,component,msg)}" style="#{getMsgStyle(facesContext,component,msg)}">
+ <span class="#{getMsgClass(facesContext,component,msg)}" style="#{getMsgStyle(facesContext,component,msg)}">
<cdk:call>encodeMessage(facesContext,component,msg)</cdk:call>
- </li>
+ </span>
</c:forEach>
<cdk:call>encodeScript(facesContext,component)</cdk:call>
- </ul>
+ </span>
</cc:implementation>
</cdk:root>
13 years, 11 months