JBoss Rich Faces SVN: r15532 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: java/org/jboss/richfaces/integrationTest/modalPanel and 15 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2009-09-10 11:46:40 -0400 (Thu, 10 Sep 2009)
New Revision: 15532
Added:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/messages.properties
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/listShuttle/ListShuttleTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/modalPanel/ModalPanelTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/orderingList/OrderingListTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panel/PanelCustomizationTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panel/PanelTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelBar/PanelBarTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelMenu/PanelMenuTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/pickList/PickListTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/spinner/SpinnerTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/modalPanel/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/modalPanel/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/paint2d/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panel/messages.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/messages.properties
Log:
* ListShuttleTestCase, ModalPanelTestCase, OrderingListTestCase, Paint2DTestCase, PanelTestCase, PanelCustomizationTestCase, PanelBarTestCase, PanelMenuTestCase, PickListTestCase, and SpinnerTestCase refactored
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/listShuttle/ListShuttleTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/listShuttle/ListShuttleTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/listShuttle/ListShuttleTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,75 +1,83 @@
-/**
- * License Agreement.
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces
+ * 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.
*
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful,
+ * 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
+ * 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 code; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 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.jboss.richfaces.integrationTest.listShuttle;
import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
+ * Test case for list shuttle.
*
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
public class ListShuttleTestCase extends AbstractSeleniumRichfacesTestCase {
- private final String toolbar = "//fieldset[1]/div/form/table[1]/tbody/tr[1]";
- private final String leftTable = "//fieldset[1]/div/form/table[2]/tbody/tr[2]/td[1]/div/table/tbody/tr/td/div/div/table/tbody";
- private final String leftButtons = "//fieldset[1]/div/form/table[2]/tbody/tr[2]/td[2]/div";
- private final String rightTable = "//fieldset[1]/div/form/table[2]/tbody/tr[2]/td[3]/div/table/tbody/tr/td/div/div/table/tbody";
- private final String rightButtons = "//fieldset[1]/div/form/table[2]/tbody/tr[2]/td[4]/div";
+ private final String LOC_EXAMPLE_HEADER = getLoc("EXAMPLE_HEADER");
+ private final String LOC_LEFT_TABLE_LINES = getLoc("LEFT_TABLE_LINES");
+ private final String LOC_RIGHT_TABLE_LINES = getLoc("RIGHT_TABLE_LINES");
+ private final String LOC_LEFT_TABLE_LINE_1 = getLoc("LEFT_TABLE_LINE_1");
+ private final String LOC_RIGHT_TABLE_LINE_PREFORMATTED = getLoc("RIGHT_TABLE_LINE_PREFORMATTED");
+ private final String LOC_TOOLBAR_ITEMS = getLoc("TOOLBAR_ITEMS");
+ private final String LOC_TOOLBAR_ITEM_PREFORMATTED = getLoc("TOOLBAR_ITEM_PREFORMATTED");
+ private final String LOC_COPY_ALL_BUTTON = getLoc("COPY_ALL_BUTTON");
+ private final String LOC_COPY_BUTTON = getLoc("COPY_BUTTON");
+ private final String LOC_REMOVE_BUTTON = getLoc("REMOVE_BUTTON");
+ private final String LOC_REMOVE_ALL_BUTTON = getLoc("REMOVE_ALL_BUTTON");
+ private final String LOC_FIRST_BUTTON = getLoc("FIRST_BUTTON");
+ private final String LOC_UP_BUTTON = getLoc("UP_BUTTON");
+ private final String LOC_DOWN_BUTTON = getLoc("DOWN_BUTTON");
+ private final String LOC_LAST_BUTTON = getLoc("LAST_BUTTON");
+
+ /**
+ * Tests copy button. Fist it clicks on the first item in left table, checks
+ * that copy button is enabled, and clicks the button. Then it checks that
+ * one item diappeared from left table, one appeared in right table and one
+ * item appeared in toolbar.
+ */
@Test
public void testCopyButton() {
- // get the count of items in left table
- int leftCount = selenium.getXpathCount(leftTable + "/tr").intValue();
- // get the count of items in right table
- int rightCount = selenium.getXpathCount(rightTable + "/tr").intValue();
+ int leftCount = selenium.getXpathCount(LOC_LEFT_TABLE_LINES).intValue();
+ int rightCount = selenium.getXpathCount(LOC_RIGHT_TABLE_LINES).intValue();
- // click the first item in left table
- selenium.click(leftTable + "/tr[1]");
+ selenium.click(LOC_LEFT_TABLE_LINE_1);
+ assertTrue(isDisplayed(LOC_COPY_BUTTON), "Copy button should be enabled.");
- // check that the copy button is enabled
- try {
- String text = selenium.getAttribute(leftButtons + "/div[3]@style");
- assertFalse(text.contains("display: none;"), "Copy button should not have style 'display: none;'");
- } catch (Exception e) {
- // OK
- }
+ selenium.click(LOC_COPY_BUTTON);
- // click 'Copy' button
- selenium.click(leftButtons + "/div[3]");
-
- int tmpInt = selenium.getXpathCount(leftTable + "/tr").intValue();
+ int tmpInt = selenium.getXpathCount(LOC_LEFT_TABLE_LINES).intValue();
assertEquals(tmpInt, leftCount - 1, "In left table, one item should be removed.");
- tmpInt = selenium.getXpathCount(rightTable + "/tr").intValue();
+ tmpInt = selenium.getXpathCount(LOC_RIGHT_TABLE_LINES).intValue();
assertEquals(tmpInt, rightCount + 1, "In right table, one item should be added.");
// check that it was added also to the toolbar
- tmpInt = selenium.getXpathCount(toolbar + "/td[contains(@class,'rich-toolbar-item')]").intValue();
+ tmpInt = selenium.getXpathCount(LOC_TOOLBAR_ITEMS).intValue();
assertEquals(tmpInt, rightCount + 1, "Number of items in toolbar.");
}
@@ -83,67 +91,55 @@
// fail("TODO");
// }
+ /**
+ * Tests copy all button. First it checks that the button is enabled, clicks
+ * on it and verifies that all items from left table were moved to the
+ * right. Then it checks that toolbar was modified.
+ */
@Test
public void testCopyAllButton() {
- // click 'Remove All' button
- selenium.click(leftButtons + "/div[7]");
+ int leftCount = selenium.getXpathCount(LOC_LEFT_TABLE_LINES).intValue();
+ int rightCount = selenium.getXpathCount(LOC_RIGHT_TABLE_LINES).intValue();
- // get the count of items in left table
- int leftCount = selenium.getXpathCount(leftTable + "/tr").intValue();
- // get the count of items in right table
- int rightCount = selenium.getXpathCount(rightTable + "/tr").intValue();
+ assertTrue(isDisplayed(LOC_COPY_ALL_BUTTON), "Copy all button should be enabled.");
- // check that the 'Copy All' button is enabled
- try {
- String text = selenium.getAttribute(leftButtons + "/div[1]@style");
- assertFalse(text.contains("display: none;"), "Copy all button should not have style 'display: none;'");
- } catch (Exception e) {
- // OK
- }
+ selenium.click(LOC_COPY_ALL_BUTTON);
- // click 'Copy All' button
- selenium.click(leftButtons + "/div[1]");
-
- int count = selenium.getXpathCount(leftTable + "/tr").intValue();
+ int count = selenium.getXpathCount(LOC_LEFT_TABLE_LINES).intValue();
assertEquals(count, 0, "All items from left table should be removed.");
- count = selenium.getXpathCount(rightTable + "/tr").intValue();
+ count = selenium.getXpathCount(LOC_RIGHT_TABLE_LINES).intValue();
assertEquals(count, rightCount + leftCount, "All items should be added to the right table.");
// check that they were added also to the toolbar
- count = selenium.getXpathCount(toolbar + "/td[contains(@class,'rich-toolbar-item')]").intValue();
+ count = selenium.getXpathCount(LOC_TOOLBAR_ITEMS).intValue();
assertEquals(count, rightCount + leftCount, "Number of items in toolbar.");
}
+ /**
+ * Test remove button. First it clicks on the first item on the left and
+ * verifies that remove button is enabled. Then it clicks the button and
+ * verifies the count of items on the left, on the right, and in the
+ * toolbar.
+ */
@Test
public void testRemoveButton() {
- // get the count of items in left table
- int leftCount = selenium.getXpathCount(leftTable + "/tr").intValue();
- // get the count of items in right table
- int rightCount = selenium.getXpathCount(rightTable + "/tr").intValue();
+ int leftCount = selenium.getXpathCount(LOC_LEFT_TABLE_LINES).intValue();
+ int rightCount = selenium.getXpathCount(LOC_RIGHT_TABLE_LINES).intValue();
- // click the first item in the right table
- selenium.click(rightTable + "/tr[1]");
+ selenium.click(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
+ assertTrue(isDisplayed(LOC_REMOVE_BUTTON), "Remove button should be enabled.");
- // check that the 'Remove' button is enabled
- try {
- String text = selenium.getAttribute(leftButtons + "/div[5]@style");
- assertFalse(text.contains("display: none;"), "Remove button should not have style 'display: none;'");
- } catch (Exception e) {
- // OK
- }
+ selenium.click(LOC_REMOVE_BUTTON);
- // click 'Remove' button
- selenium.click(leftButtons + "/div[5]");
-
- int tmpInt = selenium.getXpathCount(leftTable + "/tr").intValue();
+ int tmpInt = selenium.getXpathCount(LOC_LEFT_TABLE_LINES).intValue();
assertEquals(tmpInt, leftCount + 1, "One item should be added to the left table.");
- tmpInt = selenium.getXpathCount(rightTable + "/tr").intValue();
+ tmpInt = selenium.getXpathCount(LOC_RIGHT_TABLE_LINES).intValue();
assertEquals(tmpInt, rightCount - 1, "One item should be removed from the right table.");
// check that one item was removed from toolbar
- tmpInt = selenium.getXpathCount(toolbar + "/td[contains(@class,'rich-toolbar-item')]").intValue();
+ tmpInt = selenium.getXpathCount(LOC_TOOLBAR_ITEMS).intValue();
assertEquals(tmpInt, rightCount - 1, "Number of items in toolbar.");
}
@@ -157,64 +153,60 @@
// fail("TODO");
// }
+ /**
+ * Tests remove all button. First it verifies that the button is enabled and
+ * clicks it. Then it verifies count of items on the left, on the right, and
+ * in toolbar.
+ */
@Test
public void testRemoveAllButton() {
- // get the count of items in left table
- int leftCount = selenium.getXpathCount(leftTable + "/tr").intValue();
- // get the count of items in right table
- int rightCount = selenium.getXpathCount(rightTable + "/tr").intValue();
+ int leftCount = selenium.getXpathCount(LOC_LEFT_TABLE_LINES).intValue();
+ int rightCount = selenium.getXpathCount(LOC_RIGHT_TABLE_LINES).intValue();
- // check that the 'Remove All' button is enabled
- try {
- String text = selenium.getAttribute(leftButtons + "/div[7]@style");
- assertFalse(text.contains("display: none;"), "Remove all button should not have style 'display: none;'");
- } catch (Exception e) {
- // OK
- }
+ assertTrue(isDisplayed(LOC_REMOVE_ALL_BUTTON), "Remove all button should be enabled.");
- // click 'Remove All' button
- selenium.click(leftButtons + "/div[7]");
+ selenium.click(LOC_REMOVE_ALL_BUTTON);
- int tmpInt = selenium.getXpathCount(leftTable + "/tr").intValue();
+ int tmpInt = selenium.getXpathCount(LOC_LEFT_TABLE_LINES).intValue();
assertEquals(tmpInt, leftCount + rightCount, "All items should be added to the left table.");
- tmpInt = selenium.getXpathCount(rightTable + "/tr").intValue();
+ tmpInt = selenium.getXpathCount(LOC_RIGHT_TABLE_LINES).intValue();
assertEquals(tmpInt, 0, "All items from right table should be removed.");
// check that everything was removed from toolbar
- tmpInt = selenium.getXpathCount(toolbar + "/td[contains(@class,'rich-toolbar-item')]").intValue();
+ tmpInt = selenium.getXpathCount(LOC_TOOLBAR_ITEMS).intValue();
assertEquals(tmpInt, 0, "Number of items in toolbar.");
}
+ /**
+ * Tests button "up". First it clicks the second item on the right and
+ * clicks the button. Then it verifies that the item was moved both in table
+ * and in toolbar.
+ */
@Test
public void testUpButton() {
- // click 'Copy All' button
- selenium.click(leftButtons + "/div[1]");
+ String firstItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
+ String firstItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 1));
+ String secondItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
+ String secondItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 2));
- String firstItemFromTable = selenium.getText(rightTable + "/tr[1]/td[2]");
- String firstItemFromToolbar = selenium.getText(toolbar + "/td[1]");
- String secondItemFromTable = selenium.getText(rightTable + "/tr[2]/td[2]");
- String secondItemFromToolbar = selenium.getText(toolbar + "/td[3]");
-
assertEquals(secondItemFromToolbar, secondItemFromTable,
"The second item in right table and toolbar should be the same.");
- // click the second item in the right table
- selenium.click(rightTable + "/tr[2]");
- // click the 'Up' button
- selenium.click(rightButtons + "/div[3]");
+ selenium.click(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
+ selenium.click(LOC_UP_BUTTON);
// check items in the table
- String tmpString = selenium.getText(rightTable + "/tr[1]/td[2]");
+ String tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
assertEquals(tmpString, secondItemFromTable, "The first and the second item in the table should be swapped.");
- tmpString = selenium.getText(rightTable + "/tr[2]/td[2]");
+ tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
assertEquals(tmpString, firstItemFromTable, "The first and the second item in the table should be swapped.");
// check items in the toolbar
- tmpString = selenium.getText(toolbar + "/td[1]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 1));
assertEquals(tmpString, secondItemFromToolbar,
"The first and the second item in the toolbar should be swapped.");
- tmpString = selenium.getText(toolbar + "/td[3]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 2));
assertEquals(tmpString, firstItemFromToolbar, "The first and the second item in the toolbar should be swapped.");
}
@@ -228,72 +220,72 @@
// fail("TODO");
// }
+ /**
+ * Tests button "first". First it clicks the third item on the right and
+ * clicks the button. Then it verifies that the item was moved both in table
+ * and in toolbar.
+ */
@Test
public void testFirstButton() {
- // click 'Copy All' button
- selenium.click(leftButtons + "/div[1]");
+ String firstItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
+ String firstItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 1));
+ String secondItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
+ String secondItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 2));
+ String thirdItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 3));
+ String thirdItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 3));
- String firstItemFromTable = selenium.getText(rightTable + "/tr[1]/td[2]");
- String firstItemFromToolbar = selenium.getText(toolbar + "/td[1]");
- String secondItemFromTable = selenium.getText(rightTable + "/tr[2]/td[2]");
- String secondItemFromToolbar = selenium.getText(toolbar + "/td[3]");
- String thirdItemFromTable = selenium.getText(rightTable + "/tr[3]/td[2]");
- String thirdItemFromToolbar = selenium.getText(toolbar + "/td[5]");
-
assertEquals(secondItemFromToolbar, secondItemFromTable,
"The second item in right table and toolbar should be the same.");
- // click the third item in the right table
- selenium.click(rightTable + "/tr[3]");
- // click the 'First' button
- selenium.click(rightButtons + "/div[1]");
+ selenium.click(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 3));
+ selenium.click(LOC_FIRST_BUTTON);
// check items in the table
- String tmpString = selenium.getText(rightTable + "/tr[2]/td[2]");
+ String tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
assertEquals(tmpString, firstItemFromTable, "The first item from the table should be now the second.");
- tmpString = selenium.getText(rightTable + "/tr[3]/td[2]");
+ tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 3));
assertEquals(tmpString, secondItemFromTable, "The second item from the table should be now the third.");
- tmpString = selenium.getText(rightTable + "/tr[1]/td[2]");
+ tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
assertEquals(tmpString, thirdItemFromTable, "The third item from the table should be now the first.");
// check items in the toolbar
- tmpString = selenium.getText(toolbar + "/td[3]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 2));
assertEquals(tmpString, firstItemFromToolbar, "The first item from the toolbar should be now the second.");
- tmpString = selenium.getText(toolbar + "/td[5]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 3));
assertEquals(tmpString, secondItemFromToolbar, "The second item from the toolbar should be now the third.");
- tmpString = selenium.getText(toolbar + "/td[1]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 1));
assertEquals(tmpString, thirdItemFromToolbar, "The third item from the toolbar should be now the first.");
}
+ /**
+ * Tests button "down".First it clicks the first item on the right and
+ * clicks the button. Then it verifies that the item was moved both in table
+ * and in toolbar.
+ */
@Test
public void testDownButton() {
- // click 'Copy All' button
- selenium.click(leftButtons + "/div[1]");
+ String firstItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
+ String firstItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 1));
+ String secondItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
+ String secondItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 2));
- String firstItemFromTable = selenium.getText(rightTable + "/tr[1]/td[2]");
- String firstItemFromToolbar = selenium.getText(toolbar + "/td[1]");
- String secondItemFromTable = selenium.getText(rightTable + "/tr[2]/td[2]");
- String secondItemFromToolbar = selenium.getText(toolbar + "/td[3]");
-
assertEquals(secondItemFromToolbar, secondItemFromTable,
"The second item in right table and toolbar should be the same.");
- // click the first item in the right table
- selenium.click(rightTable + "/tr[1]");
- // click the 'Down' button
- selenium.click(rightButtons + "/div[5]");
+ selenium.click(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
+ selenium.click(LOC_DOWN_BUTTON);
// check items in the table
- String tmpString = selenium.getText(rightTable + "/tr[1]/td[2]");
+ String tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
assertEquals(tmpString, secondItemFromTable, "The first and the second item in the table should be swapped.");
- tmpString = selenium.getText(rightTable + "/tr[2]/td[2]");
+ tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
assertEquals(tmpString, firstItemFromTable, "The first and the second item in the table should be swapped.");
// check items in the toolbar
- tmpString = selenium.getText(toolbar + "/td[1]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 1));
assertEquals(tmpString, secondItemFromToolbar,
"The first and the second item in the toolbar should be swapped.");
- tmpString = selenium.getText(toolbar + "/td[3]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 2));
assertEquals(tmpString, firstItemFromToolbar, "The first and the second item in the toolbar should be swapped.");
}
@@ -307,55 +299,73 @@
// fail("TODO");
// }
+ /**
+ * Tests the button "last". First it clicks the first item on the right and
+ * clicks the button. Then it verifies that the item was moved both in table
+ * and in toolbar.
+ */
@Test
public void testLastButton() {
- // click 'Copy All' button
- selenium.click(leftButtons + "/div[1]");
+ String firstItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
+ String firstItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 1));
+ String secondItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
+ String secondItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 2));
+ String thirdItemFromTable = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 3));
+ String thirdItemFromToolbar = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 3));
- String firstItemFromTable = selenium.getText(rightTable + "/tr[1]/td[2]");
- String firstItemFromToolbar = selenium.getText(toolbar + "/td[1]");
- String secondItemFromTable = selenium.getText(rightTable + "/tr[2]/td[2]");
- String secondItemFromToolbar = selenium.getText(toolbar + "/td[3]");
- String thirdItemFromTable = selenium.getText(rightTable + "/tr[3]/td[2]");
- String thirdItemFromToolbar = selenium.getText(toolbar + "/td[5]");
-
assertEquals(secondItemFromToolbar, secondItemFromTable,
"The second item in right table and toolbar should be the same.");
- // click the first item in the right table
- selenium.click(rightTable + "/tr[1]");
- // click the 'Last' button
- selenium.click(rightButtons + "/div[7]");
+ selenium.click(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
+ selenium.click(LOC_LAST_BUTTON);
// check items in the table
- String tmpString = selenium.getText(rightTable + "/tr[7]/td[2]");
+ String tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 3));
assertEquals(tmpString, firstItemFromTable, "The first item from the table should be now last.");
- tmpString = selenium.getText(rightTable + "/tr[1]/td[2]");
+ tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 1));
assertEquals(tmpString, secondItemFromTable, "The second item from the table should be now the first.");
- tmpString = selenium.getText(rightTable + "/tr[2]/td[2]");
+ tmpString = selenium.getText(format(LOC_RIGHT_TABLE_LINE_PREFORMATTED, 2));
assertEquals(tmpString, thirdItemFromTable, "The third item from the table should be now the second.");
// check items in the toolbar
- tmpString = selenium.getText(toolbar + "/td[13]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 3));
assertEquals(tmpString, firstItemFromToolbar, "The first item from the toolbar should be now last.");
- tmpString = selenium.getText(toolbar + "/td[1]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 1));
assertEquals(tmpString, secondItemFromToolbar, "The second item from the toolbar should be now the first.");
- tmpString = selenium.getText(toolbar + "/td[3]");
+ tmpString = selenium.getText(format(LOC_TOOLBAR_ITEM_PREFORMATTED, 2));
assertEquals(tmpString, thirdItemFromToolbar, "The third item from the toolbar should be now the second.");
}
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 5 lines of source code.
+ */
@Test
- public void testListShuttleSource() {
- abstractTestSource(1, 1, "<", "ui:composition");
+ public void testExampleSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<rich:toolBar id=\"toolBar\" itemSeparator=\"line\" height=\"28px\">",
+ "<c:forEach items=\"#{toolBar.items}\" var=\"item\">", "<h:panelGroup>",
+ "<h:graphicImage value=\"#{item.iconURI}\" styleClass=\"pic\" />",
+ "<h:outputLink value=\"#\" style=\"color:#{a4jSkin.generalTextColor}; text-decoration:none;\" >",
+ "<rich:listShuttle sourceValue=\"#{toolBar.freeItems}\"",
+ "targetValue=\"#{toolBar.items}\" var=\"items\" listsHeight=\"150\"",
+ "sourceListWidth=\"130\" targetListWidth=\"130\" sourceCaptionLabel=\"Available Items\"",
+ "targetCaptionLabel=\"Currently Active Items\"", "converter=\"listShuttleconverter\"> ",
+ "<rich:column width=\"18\"> ", "<h:graphicImage value=\"#{items.iconURI}\"></h:graphicImage>",
+ "<h:outputText value=\"#{items.label}\"></h:outputText>",
+ "<a4j:support event=\"onlistchanged\" reRender=\"toolBar\" />",
+ "<a4j:support event=\"onorderchanged\" reRender=\"toolBar\" />", };
+
+ abstractTestSource(1, "View Source", strings);
}
/**
* Loads the needed page.
*/
+ @SuppressWarnings("unused")
@BeforeMethod
private void loadPage() {
- super.loadPage("richSelect", 1, "listShuttle component allows to select items using two lists");
openComponent("List Shuttle");
- scrollIntoView("//fieldset[1]/legend", true);
+ scrollIntoView(LOC_EXAMPLE_HEADER, true);
}
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/modalPanel/ModalPanelTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/modalPanel/ModalPanelTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/modalPanel/ModalPanelTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,22 +1,23 @@
-/**
- * License Agreement.
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces
+ * 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.
*
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful,
+ * 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
+ * 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 code; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 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.jboss.richfaces.integrationTest.modalPanel;
@@ -37,230 +38,190 @@
*/
public class ModalPanelTestCase extends AbstractSeleniumRichfacesTestCase {
- // messages
- private final String MSG_COMPONENT_DESCRIPTION = getMsg("COMPONENT_DESCRIPTION");
+ // messages
+ private final String MSG_FIRST_PANEL_HEADER = getMsg("FIRST_PANEL_HEADER");
+ private final String MSG_FIRST_PANEL_CONTENT = getMsg("FIRST_PANEL_CONTENT");
- private final String MSG_FIRST_PANEL_NOT_VISIBLE = getMsg("FIRST_PANEL_NOT_VISIBLE");
- private final String MSG_FIRST_PANEL_VISIBLE = getMsg("FIRST_PANEL_VISIBLE");
- private final String MSG_FIRST_PANEL_WRONG_CONTENT = getMsg("FIRST_PANEL_WRONG_CONTENT");
- private final String MSG_FIRST_PANEL_WRONG_HEADER = getMsg("FIRST_PANEL_WRONG_HEADER");
+ private final String MSG_SECOND_PANEL_HEADER = getMsg("SECOND_PANEL_HEADER");
+ private final String MSG_SECOND_PANEL_CONTENT = getMsg("SECOND_PANEL_CONTENT");
- private final String MSG_SECOND_PANEL_NOT_VISIBLE = getMsg("SECOND_PANEL_NOT_VISIBLE");
- private final String MSG_SECOND_PANEL_VISIBLE = getMsg("SECOND_PANEL_VISIBLE");
- private final String MSG_SECOND_PANEL_WRONG_CONTENT = getMsg("SECOND_PANEL_WRONG_CONTENT");
- private final String MSG_SECOND_PANEL_WRONG_HEADER = getMsg("SECOND_PANEL_WRONG_HEADER");
+ // locators
+ private final String LOC_FIRST_EXAMPLE_HEADER = getLoc("FIRST_EXAMPLE_HEADER");
+ private final String LOC_FIRST_PANEL = getLoc("FIRST_PANEL");
+ private final String LOC_FIRST_PANEL_POSITION = getLoc("FIRST_PANEL_POSITION");
+ private final String LOC_FIRST_PANEL_OPEN = getLoc("FIRST_PANEL_OPEN");
+ private final String LOC_FIRST_PANEL_CLOSE = getLoc("FIRST_PANEL_CLOSE");
+ private final String LOC_FIRST_PANEL_HEADER = getLoc("FIRST_PANEL_HEADER");
+ private final String LOC_FIRST_PANEL_CONTENT = getLoc("FIRST_PANEL_CONTENT");
- // locators
- private final String LOC_FIRST_EXAMPLE_HEADER = getLoc("FIRST_EXAMPLE_HEADER");
- private final String LOC_FIRST_PANEL = getLoc("FIRST_PANEL");
- private final String LOC_FIRST_PANEL_POSITION = getLoc("FIRST_PANEL_POSITION");
- private final String LOC_FIRST_PANEL_OPEN = getLoc("FIRST_PANEL_OPEN");
- private final String LOC_FIRST_PANEL_CLOSE = getLoc("FIRST_PANEL_CLOSE");
- private final String LOC_FIRST_PANEL_HEADER = getLoc("FIRST_PANEL_HEADER");
- private final String LOC_FIRST_PANEL_CONTENT = getLoc("FIRST_PANEL_CONTENT");
+ private final String LOC_SECOND_EXAMPLE_HEADER = getLoc("SECOND_EXAMPLE_HEADER");
+ private final String LOC_SECOND_PANEL = getLoc("SECOND_PANEL");
+ private final String LOC_SECOND_PANEL_POSITION = getLoc("SECOND_PANEL_POSITION");
+ private final String LOC_SECOND_PANEL_OPEN = getLoc("SECOND_PANEL_OPEN");
+ private final String LOC_SECOND_PANEL_CLOSE = getLoc("SECOND_PANEL_CLOSE");
+ private final String LOC_SECOND_PANEL_HEADER = getLoc("SECOND_PANEL_HEADER");
+ private final String LOC_SECOND_PANEL_CONTENT = getLoc("SECOND_PANEL_CONTENT");
- private final String LOC_SECOND_EXAMPLE_HEADER = getLoc("SECOND_EXAMPLE_HEADER");
- private final String LOC_SECOND_PANEL = getLoc("SECOND_PANEL");
- private final String LOC_SECOND_PANEL_POSITION = getLoc("SECOND_PANEL_POSITION");
- private final String LOC_SECOND_PANEL_OPEN = getLoc("SECOND_PANEL_OPEN");
- private final String LOC_SECOND_PANEL_CLOSE = getLoc("SECOND_PANEL_CLOSE");
- private final String LOC_SECOND_PANEL_HEADER = getLoc("SECOND_PANEL_HEADER");
- private final String LOC_SECOND_PANEL_CONTENT = getLoc("SECOND_PANEL_CONTENT");
+ /**
+ * Tests the first panel. First it checks that the panel is invisible
+ * initially, then opens the panel and verifies it is visible. Then it
+ * checks the content of the panel's header and its content. In the end it
+ * closes the panel.
+ */
+ @Test
+ public void testFirstPanelOpenClose() {
+ scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
- /**
- * Tests the first panel. First it checks that the panel is invisible
- * initially, then opens the panel and verifies it is visible. Then it
- * checks the content of the panel's header and its content. In the end it
- * closes the panel.
- */
- @Test
- public void testFirstPanelOpenClose() {
- String tmp = selenium.getAttribute(LOC_FIRST_PANEL + "@style");
- assertFalse(!tmp.contains("display: none;"),
- MSG_FIRST_PANEL_NOT_VISIBLE);
-
- selenium.click(LOC_FIRST_PANEL_OPEN);
+ assertFalse(isDisplayed(LOC_FIRST_PANEL), "The first panel should not be visible.");
- tmp = selenium.getAttribute(LOC_FIRST_PANEL + "@style");
- assertTrue(!tmp.contains("display: none;"), MSG_FIRST_PANEL_VISIBLE);
+ selenium.click(LOC_FIRST_PANEL_OPEN);
+ assertTrue(isDisplayed(LOC_FIRST_PANEL), "The first panel should be visible.");
- tmp = selenium.getText(LOC_FIRST_PANEL_HEADER);
- assertEquals(tmp, "Modal Panel", MSG_FIRST_PANEL_WRONG_HEADER);
+ String tmp = selenium.getText(LOC_FIRST_PANEL_HEADER);
+ assertEquals(tmp, MSG_FIRST_PANEL_HEADER, "The header of the first panel is wrong.");
+ tmp = selenium.getText(LOC_FIRST_PANEL_CONTENT);
+ assertEquals(tmp, MSG_FIRST_PANEL_CONTENT, "The content of the first panel is wrong.");
- tmp = selenium.getText(LOC_FIRST_PANEL_CONTENT);
- assertEquals(
- tmp,
- "This panel is called using Component Control Component \n"
- + "Closure link (X) works also through Component Control",
- MSG_FIRST_PANEL_WRONG_CONTENT);
+ selenium.click(LOC_FIRST_PANEL_CLOSE);
+ assertFalse(isDisplayed(LOC_FIRST_PANEL), "The first panel should not be visible.");
+ }
- selenium.click(LOC_FIRST_PANEL_CLOSE);
-
- tmp = selenium.getAttribute(LOC_FIRST_PANEL + "@style");
- assertFalse(!tmp.contains("display: none;"),
- MSG_FIRST_PANEL_NOT_VISIBLE);
- }
+ /**
+ * Tests moving the panel. It opens the panel, gets panel's position on the
+ * page, and moves it 20px right, 20px down. Then it verifies the position,
+ * closes the panel, and opens it again. Then it verifies that the panel is
+ * locatet on the new position.
+ */
+ @Test
+ public void testFirstPanelMove() {
+ scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
+ selenium.click(LOC_FIRST_PANEL_OPEN);
- /**
- * Tests moving the panel. It opens the panel, gets panel's position on the
- * page, and moves it 20px right, 20px down. Then it verifies the position,
- * closes the panel, and opens it again. Then it verifies that the panel is
- * locatet on the new position.
- */
- @Test
- public void testFirstPanelMove() {
- selenium.click(LOC_FIRST_PANEL_OPEN);
+ int firstX = Integer.parseInt(getStyle(LOC_FIRST_PANEL_POSITION, "left").replace("px", ""));
+ int firstY = Integer.parseInt(getStyle(LOC_FIRST_PANEL_POSITION, "top").replace("px", ""));
- int firstX = getPosition("left", LOC_FIRST_PANEL_POSITION);
- int firstY = getPosition("top", LOC_FIRST_PANEL_POSITION);
+ for (int i = 0; i < 40; i++) {
+ if (i % 2 == 0) {
+ selenium.dragAndDrop(LOC_FIRST_PANEL_HEADER, "+1,0");
+ } else {
+ selenium.dragAndDrop(LOC_FIRST_PANEL_HEADER, "0,+1");
+ }
+ }
- for (int i = 0; i < 40; i++) {
- if (i % 2 == 0) {
- selenium.dragAndDrop(LOC_FIRST_PANEL_HEADER, "+1,0");
- } else {
- selenium.dragAndDrop(LOC_FIRST_PANEL_HEADER, "0,+1");
- }
- }
+ int secondX = Integer.parseInt(getStyle(LOC_FIRST_PANEL_POSITION, "left").replace("px", ""));
+ int secondY = Integer.parseInt(getStyle(LOC_FIRST_PANEL_POSITION, "top").replace("px", ""));
- int secondX = getPosition("left", LOC_FIRST_PANEL_POSITION);
- int secondY = getPosition("top", LOC_FIRST_PANEL_POSITION);
+ assertEquals(secondX, firstX + 20, "Panel should move 20px right.");
+ assertEquals(secondY, firstY + 20, "Panel should move 20px down.");
- assertEquals(secondX, firstX + 20, "sdlkfj");
- assertEquals(secondY, firstY + 20, "skldfjsk");
+ selenium.click(LOC_FIRST_PANEL_CLOSE);
+ selenium.click(LOC_FIRST_PANEL_OPEN);
- selenium.click(LOC_FIRST_PANEL_CLOSE);
- selenium.click(LOC_FIRST_PANEL_OPEN);
+ int thirdX = Integer.parseInt(getStyle(LOC_FIRST_PANEL_POSITION, "left").replace("px", ""));
+ int thirdY = Integer.parseInt(getStyle(LOC_FIRST_PANEL_POSITION, "top").replace("px", ""));
- int thirdX = getPosition("left", LOC_FIRST_PANEL_POSITION);
- int thirdY = getPosition("top", LOC_FIRST_PANEL_POSITION);
+ assertEquals(thirdX, secondX, "Panel shouldn't move after closing and opening.");
+ assertEquals(thirdY, secondY, "Panel shouldn't move after closing and opening.");
+ }
- assertEquals(thirdX, secondX, "sdsdflkfj");
- assertEquals(thirdY, secondY, "skldfsdfjsk");
- }
+ /**
+ * Tests the second panel. First it checks that the panel is invisible
+ * initially, then opens the panel and verifies it is visible. Then it
+ * checks the content of the panel's header and its content. In the end it
+ * closes the panel.
+ */
+ @Test
+ public void testSecondPanelOpenClose() {
+ scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
+ assertFalse(isDisplayed(LOC_SECOND_PANEL), "The second panel should not be visible.");
- /**
- * Tests the second panel. First it checks that the panel is invisible
- * initially, then opens the panel and verifies it is visible. Then it
- * checks the content of the panel's header and its content. In the end it
- * closes the panel.
- */
- @Test
- public void testSecondPanelOpenClose() {
- String tmp = selenium.getAttribute(LOC_SECOND_PANEL + "@style");
- assertFalse(!tmp.contains("display: none;"),
- MSG_SECOND_PANEL_NOT_VISIBLE);
+ selenium.click(LOC_SECOND_PANEL_OPEN);
+ assertTrue(isDisplayed(LOC_SECOND_PANEL), "The second panel should be visible.");
- selenium.click(LOC_SECOND_PANEL_OPEN);
+ String tmp = selenium.getText(LOC_SECOND_PANEL_HEADER);
+ assertEquals(tmp, MSG_SECOND_PANEL_HEADER, "The header of the second panel is wrong.");
- tmp = selenium.getAttribute(LOC_SECOND_PANEL + "@style");
- assertTrue(!tmp.contains("display: none;"), MSG_SECOND_PANEL_VISIBLE);
+ tmp = selenium.getText(LOC_SECOND_PANEL_CONTENT);
+ assertTrue(tmp.contains(MSG_SECOND_PANEL_CONTENT), "The content of the second panel is wrong.");
- tmp = selenium.getText(LOC_SECOND_PANEL_HEADER);
- assertEquals(tmp, "Modal Panel Title", MSG_SECOND_PANEL_WRONG_HEADER);
+ selenium.click(LOC_SECOND_PANEL_CLOSE);
+ assertFalse(isDisplayed(LOC_SECOND_PANEL), "The second panel should not be visible.");
+ }
- tmp = selenium.getText(LOC_SECOND_PANEL_CONTENT);
- assertTrue(tmp.contains("Any JSF content might be inside the panel."),
- MSG_SECOND_PANEL_WRONG_CONTENT);
+ /**
+ * Tests moving the panel. It opens the panel, gets panel's position on the
+ * page, and moves it 20px right, 20px down. Then it verifies the position,
+ * closes the panel, and opens it again. Then it verifies that the panel is
+ * locatet on the new position.
+ */
+ @Test
+ public void testSecondPanelMove() {
+ scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
+ selenium.click(LOC_SECOND_PANEL_OPEN);
- selenium.click(LOC_SECOND_PANEL_CLOSE);
+ int firstX = Integer.parseInt(getStyle(LOC_SECOND_PANEL_POSITION, "left").replace("px", ""));
+ int firstY = Integer.parseInt(getStyle(LOC_SECOND_PANEL_POSITION, "top").replace("px", ""));
- tmp = selenium.getAttribute(LOC_SECOND_PANEL + "@style");
- assertFalse(!tmp.contains("display: none;"),
- MSG_SECOND_PANEL_NOT_VISIBLE);
- }
+ for (int i = 0; i < 40; i++) {
+ if (i % 2 == 0) {
+ selenium.dragAndDrop(LOC_SECOND_PANEL_HEADER, "+1,0");
+ } else {
+ selenium.dragAndDrop(LOC_SECOND_PANEL_HEADER, "0,+1");
+ }
+ }
- /**
- * Tests moving the panel. It opens the panel, gets panel's position on the
- * page, and moves it 20px right, 20px down. Then it verifies the position,
- * closes the panel, and opens it again. Then it verifies that the panel is
- * locatet on the new position.
- */
- @Test
- public void testSecondPanelMove() {
- selenium.click(LOC_SECOND_PANEL_OPEN);
+ int secondX = Integer.parseInt(getStyle(LOC_SECOND_PANEL_POSITION, "left").replace("px", ""));
+ int secondY = Integer.parseInt(getStyle(LOC_SECOND_PANEL_POSITION, "top").replace("px", ""));
- int firstX = getPosition("left", LOC_SECOND_PANEL_POSITION);
- int firstY = getPosition("top", LOC_SECOND_PANEL_POSITION);
+ assertEquals(secondX, firstX + 20, "Panel should move 20px right.");
+ assertEquals(secondY, firstY + 20, "Panel should move 20px down.");
- for (int i = 0; i < 40; i++) {
- if (i % 2 == 0) {
- selenium.dragAndDrop(LOC_SECOND_PANEL_HEADER, "+1,0");
- } else {
- selenium.dragAndDrop(LOC_SECOND_PANEL_HEADER, "0,+1");
- }
- }
+ selenium.click(LOC_SECOND_PANEL_CLOSE);
+ selenium.click(LOC_SECOND_PANEL_OPEN);
- int secondX = getPosition("left", LOC_SECOND_PANEL_POSITION);
- int secondY = getPosition("top", LOC_SECOND_PANEL_POSITION);
+ int thirdX = Integer.parseInt(getStyle(LOC_SECOND_PANEL_POSITION, "left").replace("px", ""));
+ int thirdY = Integer.parseInt(getStyle(LOC_SECOND_PANEL_POSITION, "top").replace("px", ""));
- assertEquals(secondX, firstX + 20, "sdlkfj");
- assertEquals(secondY, firstY + 20, "skldfjsk");
+ assertEquals(thirdX, secondX, "Panel shouldn't move after closing and opening.");
+ assertEquals(thirdY, secondY, "Panel shouldn't move after closing and opening.");
+ }
- selenium.click(LOC_SECOND_PANEL_CLOSE);
- selenium.click(LOC_SECOND_PANEL_OPEN);
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 5 lines of source code.
+ */
+ @Test
+ public void testFirstSource() {
+ String[] strings = new String[] { "<rich:modalPanel id=\"panel\" width=\"350\" height=\"100\">",
+ "<f:facet name=\"header\">",
+ "<h:graphicImage value=\"/images/modal/close.png\" styleClass=\"hidelink\" id=\"hidelink\"/>",
+ "<h:outputText value=\"This panel is called using Component Control Component\"></h:outputText>",
+ "<h:outputLink value=\"#\" id=\"link\">", };
- int thirdX = getPosition("left", LOC_SECOND_PANEL_POSITION);
- int thirdY = getPosition("top", LOC_SECOND_PANEL_POSITION);
+ abstractTestSource(1, "View Source", strings);
+ }
- assertEquals(thirdX, secondX, "sdsdflkfj");
- assertEquals(thirdY, secondY, "skldfsdfjsk");
- }
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 5 lines of source code.
+ */
+ @Test
+ public void testSecondSource() {
+ String[] strings = new String[] { "function getRightTop(ref) {",
+ "<h:outputText value=\"Modal Panel Title\" />",
+ "<p>Any JSF content might be inside the panel. In case of using ",
+ "<a href=\"#\" onclick=\"#{rich:component('mp')}.hide()\">hide this panel</a>:",
+ "<f:verbatim>#</f:verbatim>{rich:component('mp')}.hide()</p>", };
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks 5 lines of source code.
- */
- @Test
- public void testFirstSource() {
- String [] strings = new String [] {
- "<rich:modalPanel id=\"panel\" width=\"350\" height=\"100\">",
- "<f:facet name=\"header\">",
- "<h:graphicImage value=\"/images/modal/close.png\" styleClass=\"hidelink\" id=\"hidelink\"/>",
- "<h:outputText value=\"This panel is called using Component Control Component\"></h:outputText>",
- "<h:outputLink value=\"#\" id=\"link\">",
- };
-
- abstractTestSource(1, "View Source", strings);
- }
+ abstractTestSource(2, "View Source", strings);
+ }
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks 5 lines of source code.
- */
- @Test
- public void testSecondSource() {
- String [] strings = new String [] {
- "function getRightTop(ref) {",
- "<h:outputText value=\"Modal Panel Title\" />",
- "<p>Any JSF content might be inside the panel. In case of using ",
- "<a href=\"#\" onclick=\"#{rich:component('mp')}.hide()\">hide this panel</a>:",
- "<f:verbatim>#</f:verbatim>{rich:component('mp')}.hide()</p>",
- };
-
- abstractTestSource(2, "View Source", strings);
- }
-
- /**
- * Returns one component of the position from the attribute "style".
- *
- * @param which
- * one of left, right, top, bottom
- * @param locator
- * locator of the style attribute
- * @return the value of the attribute in pixels
- */
- private int getPosition(String which, String locator) {
- String attr = selenium.getAttribute(locator);
- attr = attr.substring(attr.indexOf(which));
- attr = attr.substring(which.length() + 2, attr.indexOf("px;"));
- return Integer.parseInt(attr);
- }
-
- /**
- * Loads the page containing the calendar component.
- */
- @BeforeMethod
- private void loadPage() {
- openComponent("Modal Panel");
- }
+ /**
+ * Loads the page containing the calendar component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Modal Panel");
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/orderingList/OrderingListTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/orderingList/OrderingListTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/orderingList/OrderingListTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.jboss.richfaces.integrationTest.orderingList;
import static org.testng.Assert.assertEquals;
@@ -9,475 +31,504 @@
import org.testng.annotations.Test;
/**
+ * Test case for ordering list.
*
- * <ul>
- * <li><b>TODO</b> check that the number of lines does not change on Up, Down,
- * First, Last (+Ctrl/Shift)</li>
- * <li><b>TODO</b> check that all buttons are disabled if no lines selected</li>
- * <li><b>TODO</b> refactor tests so that the common functionality is in one
- * method</li>
- * </ul>
- *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
+// TODO check that the number of lines does not change on Up, Down, First, Last
+// (+Ctrl/Shift)
+// TODO check that all buttons are disabled if no lines selected
+// TODO refactor tests so that the common functionality is in one method
public class OrderingListTestCase extends AbstractSeleniumRichfacesTestCase {
- private final String table = "//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr[2]/td[1]/div/div[2]/table/tbody";
- private final String buttons = "//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr[2]/td[2]/div";
- private final String selection = "//fieldset[1]/div/form/table/tbody/tr/td[2]/div/div[2]";
+ // locators
+ private final String LOC_EXAMPLE_HEADER = getLoc("EXAMPLE_HEADER");
+ private final String LOC_TABLE_LINES = getLoc("TABLE_LINES");
+ private final String LOC_TABLE_LINE_PREFORMATTED = getLoc("TABLE_LINE_PREFORMATTED");
+ private final String LOC_SELECTION = getLoc("SELECTION");
+ private final String LOC_SELECTION_PREFORMATTED = getLoc("SELECTION_PREFORMATTED");
- @Test
- public void testOrderingList() {
- int count = selenium.getXpathCount(table + "/tr").intValue();
- assertTrue(count > 0, "There are no lines in the table.");
+ private final String LOC_BUTTON_FIRST = getLoc("BUTTON_FIRST");
+ private final String LOC_BUTTON_UP = getLoc("BUTTON_UP");
+ private final String LOC_BUTTON_DOWN = getLoc("BUTTON_DOWN");
+ private final String LOC_BUTTON_LAST = getLoc("BUTTON_LAST");
- waitFor(1000);
- String text = selenium.getText(selection);
- assertEquals(text, "No Songs Selected",
- "Selection should not contain any name of song.");
+ // messages
+ private final String MSG_ORDERING_LIST_SELECTION = getMsg("ORDERING_LIST_SELECTION");
- }
+ /**
+ * Tests initial state of the ordering list.
+ */
+ @Test
+ public void testOrderingList() {
+ int count = selenium.getXpathCount(LOC_TABLE_LINES).intValue();
+ assertTrue(count > 0, "There are no lines in the table.");
- @Test
- public void testClickSingleFile() {
- selenium.click(table + "/tr[1]");
- String text = selenium.getText(table + "/tr[1]/td[1]");
+ waitFor(1000);
+ String text = selenium.getText(LOC_SELECTION);
+ assertEquals(text, MSG_ORDERING_LIST_SELECTION, "Selection should not contain any name of song.");
+ }
- waitFor(1000);
- String text2 = selenium.getText(selection);
+ /**
+ * Tests clicking on a single line.
+ */
+ @Test
+ public void testClickSingleSong() {
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ String text = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
- assertEquals(text2, text,
- "Selected song is not shown in the selection panel.");
- }
+ waitFor(1000);
+ String text2 = selenium.getText(LOC_SELECTION);
- @Test
- public void testClickMultipleFilesCtrl() {
- String[] fromTable = new String[3];
- String[] fromPanel = new String[3];
+ assertEquals(text2, text, "Selected song is not shown in the selection panel.");
+ }
- // click lines nr. 1, 3, and 5 in the table
- selenium.click(table + "/tr[1]");
- selenium.controlKeyDown();
- selenium.click(table + "/tr[3]");
- selenium.click(table + "/tr[5]");
- selenium.controlKeyUp();
+ /**
+ * Tests clicking on multiple lines using Ctrl key.
+ */
+ @Test
+ public void testClickMultipleSongsCtrl() {
+ String[] fromTable = new String[3];
+ String[] fromPanel = new String[3];
- fromTable[0] = selenium.getText(table + "/tr[1]/td[1]");
- fromTable[1] = selenium.getText(table + "/tr[3]/td[1]");
- fromTable[2] = selenium.getText(table + "/tr[5]/td[1]");
+ // click lines nr. 1, 3, and 5 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ selenium.controlKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 3));
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ selenium.controlKeyUp();
- waitFor(1000);
+ fromTable[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ fromTable[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 3));
+ fromTable[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
- // get all selections from the panel on the right
- for (int i = 0; i < 3; i++) {
- fromPanel[i] = selenium.getText(selection + "/ul/li[" + (i + 1)
- + "]");
- }
+ waitFor(1000);
- assertEqualsNoOrder(fromPanel, fromTable,
- "Items chosen in table should be also in the right panel.");
- }
+ // get all selections from the panel on the right
+ for (int i = 0; i < 3; i++) {
+ fromPanel[i] = selenium.getText(format(LOC_SELECTION_PREFORMATTED, i + 1));
+ }
- @Test
- public void testClickMultipleFilesShift() {
- String[] fromTable = new String[3];
- String[] fromPanel = new String[3];
+ assertEqualsNoOrder(fromPanel, fromTable, "Items chosen in table should be also in the right panel.");
+ }
- // click lines nr. 1 and 3 in the table
- selenium.click(table + "/tr[1]");
- selenium.shiftKeyDown();
- selenium.click(table + "/tr[3]");
- selenium.shiftKeyUp();
+ /**
+ * Tests clicking on multiple lines using Shift key.
+ */
+ @Test
+ public void testClickMultipleSongsShift() {
+ String[] fromTable = new String[3];
+ String[] fromPanel = new String[3];
- fromTable[0] = selenium.getText(table + "/tr[1]/td[1]");
- fromTable[1] = selenium.getText(table + "/tr[2]/td[1]");
- fromTable[2] = selenium.getText(table + "/tr[3]/td[1]");
+ // click lines nr. 1 and 3 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ selenium.shiftKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 3));
+ selenium.shiftKeyUp();
- waitFor(1000);
+ fromTable[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ fromTable[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ fromTable[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 3));
- // get all selections from the panel on the right
- for (int i = 0; i < 3; i++) {
- fromPanel[i] = selenium.getText(selection + "/ul/li[" + (i + 1)
- + "]");
- }
+ waitFor(1000);
- assertEqualsNoOrder(fromPanel, fromTable,
- "Items chosen in table should be also in the right panel.");
- }
+ // get all selections from the panel on the right
+ for (int i = 0; i < 3; i++) {
+ fromPanel[i] = selenium.getText(format(LOC_SELECTION_PREFORMATTED, i + 1));
+ }
- @Test
- public void testUpSingleFile() {
- String[] before = new String[2];
- String[] after = new String[2];
+ assertEqualsNoOrder(fromPanel, fromTable, "Items chosen in table should be also in the right panel.");
+ }
- before[0] = selenium.getText(table + "/tr[5]/td[1]");
- before[1] = selenium.getText(table + "/tr[6]/td[1]");
+ /**
+ * Tests the button up for a single song.
+ */
+ @Test
+ public void testUpSingleSong() {
+ String[] before = new String[2];
+ String[] after = new String[2];
- // click line nr. 6 in the table
- selenium.click(table + "/tr[6]");
- // click the 'Up' button
- selenium.click(buttons + "/div[3]");
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
- after[0] = selenium.getText(table + "/tr[5]/td[1]");
- after[1] = selenium.getText(table + "/tr[6]/td[1]");
+ // click line nr. 6 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ // click the 'Up' button
+ selenium.click(LOC_BUTTON_UP);
- assertEquals(after[0], before[1], "The sixth line should be now fifth.");
- assertEquals(after[1], before[0], "The fifth line should be now sixth.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
- @Test
- public void testUpMultipleFilesShift() {
- String[] before = new String[3];
- String[] after = new String[3];
+ assertEquals(after[0], before[1], "The sixth line should be now fifth.");
+ assertEquals(after[1], before[0], "The fifth line should be now sixth.");
+ }
- before[0] = selenium.getText(table + "/tr[5]/td[1]");
- before[1] = selenium.getText(table + "/tr[6]/td[1]");
- before[2] = selenium.getText(table + "/tr[7]/td[1]");
+ /**
+ * Tests the button up for multiple songs selected using Shift key.
+ */
+ @Test
+ public void testUpMultipleSongsShift() {
+ String[] before = new String[3];
+ String[] after = new String[3];
- // click line nr. 6 and 7 in the table
- selenium.click(table + "/tr[6]");
- selenium.shiftKeyDown();
- selenium.click(table + "/tr[7]");
- selenium.shiftKeyUp();
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- // click the 'Up' button (5,6,7 -> 6,7,5)
- selenium.click(buttons + "/div[3]");
+ // click line nr. 6 and 7 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ selenium.shiftKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 7));
+ selenium.shiftKeyUp();
- after[0] = selenium.getText(table + "/tr[5]/td[1]");
- after[1] = selenium.getText(table + "/tr[6]/td[1]");
- after[2] = selenium.getText(table + "/tr[7]/td[1]");
+ // click the 'Up' button (5,6,7 -> 6,7,5)
+ selenium.click(LOC_BUTTON_UP);
- assertEquals(after[0], before[1], "The sixth line should be now fifth.");
- assertEquals(after[1], before[2],
- "The seventh line should be now sixth.");
- assertEquals(after[2], before[0],
- "The fifth line should be now seventh.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- @Test
- public void testUpMultipleFilesCtrl() {
- String[] before = new String[3];
- String[] after = new String[3];
+ assertEquals(after[0], before[1], "The sixth line should be now fifth.");
+ assertEquals(after[1], before[2], "The seventh line should be now sixth.");
+ assertEquals(after[2], before[0], "The fifth line should be now seventh.");
+ }
- before[0] = selenium.getText(table + "/tr[5]/td[1]");
- before[1] = selenium.getText(table + "/tr[6]/td[1]");
- before[2] = selenium.getText(table + "/tr[7]/td[1]");
+ /**
+ * Tests the button up for multiple songs selected using Ctrl key.
+ */
+ @Test
+ public void testUpMultipleSongsCtrl() {
+ String[] before = new String[3];
+ String[] after = new String[3];
- // click line nr. 6 and 7 in the table
- selenium.click(table + "/tr[6]");
- selenium.controlKeyDown();
- selenium.click(table + "/tr[7]");
- selenium.controlKeyUp();
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- // click the 'Up' button (5,6,7 -> 6,7,5)
- selenium.click(buttons + "/div[3]");
+ // click line nr. 6 and 7 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ selenium.controlKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 7));
+ selenium.controlKeyUp();
- after[0] = selenium.getText(table + "/tr[5]/td[1]");
- after[1] = selenium.getText(table + "/tr[6]/td[1]");
- after[2] = selenium.getText(table + "/tr[7]/td[1]");
+ // click the 'Up' button (5,6,7 -> 6,7,5)
+ selenium.click(LOC_BUTTON_UP);
- assertEquals(after[0], before[1], "The sixth line should be now fifth.");
- assertEquals(after[1], before[2],
- "The seventh line should be now sixth.");
- assertEquals(after[2], before[0],
- "The fifth line should be now seventh.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- @Test
- public void testDownSingleFile() {
- String[] before = new String[2];
- String[] after = new String[2];
+ assertEquals(after[0], before[1], "The sixth line should be now fifth.");
+ assertEquals(after[1], before[2], "The seventh line should be now sixth.");
+ assertEquals(after[2], before[0], "The fifth line should be now seventh.");
+ }
- before[0] = selenium.getText(table + "/tr[6]/td[1]");
- before[1] = selenium.getText(table + "/tr[7]/td[1]");
+ /**
+ * Tests the button down for a single song.
+ */
+ @Test
+ public void testDownSingleSong() {
+ String[] before = new String[2];
+ String[] after = new String[2];
- // click line nr. 6 in the table
- selenium.click(table + "/tr[6]");
- // click the 'Up' button
- selenium.click(buttons + "/div[5]");
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- after[0] = selenium.getText(table + "/tr[6]/td[1]");
- after[1] = selenium.getText(table + "/tr[7]/td[1]");
+ // click line nr. 6 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ // click the 'Down' button
+ selenium.click(LOC_BUTTON_DOWN);
- assertEquals(after[0], before[1],
- "The sixth line should be now seventh.");
- assertEquals(after[1], before[0],
- "The seventh line should be now sixth.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- @Test
- public void testDownMultipleFilesShift() {
- String[] before = new String[3];
- String[] after = new String[3];
+ assertEquals(after[0], before[1], "The sixth line should be now seventh.");
+ assertEquals(after[1], before[0], "The seventh line should be now sixth.");
+ }
- before[0] = selenium.getText(table + "/tr[5]/td[1]");
- before[1] = selenium.getText(table + "/tr[6]/td[1]");
- before[2] = selenium.getText(table + "/tr[7]/td[1]");
+ /**
+ * Tests the button down for multiple songs selected using Shift key.
+ */
+ @Test
+ public void testDownMultipleSongsShift() {
+ String[] before = new String[3];
+ String[] after = new String[3];
- // click line nr. 5 and 6 in the table
- selenium.click(table + "/tr[5]");
- selenium.shiftKeyDown();
- selenium.click(table + "/tr[6]");
- selenium.shiftKeyUp();
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- // click the 'Up' button (5,6,7 -> 7,5,6)
- selenium.click(buttons + "/div[5]");
+ // click line nr. 5 and 6 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ selenium.shiftKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ selenium.shiftKeyUp();
- after[0] = selenium.getText(table + "/tr[5]/td[1]");
- after[1] = selenium.getText(table + "/tr[6]/td[1]");
- after[2] = selenium.getText(table + "/tr[7]/td[1]");
+ // click the 'Down' button (5,6,7 -> 7,5,6)
+ selenium.click(LOC_BUTTON_DOWN);
- assertEquals(after[0], before[2],
- "The seventh line should be now fifth.");
- assertEquals(after[1], before[0], "The fifth line should be now sixth.");
- assertEquals(after[2], before[1],
- "The sixth line should be now seventh.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- @Test
- public void testDownMultipleFilesCtrl() {
- String[] before = new String[3];
- String[] after = new String[3];
+ assertEquals(after[0], before[2], "The seventh line should be now fifth.");
+ assertEquals(after[1], before[0], "The fifth line should be now sixth.");
+ assertEquals(after[2], before[1], "The sixth line should be now seventh.");
+ }
- before[0] = selenium.getText(table + "/tr[5]/td[1]");
- before[1] = selenium.getText(table + "/tr[6]/td[1]");
- before[2] = selenium.getText(table + "/tr[7]/td[1]");
+ /**
+ * Tests the button down for multiple songs selected using Ctrl key.
+ */
+ @Test
+ public void testDownMultipleSongsCtrl() {
+ String[] before = new String[3];
+ String[] after = new String[3];
- // click line nr. 5 and 6 in the table
- selenium.click(table + "/tr[5]");
- selenium.controlKeyDown();
- selenium.click(table + "/tr[6]");
- selenium.controlKeyUp();
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- // click the 'Up' button (5,6,7 -> 7,5,6)
- selenium.click(buttons + "/div[5]");
+ // click line nr. 5 and 6 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ selenium.controlKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ selenium.controlKeyUp();
- after[0] = selenium.getText(table + "/tr[5]/td[1]");
- after[1] = selenium.getText(table + "/tr[6]/td[1]");
- after[2] = selenium.getText(table + "/tr[7]/td[1]");
+ // click the 'Down' button (5,6,7 -> 7,5,6)
+ selenium.click(LOC_BUTTON_DOWN);
- assertEquals(after[0], before[2],
- "The seventh line should be now fifth.");
- assertEquals(after[1], before[0], "The fifth line should be now sixth.");
- assertEquals(after[2], before[1],
- "The sixth line should be now seventh.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 5));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 6));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 7));
- @Test
- public void testLastSingleFile() {
- String[] before = new String[3];
- String[] after = new String[3];
- int countOfLines = selenium.getXpathCount(table + "/tr").intValue();
+ assertEquals(after[0], before[2], "The seventh line should be now fifth.");
+ assertEquals(after[1], before[0], "The fifth line should be now sixth.");
+ assertEquals(after[2], before[1], "The sixth line should be now seventh.");
+ }
- before[0] = selenium.getText(table + "/tr[1]/td[1]");
- before[1] = selenium.getText(table + "/tr[2]/td[1]");
- before[2] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ /**
+ * Tests the button last for a single song.
+ */
+ @Test
+ public void testLastSingleSong() {
+ String[] before = new String[3];
+ String[] after = new String[3];
+ int countOfLines = selenium.getXpathCount(LOC_TABLE_LINES).intValue();
- // click line nr. 1 in the table
- selenium.click(table + "/tr[1]");
- // click the 'Last' button (1,2,..,last-1,last --> 2,..,last,1)
- selenium.click(buttons + "/div[7]");
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- after[0] = selenium.getText(table + "/tr[1]/td[1]");
- after[1] = selenium.getText(table + "/tr[" + (countOfLines - 1)
- + "]/td[1]");
- after[2] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ // click line nr. 1 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ // click the 'Last' button (1,2,..,last-1,last --> 2,..,last,1)
+ selenium.click(LOC_BUTTON_LAST);
- assertEquals(after[0], before[1],
- "The second line should be now first.");
- assertEquals(after[1], before[2],
- "The last line should be now last but one.");
- assertEquals(after[2], before[0], "The first line should be now last.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 1));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- @Test
- public void testLastMultipleFilesShift() {
- String[] before = new String[4];
- String[] after = new String[4];
- int countOfLines = selenium.getXpathCount(table + "/tr").intValue();
+ assertEquals(after[0], before[1], "The second line should be now first.");
+ assertEquals(after[1], before[2], "The last line should be now last but one.");
+ assertEquals(after[2], before[0], "The first line should be now last.");
+ }
- before[0] = selenium.getText(table + "/tr[1]/td[1]");
- before[1] = selenium.getText(table + "/tr[2]/td[1]");
- before[2] = selenium.getText(table + "/tr[3]/td[1]");
- before[3] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ /**
+ * Tests the button last for multiple songs selected using Shift key.
+ */
+ @Test
+ public void testLastMultipleSongsShift() {
+ String[] before = new String[4];
+ String[] after = new String[4];
+ int countOfLines = selenium.getXpathCount(LOC_TABLE_LINES).intValue();
- // click line nr. 1 and 2 in the table
- selenium.click(table + "/tr[1]");
- selenium.shiftKeyDown();
- selenium.click(table + "/tr[2]");
- selenium.shiftKeyUp();
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 3));
+ before[3] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- // click the 'Last' button (1,2,3,..,last --> 3,..,last,1,2)
- selenium.click(buttons + "/div[7]");
+ // click line nr. 1 and 2 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ selenium.shiftKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ selenium.shiftKeyUp();
- after[0] = selenium.getText(table + "/tr[1]/td[1]");
- after[1] = selenium.getText(table + "/tr[" + (countOfLines - 2)
- + "]/td[1]");
- after[2] = selenium.getText(table + "/tr[" + (countOfLines - 1)
- + "]/td[1]");
- after[3] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ // click the 'Last' button (1,2,3,..,last --> 3,..,last,1,2)
+ selenium.click(LOC_BUTTON_LAST);
- assertEquals(after[0], before[2], "The third line should be now first.");
- assertEquals(after[1], before[3],
- "The last line should be now last but two.");
- assertEquals(after[2], before[0],
- "The first line should be now last but one.");
- assertEquals(after[3], before[1], "The second line should be now last.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 2));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 1));
+ after[3] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- @Test
- public void testLastMultipleFilesCtrl() {
- String[] before = new String[4];
- String[] after = new String[4];
- int countOfLines = selenium.getXpathCount(table + "/tr").intValue();
+ assertEquals(after[0], before[2], "The third line should be now first.");
+ assertEquals(after[1], before[3], "The last line should be now last but two.");
+ assertEquals(after[2], before[0], "The first line should be now last but one.");
+ assertEquals(after[3], before[1], "The second line should be now last.");
+ }
- before[0] = selenium.getText(table + "/tr[1]/td[1]");
- before[1] = selenium.getText(table + "/tr[2]/td[1]");
- before[2] = selenium.getText(table + "/tr[3]/td[1]");
- before[3] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ /**
+ * Tests the button last for multiple songs selected using Ctrl key.
+ */
+ @Test
+ public void testLastMultipleSongsCtrl() {
+ String[] before = new String[4];
+ String[] after = new String[4];
+ int countOfLines = selenium.getXpathCount(LOC_TABLE_LINES).intValue();
- // click line nr. 1 and 2 in the table
- selenium.click(table + "/tr[1]");
- selenium.controlKeyDown();
- selenium.click(table + "/tr[2]");
- selenium.controlKeyUp();
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 3));
+ before[3] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- // click the 'Last' button (1,2,3,..,last --> 3,..,last,1,2)
- selenium.click(buttons + "/div[7]");
+ // click line nr. 1 and 2 in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ selenium.controlKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ selenium.controlKeyUp();
- after[0] = selenium.getText(table + "/tr[1]/td[1]");
- after[1] = selenium.getText(table + "/tr[" + (countOfLines - 2)
- + "]/td[1]");
- after[2] = selenium.getText(table + "/tr[" + (countOfLines - 1)
- + "]/td[1]");
- after[3] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ // click the 'Last' button (1,2,3,..,last --> 3,..,last,1,2)
+ selenium.click(LOC_BUTTON_LAST);
- assertEquals(after[0], before[2], "The third line should be now first.");
- assertEquals(after[1], before[3],
- "The last line should be now last but two.");
- assertEquals(after[2], before[0],
- "The first line should be now last but one.");
- assertEquals(after[3], before[1], "The second line should be now last.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 2));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 1));
+ after[3] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- @Test
- public void testFirstSingleFile() {
- String[] before = new String[3];
- String[] after = new String[3];
- int countOfLines = selenium.getXpathCount(table + "/tr").intValue();
+ assertEquals(after[0], before[2], "The third line should be now first.");
+ assertEquals(after[1], before[3], "The last line should be now last but two.");
+ assertEquals(after[2], before[0], "The first line should be now last but one.");
+ assertEquals(after[3], before[1], "The second line should be now last.");
+ }
- before[0] = selenium.getText(table + "/tr[1]/td[1]");
- before[1] = selenium.getText(table + "/tr[" + (countOfLines - 1)
- + "]/td[1]");
- before[2] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ /**
+ * Tests the button first for a single song.
+ */
+ @Test
+ public void testFirstSingleSong() {
+ String[] before = new String[3];
+ String[] after = new String[3];
+ int countOfLines = selenium.getXpathCount(LOC_TABLE_LINES).intValue();
- // click the last line in the table
- selenium.click(table + "/tr[" + countOfLines + "]");
- // click the 'First' button (1...last-1,last --> last,1...last-1)
- selenium.click(buttons + "/div[1]");
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 1));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- after[0] = selenium.getText(table + "/tr[1]/td[1]");
- after[1] = selenium.getText(table + "/tr[2]/td[1]");
- after[2] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ // click the last line in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
+ // click the 'First' button (1...last-1,last --> last,1...last-1)
+ selenium.click(LOC_BUTTON_FIRST);
- assertEquals(after[0], before[2],
- "The second line should be now first.");
- assertEquals(after[1], before[0],
- "The first line should be now second.");
- assertEquals(after[2], before[1],
- "The last but one line should be now last.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- @Test
- public void testFirstMultipleFilesShift() {
- String[] before = new String[4];
- String[] after = new String[4];
- int countOfLines = selenium.getXpathCount(table + "/tr").intValue();
+ assertEquals(after[0], before[2], "The second line should be now first.");
+ assertEquals(after[1], before[0], "The first line should be now second.");
+ assertEquals(after[2], before[1], "The last but one line should be now last.");
+ }
- before[0] = selenium.getText(table + "/tr[1]/td[1]");
- before[1] = selenium.getText(table + "/tr[" + (countOfLines - 2)
- + "]/td[1]");
- before[2] = selenium.getText(table + "/tr[" + (countOfLines - 1)
- + "]/td[1]");
- before[3] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ /**
+ * Tests the button first for multiple songs selected using Shift key.
+ */
+ @Test
+ public void testFirstMultipleSongsShift() {
+ String[] before = new String[4];
+ String[] after = new String[4];
+ int countOfLines = selenium.getXpathCount(LOC_TABLE_LINES).intValue();
- // click last 2 lines in the table
- selenium.click(table + "/tr[" + (countOfLines - 1) + "]");
- selenium.shiftKeyDown();
- selenium.click(table + "/tr[" + countOfLines + "]");
- selenium.shiftKeyUp();
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 2));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 1));
+ before[3] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- // click the 'First' button (1...last-2,last-1,last -->
- // last-1,last,1...last-2)
- selenium.click(buttons + "/div[1]");
+ // click last 2 lines in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 1));
+ selenium.shiftKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
+ selenium.shiftKeyUp();
- after[0] = selenium.getText(table + "/tr[1]/td[1]");
- after[1] = selenium.getText(table + "/tr[2]/td[1]");
- after[2] = selenium.getText(table + "/tr[3]/td[1]");
- after[3] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ // click the 'First' button (1...last-2,last-1,last -->
+ // last-1,last,1...last-2)
+ selenium.click(LOC_BUTTON_FIRST);
- assertEquals(after[0], before[2],
- "The last but one line should be now first.");
- assertEquals(after[1], before[3], "The last line should be now second.");
- assertEquals(after[2], before[0], "The first line should be now third.");
- assertEquals(after[3], before[1],
- "The last but two line should be now last.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 3));
+ after[3] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- @Test
- public void testFirstMultipleFilesCtrl() {
- String[] before = new String[4];
- String[] after = new String[4];
- int countOfLines = selenium.getXpathCount(table + "/tr").intValue();
+ assertEquals(after[0], before[2], "The last but one line should be now first.");
+ assertEquals(after[1], before[3], "The last line should be now second.");
+ assertEquals(after[2], before[0], "The first line should be now third.");
+ assertEquals(after[3], before[1], "The last but two line should be now last.");
+ }
- before[0] = selenium.getText(table + "/tr[1]/td[1]");
- before[1] = selenium.getText(table + "/tr[" + (countOfLines - 2)
- + "]/td[1]");
- before[2] = selenium.getText(table + "/tr[" + (countOfLines - 1)
- + "]/td[1]");
- before[3] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ /**
+ * Tests the button first for multiple songs selected using Ctrl key.
+ */
+ @Test
+ public void testFirstMultipleSongsCtrl() {
+ String[] before = new String[4];
+ String[] after = new String[4];
+ int countOfLines = selenium.getXpathCount(LOC_TABLE_LINES).intValue();
- // click last 2 lines in the table
- selenium.click(table + "/tr[" + (countOfLines - 1) + "]");
- selenium.controlKeyDown();
- selenium.click(table + "/tr[" + countOfLines + "]");
- selenium.controlKeyUp();
+ before[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ before[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 2));
+ before[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 1));
+ before[3] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- // click the 'First' button (1...last-2,last-1,last -->
- // last-1,last,1...last-2)
- selenium.click(buttons + "/div[1]");
+ // click last 2 lines in the table
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines - 1));
+ selenium.controlKeyDown();
+ selenium.click(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
+ selenium.controlKeyUp();
- after[0] = selenium.getText(table + "/tr[1]/td[1]");
- after[1] = selenium.getText(table + "/tr[2]/td[1]");
- after[2] = selenium.getText(table + "/tr[3]/td[1]");
- after[3] = selenium.getText(table + "/tr[" + countOfLines + "]/td[1]");
+ // click the 'First' button (1...last-2,last-1,last -->
+ // last-1,last,1...last-2)
+ selenium.click(LOC_BUTTON_FIRST);
- assertEquals(after[0], before[2],
- "The last but one line should be now first.");
- assertEquals(after[1], before[3], "The last line should be now second.");
- assertEquals(after[2], before[0], "The first line should be now third.");
- assertEquals(after[3], before[1],
- "The last but two line should be now last.");
- }
+ after[0] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 1));
+ after[1] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 2));
+ after[2] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, 3));
+ after[3] = selenium.getText(format(LOC_TABLE_LINE_PREFORMATTED, countOfLines));
- @Test
- public void testOrderingListSource() {
- abstractTestSource(1, 1, "<", "ui:composition");
- }
+ assertEquals(after[0], before[2], "The last but one line should be now first.");
+ assertEquals(after[1], before[3], "The last line should be now second.");
+ assertEquals(after[2], before[0], "The first line should be now third.");
+ assertEquals(after[3], before[1], "The last but two line should be now last.");
+ }
- /**
- * Loads the needed page and makes us sure that no lines are selected.
- */
- @BeforeMethod
- private void loadPage() {
- super.loadPage("richSelect", 2,
- "orderingList component allows to reorder items in a list.");
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 5 lines of source code.
+ */
+ @Test
+ public void testExampleSource() {
+ String[] strings = new String[] {
+ "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<h:panelGrid columns=\"2\" columnClasses=\"top 70per, top 30per\" width=\"100%\">",
+ "<rich:orderingList value=\"#{library.songsList}\" var=\"lib\" listHeight=\"300\" listWidth=\"350\" converter=\"orderingListConverter\" selection=\"#{library.selectedSongsSet}\">",
+ " <rich:column width=\"180\">",
+ "<f:facet name=\"header\">",
+ "<h:outputText value=\"#{lib.title}\"></h:outputText>",
+ " <a4j:support event=\"onclick\" ignoreDupResponses=\"true\" requestDelay=\"500\" action=\"#{library.takeSelection}\" reRender=\"output\"/>",
+ "<a4j:support event=\"onkeyup\" ignoreDupResponses=\"true\" requestDelay=\"500\" action=\"#{library.takeSelection}\" reRender=\"output\"/>",
+ "<rich:panel id=\"output\" header=\"Current Selection\" style=\"width:200px\">",
+ "<rich:dataList value=\"#{library.selectedSongsList}\" var=\"song\" rendered=\"#{not empty library.selectedSongsList}\">",
+ "<h:outputText value=\"#{song.title}\"></h:outputText>",
+ "<h:outputText value=\"No Songs Selected\" rendered=\"#{empty library.selectedSongsList}\"/>", };
- // ensure that no lines will be selected
- selenium.click(table + "/tr[1]");
- selenium.controlKeyDown();
- selenium.click(table + "/tr[1]");
- selenium.controlKeyUp();
- }
+ abstractTestSource(1, "View Source", strings);
+ }
+
+ /**
+ * Loads the page containing needed component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Ordering List");
+ scrollIntoView(LOC_EXAMPLE_HEADER, true);
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/paint2d/Paint2DTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,22 +1,23 @@
-/**
- * License Agreement.
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces
+ * 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.
*
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful,
+ * 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
+ * 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 code; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 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.jboss.richfaces.integrationTest.paint2d;
@@ -25,7 +26,6 @@
import static org.testng.Assert.fail;
import java.io.IOException;
-import java.security.NoSuchAlgorithmException;
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.jboss.test.selenium.utils.URLUtils;
@@ -41,12 +41,38 @@
public class Paint2DTestCase extends AbstractSeleniumRichfacesTestCase {
// messages
- private final String MSG_TEXT_IN_IMAGE = getMsg("TEXT_IN_IMAGE");
- private final String MSG_COLOR_OF_IMAGE = getMsg("COLOR_OF_IMAGE");
- private final String MSG_SHADOW_SIZE = getMsg("SHADOW_SIZE");
- private final String MSG_POSITION_OF_SLIDERS_HANDLE = getMsg("POSITION_OF_SLIDERS_HANDLE");
- private final String MSG_IMAGE_HASH = getMsg("IMAGE_HASH");
+ private final String MSG_INITIAL_STATE_INPUT_TEXT = getMsg("INITIAL_STATE_INPUT_TEXT");
+ private final String MSG_INITIAL_STATE_INPUT_COLOR = getMsg("INITIAL_STATE_INPUT_COLOR");
+ private final int MSG_INITIAL_STATE_SHADOW_SLIDER_HANDLE = Integer
+ .parseInt(getMsg("INITIAL_STATE_SHADOW_SLIDER_HANDLE"));
+ private final String MSG_INITIAL_STATE_HASH = getMsg("INITIAL_STATE_HASH");
+ private final String MSG_CHANGE_TEXT_HASH_1 = getMsg("CHANGE_TEXT_HASH_1");
+ private final String MSG_CHANGE_TEXT_HASH_2 = getMsg("CHANGE_TEXT_HASH_2");
+
+ private final String MSG_CHANGE_COLOR_HASH_1 = getMsg("CHANGE_COLOR_HASH_1");
+ private final String MSG_CHANGE_COLOR_HASH_2 = getMsg("CHANGE_COLOR_HASH_2");
+
+ private final int MSG_CHANGE_SHADOW_SLIDER_HANDLE_1 = Integer.parseInt(getMsg("CHANGE_SHADOW_SLIDER_HANDLE_1"));
+ private final int MSG_CHANGE_SHADOW_SLIDER_HANDLE_2 = Integer.parseInt(getMsg("CHANGE_SHADOW_SLIDER_HANDLE_2"));
+ private final int MSG_CHANGE_SHADOW_SLIDER_HANDLE_3 = Integer.parseInt(getMsg("CHANGE_SHADOW_SLIDER_HANDLE_3"));
+ private final String MSG_CHANGE_SHADOW_HASH_1 = getMsg("CHANGE_SHADOW_HASH_1");
+ private final String MSG_CHANGE_SHADOW_HASH_2 = getMsg("CHANGE_SHADOW_HASH_2");
+ private final String MSG_CHANGE_SHADOW_HASH_3 = getMsg("CHANGE_SHADOW_HASH_3");
+
+ private final String MSG_CHANGE_TEXT_AND_COLOR_HASH = getMsg("CHANGE_TEXT_AND_COLOR_HASH");
+
+ private final String MSG_CHANGE_TEXT_AND_SHADOW_HASH = getMsg("CHANGE_TEXT_AND_SHADOW_HASH");
+ private final int MSG_CHANGE_TEXT_AND_SHADOW_SLIDER_HANDLE = Integer
+ .parseInt(getMsg("CHANGE_TEXT_AND_SHADOW_SLIDER_HANDLE"));
+
+ private final int MSG_CHANGE_COLOR_AND_SHADOW_SLIDER_HANDLE = Integer
+ .parseInt(getMsg("CHANGE_COLOR_AND_SHADOW_SLIDER_HANDLE"));
+ private final String MSG_CHANGE_COLOR_AND_SHADOW_HASH = getMsg("CHANGE_COLOR_AND_SHADOW_HASH");
+
+ private final int MSG_CHANGE_ALL_SLIDER_HANDLE = Integer.parseInt(getMsg("CHANGE_ALL_SLIDER_HANDLE"));
+ private final String MSG_CHANGE_ALL_HASH = getMsg("CHANGE_ALL_HASH");
+
// locators
private final String LOC_EXAMPLE_HEADER = getLoc("EXAMPLE_HEADER");
private final String LOC_INPUT_TEXT = getLoc("INPUT_TEXT");
@@ -64,15 +90,15 @@
@Test
public void testInitialState() {
String text = selenium.getValue(LOC_INPUT_TEXT);
- assertEquals(text, "Paint 2D", MSG_TEXT_IN_IMAGE);
+ assertEquals(text, MSG_INITIAL_STATE_INPUT_TEXT, "Text in the image.");
text = selenium.getValue(LOC_INPUT_COLOR);
- assertEquals(text, "0003e8", MSG_COLOR_OF_IMAGE);
+ assertEquals(text, MSG_INITIAL_STATE_INPUT_COLOR, "Color of the image.");
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
- assertEquals(position, 127, MSG_SHADOW_SIZE);
+ assertEquals(position, MSG_INITIAL_STATE_SHADOW_SLIDER_HANDLE, "Size of the shadow.");
- assertImageHash("da54ff0e62ee33804e270a863d7001a4");
+ assertImageHash(MSG_INITIAL_STATE_HASH);
}
/**
@@ -83,12 +109,12 @@
selenium.type(LOC_INPUT_TEXT, "XoXoXoXoX");
selenium.typeKeys(LOC_INPUT_TEXT, " "); // why is this necessary?
waitFor(1500);
- assertImageHash("490d3b23e3f8c19290d3fbe351409be");
+ assertImageHash(MSG_CHANGE_TEXT_HASH_1);
selenium.type(LOC_INPUT_TEXT, "Red Hat");
selenium.typeKeys(LOC_INPUT_TEXT, " "); // why is this necessary?
waitFor(1500);
- assertImageHash("f56c23afa5207cfdea008d298480c750");
+ assertImageHash(MSG_CHANGE_TEXT_HASH_2);
}
/**
@@ -100,13 +126,13 @@
selenium.click(LOC_BUTTON_APPLY_COLOR);
waitFor(1500);
- assertImageHash("8f71bfc38cf5a26cdd548d3bb0f67291");
+ assertImageHash(MSG_CHANGE_COLOR_HASH_1);
selenium.type(LOC_INPUT_COLOR, "00ffbb");
selenium.click(LOC_BUTTON_APPLY_COLOR);
waitFor(1500);
- assertImageHash("6623c69f0397e00a955ed6bbb41e68e1");
+ assertImageHash(MSG_CHANGE_COLOR_HASH_2);
}
/**
@@ -117,26 +143,26 @@
selenium.mouseDownAt(LOC_SHADOW_SLIDER, "0,0");
selenium.mouseUp(LOC_SHADOW_SLIDER);
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
- assertEquals(position, 0, MSG_POSITION_OF_SLIDERS_HANDLE);
+ assertEquals(position, MSG_CHANGE_SHADOW_SLIDER_HANDLE_1, "Position of the slider's handle.");
waitFor(1500);
- assertImageHash("6f15cab627ffd32528a66ef9731990a2");
+ assertImageHash(MSG_CHANGE_SHADOW_HASH_1);
selenium.mouseDownAt(LOC_SHADOW_SLIDER, "96,0");
selenium.mouseUp(LOC_SHADOW_SLIDER);
position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
- assertEquals(position, 96, MSG_POSITION_OF_SLIDERS_HANDLE);
+ assertEquals(position, MSG_CHANGE_SHADOW_SLIDER_HANDLE_2, "Position of the slider's handle.");
waitFor(1500);
- assertImageHash("19063b8ea31e2939699abd7dc92cf23e");
+ assertImageHash(MSG_CHANGE_SHADOW_HASH_2);
selenium.mouseDownAt(LOC_SHADOW_SLIDER, "191,0");
selenium.mouseUp(LOC_SHADOW_SLIDER);
position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
- assertEquals(position, 191, MSG_POSITION_OF_SLIDERS_HANDLE);
+ assertEquals(position, MSG_CHANGE_SHADOW_SLIDER_HANDLE_3, "Position of the slider's handle.");
waitFor(1500);
- assertImageHash("d9e5b2f628d230b7dc41b8ece16a83ff");
+ assertImageHash(MSG_CHANGE_SHADOW_HASH_3);
}
/**
@@ -150,7 +176,7 @@
selenium.click(LOC_BUTTON_APPLY_COLOR);
waitFor(1500);
- assertImageHash("a18ff3c5c86154fc1c3ca2a59e60bbbf");
+ assertImageHash(MSG_CHANGE_TEXT_AND_COLOR_HASH);
}
/**
@@ -163,10 +189,10 @@
selenium.mouseDownAt(LOC_SHADOW_SLIDER, "159,0");
selenium.mouseUp(LOC_SHADOW_SLIDER);
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
- assertEquals(position, 159, MSG_POSITION_OF_SLIDERS_HANDLE);
+ assertEquals(position, MSG_CHANGE_TEXT_AND_SHADOW_SLIDER_HANDLE, "Position of the slider's handle.");
waitFor(1500);
- assertImageHash("74e992e595303a2f16c72a178a116189");
+ assertImageHash(MSG_CHANGE_TEXT_AND_SHADOW_HASH);
}
/**
@@ -180,10 +206,10 @@
selenium.mouseDownAt(LOC_SHADOW_SLIDER, "96,0");
selenium.mouseUp(LOC_SHADOW_SLIDER);
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
- assertEquals(position, 96, MSG_POSITION_OF_SLIDERS_HANDLE);
+ assertEquals(position, MSG_CHANGE_COLOR_AND_SHADOW_SLIDER_HANDLE, "Position of the slider's handle.");
waitFor(1500);
- assertImageHash("fd6a4503b768b0a197851b78948b497c");
+ assertImageHash(MSG_CHANGE_COLOR_AND_SHADOW_HASH);
}
/**
@@ -199,10 +225,10 @@
selenium.mouseDownAt(LOC_SHADOW_SLIDER, "127,0");
selenium.mouseUp(LOC_SHADOW_SLIDER);
int position = Integer.parseInt(getStyle(LOC_SHADOW_SLIDER_HANDLE, "left").replace("px", ""));
- assertEquals(position, 127, MSG_POSITION_OF_SLIDERS_HANDLE);
+ assertEquals(position, MSG_CHANGE_ALL_SLIDER_HANDLE, "Position of the slider's handle.");
waitFor(1500);
- assertImageHash("f2016d2528b7d288f752bdaaefc7a666");
+ assertImageHash(MSG_CHANGE_ALL_HASH);
}
/**
@@ -264,12 +290,13 @@
fail(e.getMessage());
}
- assertEquals(tmp, hashCode, MSG_IMAGE_HASH);
+ assertEquals(tmp, hashCode, "Hash of the image.");
}
/**
* Loads the page containing the component.
*/
+ @SuppressWarnings("unused")
@BeforeMethod
private void loadPage() {
openComponent("Paint2D");
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panel/PanelCustomizationTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panel/PanelCustomizationTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panel/PanelCustomizationTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,22 +1,23 @@
-/**
- * License Agreement.
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces
+ * 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.
*
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful,
+ * 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
+ * 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 code; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 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.jboss.richfaces.integrationTest.panel;
@@ -37,12 +38,15 @@
public class PanelCustomizationTestCase extends AbstractSeleniumRichfacesTestCase {
// messages
- private final String MSG_CUST_PANEL_HEADER = getMsg("CUST_PANEL_HEADER");
- private final String MSG_CUST_CLASS_HEADER = getMsg("CUST_CLASS_HEADER");
- private final String MSG_CUST_THIRD_HEADER = getMsg("CUST_THIRD_HEADER");
- private final String MSG_CUST_THIRD_BODY = getMsg("CUST_THIRD_BODY");
- private final String MSG_CUST_FOURTH_PANEL_BODY_SCROLLABLE = getMsg("CUST_FOURTH_PANEL_BODY_SCROLLABLE");
- private final String MSG_CUST_FIFTH_PANEL_NO_HEADER = getMsg("CUST_FIFTH_PANEL_NO_HEADER");
+ private final String MSG_CUST_FIRST_HEADER = getMsg("CUST_FIRST_HEADER");
+ private final String MSG_CUST_FIRST_CLASS = getMsg("CUST_FIRST_CLASS");
+ private final String MSG_CUST_SECOND_HEADER = getMsg("CUST_SECOND_HEADER");
+ private final String MSG_CUST_SECOND_CLASS = getMsg("CUST_SECOND_CLASS");
+ private final String MSG_CUST_THIRD_CLASS_1 = getMsg("CUST_THIRD_CLASS_1");
+ private final String MSG_CUST_THIRD_CLASS_2 = getMsg("CUST_THIRD_CLASS_2");
+ private final String MSG_CUST_FOURTH_HEADER = getMsg("CUST_FOURTH_HEADER");
+ private final String MSG_CUST_FOURTH_CLASS = getMsg("CUST_FOURTH_CLASS");
+ private final int MSG_CUST_FIFTH_COUNT = Integer.parseInt(getMsg("CUST_FIFTH_COUNT"));
// locators
private final String LOC_CUST_FIRST_PANEL_HEADER = getLoc("CUST_FIRST_PANEL_HEADER");
@@ -53,51 +57,63 @@
private final String LOC_CUST_FOURTH_PANEL_HEADER = getLoc("CUST_FOURTH_PANEL_HEADER");
private final String LOC_CUST_FIFTH_PANEL_PARTS = getLoc("CUST_FIFTH_PANEL_PARTS");
+ /**
+ * Tests first panel. It checks panel header's text and class attribute.
+ */
@Test
public void testFirstPanel() {
String text = selenium.getText(LOC_CUST_FIRST_PANEL_HEADER);
- assertEquals(text, "Panel #1. Changing Style Synchronously", MSG_CUST_PANEL_HEADER);
-
- text = selenium.getAttribute(LOC_CUST_FIRST_PANEL_HEADER + "@class");
- assertTrue(text.contains("rich-panel-header"), MSG_CUST_CLASS_HEADER);
+ assertEquals(text, MSG_CUST_FIRST_HEADER, "Header of the panel.");
+ assertTrue(belongsClass(MSG_CUST_FIRST_CLASS, LOC_CUST_FIRST_PANEL_HEADER),
+ "The \"class\" attribute of the header should contain \"rich-panel-header\".");
}
+ /**
+ * Tests second panel. It checks panel header's text and class attribute.
+ */
@Test
public void testSecondPanel() {
String text = selenium.getText(LOC_CUST_SECOND_PANEL_HEADER);
- assertEquals(text, "Panel #2. Changing Style Synchronously", MSG_CUST_PANEL_HEADER);
-
- text = selenium.getAttribute(LOC_CUST_SECOND_PANEL_HEADER + "@class");
- assertTrue(text.contains("rich-panel-header"), MSG_CUST_CLASS_HEADER);
+ assertEquals(text, MSG_CUST_SECOND_HEADER, "Header of the panel.");
+ assertTrue(belongsClass(MSG_CUST_SECOND_CLASS, LOC_CUST_SECOND_PANEL_HEADER),
+ "The \"class\" attribute of the header should contain \"rich-panel-header\".");
}
+ /**
+ * Tests third panel. It checks that both header and body are green.
+ */
@Test
public void testThirdPanel() {
- String text = selenium.getAttribute(LOC_CUST_THIRD_PANEL_HEADER + "@class");
- assertTrue(text.contains("head2"), MSG_CUST_THIRD_HEADER);
-
- text = selenium.getAttribute(LOC_CUST_THIRD_PANEL_BODY + "@class");
- assertTrue(text.contains("body3"), MSG_CUST_THIRD_BODY);
+ assertTrue(belongsClass(MSG_CUST_THIRD_CLASS_1, LOC_CUST_THIRD_PANEL_HEADER),
+ "Header of the third panel should be green -- its class attribute has to contain \"head2\".");
+ assertTrue(belongsClass(MSG_CUST_THIRD_CLASS_2, LOC_CUST_THIRD_PANEL_BODY),
+ "Body of the third panel should be green -- its class attribute has to contain \"body3\".");
}
+ /**
+ * Tests fourth panel. It checks panel's header and that it is scrollable.
+ */
@Test
public void testFourthPanel() {
String text = selenium.getText(LOC_CUST_FOURTH_PANEL_HEADER);
- assertEquals(text, "Scrolling Text Panel", MSG_CUST_PANEL_HEADER);
-
- text = selenium.getAttribute(LOC_CUST_FOURTH_PANEL_BODY + "@class");
- assertTrue(text.contains("body3"), MSG_CUST_FOURTH_PANEL_BODY_SCROLLABLE);
+ assertEquals(text, MSG_CUST_FOURTH_HEADER, "Header of the panel.");
+ assertTrue(belongsClass(MSG_CUST_FOURTH_CLASS, LOC_CUST_FOURTH_PANEL_BODY),
+ "Body of the fourth panel should be scrollable -- its class attribute has to contain \"body3\".");
}
+ /**
+ * Tests fifth panel. It checks that the panel has no header.
+ */
@Test
public void testFifthPanel() {
int count = selenium.getXpathCount(LOC_CUST_FIFTH_PANEL_PARTS).intValue();
- assertEquals(count, 1, MSG_CUST_FIFTH_PANEL_NO_HEADER);
+ assertEquals(count, MSG_CUST_FIFTH_COUNT, "The fifth panel should have no header.");
}
/**
* Loads the page containing the component.
*/
+ @SuppressWarnings("unused")
@BeforeMethod
private void loadPage() {
openComponent("Panel");
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panel/PanelTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panel/PanelTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panel/PanelTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,22 +1,23 @@
-/**
- * License Agreement.
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces
+ * 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.
*
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful,
+ * 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
+ * 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 code; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 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.jboss.richfaces.integrationTest.panel;
@@ -35,134 +36,123 @@
*/
public class PanelTestCase extends AbstractSeleniumRichfacesTestCase {
- // messages
- private final String MSG_FIRST_PANEL_TWO_PARTS = getMsg("FIRST_PANEL_TWO_PARTS");
- private final String MSG_FIRST_HEADER = getMsg("FIRST_HEADER");
- private final String MSG_SECOND_PANEL_NO_HEADER = getMsg("SECOND_PANEL_NO_HEADER");
- private final String MSG_THIRD_PANEL_TWO_PARTS = getMsg("THIRD_PANEL_TWO_PARTS");
- private final String MSG_SHOULD_BE_TWO_NESTED_PANELS = getMsg("SHOULD_BE_TWO_NESTED_PANELS");
- private final String MSG_SIX_ITEMS_IN_LIST_LEFT = getMsg("SIX_ITEMS_IN_LIST_LEFT");
- private final String MSG_SIX_ITEMS_IN_LIST_RIGHT = getMsg("SIX_ITEMS_IN_LIST_RIGHT");
- private final String MSG_THIRD_HEADER = getMsg("THIRD_HEADER");
+ // messages
+ private final String MSG_FIRST_PANEL_TWO_PARTS = getMsg("FIRST_PANEL_TWO_PARTS");
+ private final String MSG_FIRST_HEADER = getMsg("FIRST_HEADER");
+ private final String MSG_SECOND_PANEL_NO_HEADER = getMsg("SECOND_PANEL_NO_HEADER");
+ private final String MSG_THIRD_PANEL_TWO_PARTS = getMsg("THIRD_PANEL_TWO_PARTS");
+ private final String MSG_SHOULD_BE_TWO_NESTED_PANELS = getMsg("SHOULD_BE_TWO_NESTED_PANELS");
+ private final String MSG_SIX_ITEMS_IN_LIST_LEFT = getMsg("SIX_ITEMS_IN_LIST_LEFT");
+ private final String MSG_SIX_ITEMS_IN_LIST_RIGHT = getMsg("SIX_ITEMS_IN_LIST_RIGHT");
+ private final String MSG_THIRD_HEADER = getMsg("THIRD_HEADER");
- // locators
- private final String LOC_FIRST_DIVS = getLoc("FIRST_DIVS");
- private final String LOC_FIRST_HEADER = getLoc("FIRST_HEADER");
- private final String LOC_SECOND_DIVS = getLoc("SECOND_DIVS");
- private final String LOC_THIRD_DIVS = getLoc("THIRD_DIVS");
- private final String LOC_THIRD_HEADER = getLoc("THIRD_HEADER");
- private final String LOC_THIRD_NESTED_PANELS = getLoc("THIRD_NESTED_PANELS");
- private final String LOC_LEFT_NESTED_PANEL_LIST_LI = getLoc("LEFT_NESTED_PANEL_LIST_LI");
- private final String LOC_RIGHT_NESTED_PANEL_LIST_LI = getLoc("RIGHT_NESTED_PANEL_LIST_LI");
+ // locators
+ private final String LOC_FIRST_DIVS = getLoc("FIRST_DIVS");
+ private final String LOC_FIRST_HEADER = getLoc("FIRST_HEADER");
+ private final String LOC_SECOND_DIVS = getLoc("SECOND_DIVS");
+ private final String LOC_THIRD_DIVS = getLoc("THIRD_DIVS");
+ private final String LOC_THIRD_HEADER = getLoc("THIRD_HEADER");
+ private final String LOC_THIRD_NESTED_PANELS = getLoc("THIRD_NESTED_PANELS");
+ private final String LOC_LEFT_NESTED_PANEL_LIST_LI = getLoc("LEFT_NESTED_PANEL_LIST_LI");
+ private final String LOC_RIGHT_NESTED_PANEL_LIST_LI = getLoc("RIGHT_NESTED_PANEL_LIST_LI");
- /**
- * Tests the first example. It verifies that there are both header and body of the panel.
- * Then it checks the content of the header.
- */
- @Test
- public void testFirstExample() {
- int count = selenium.getXpathCount(LOC_FIRST_DIVS).intValue();
- assertEquals(count, 2, MSG_FIRST_PANEL_TWO_PARTS);
+ /**
+ * Tests the first example. It verifies that there are both header and body
+ * of the panel. Then it checks the content of the header.
+ */
+ @Test
+ public void testFirstExample() {
+ int count = selenium.getXpathCount(LOC_FIRST_DIVS).intValue();
+ assertEquals(count, 2, MSG_FIRST_PANEL_TWO_PARTS);
- String text = selenium.getText(LOC_FIRST_HEADER);
- assertEquals(
- text,
- "Write your own custom rich components with built-in AJAX support",
- MSG_FIRST_HEADER);
- }
+ String text = selenium.getText(LOC_FIRST_HEADER);
+ assertEquals(text, "Write your own custom rich components with built-in AJAX support", MSG_FIRST_HEADER);
+ }
- /**
- * Tests the second example. It verifies that there is no header.
- */
- @Test
- public void testSecondExample() {
- int count = selenium.getXpathCount(LOC_SECOND_DIVS).intValue();
- assertEquals(count, 1, MSG_SECOND_PANEL_NO_HEADER);
- }
+ /**
+ * Tests the second example. It verifies that there is no header.
+ */
+ @Test
+ public void testSecondExample() {
+ int count = selenium.getXpathCount(LOC_SECOND_DIVS).intValue();
+ assertEquals(count, 1, MSG_SECOND_PANEL_NO_HEADER);
+ }
- /**
- * Tests the third example. Verifies that the main panel has both header and body and checks
- * its header. Then it checks the count of nested panels. For both left and right nested
- * panel it checks that there are 6 items in lists.
- */
- @Test
- public void testThirdExample() {
- int count = selenium.getXpathCount(LOC_THIRD_DIVS).intValue();
- assertEquals(count, 2, MSG_THIRD_PANEL_TWO_PARTS);
+ /**
+ * Tests the third example. Verifies that the main panel has both header and
+ * body and checks its header. Then it checks the count of nested panels.
+ * For both left and right nested panel it checks that there are 6 items in
+ * lists.
+ */
+ @Test
+ public void testThirdExample() {
+ int count = selenium.getXpathCount(LOC_THIRD_DIVS).intValue();
+ assertEquals(count, 2, MSG_THIRD_PANEL_TWO_PARTS);
- String text = selenium.getText(LOC_THIRD_HEADER);
- assertEquals(text, "", MSG_THIRD_HEADER);
+ String text = selenium.getText(LOC_THIRD_HEADER);
+ assertEquals(text, "", MSG_THIRD_HEADER);
- count = selenium.getXpathCount(LOC_THIRD_NESTED_PANELS).intValue();
- assertEquals(count, 2, MSG_SHOULD_BE_TWO_NESTED_PANELS);
+ count = selenium.getXpathCount(LOC_THIRD_NESTED_PANELS).intValue();
+ assertEquals(count, 2, MSG_SHOULD_BE_TWO_NESTED_PANELS);
- count = selenium.getXpathCount(LOC_LEFT_NESTED_PANEL_LIST_LI)
- .intValue();
- assertEquals(count, 6, MSG_SIX_ITEMS_IN_LIST_LEFT);
+ count = selenium.getXpathCount(LOC_LEFT_NESTED_PANEL_LIST_LI).intValue();
+ assertEquals(count, 6, MSG_SIX_ITEMS_IN_LIST_LEFT);
- count = selenium.getXpathCount(LOC_RIGHT_NESTED_PANEL_LIST_LI)
- .intValue();
- assertEquals(count, 6, MSG_SIX_ITEMS_IN_LIST_RIGHT);
- }
+ count = selenium.getXpathCount(LOC_RIGHT_NESTED_PANEL_LIST_LI).intValue();
+ assertEquals(count, 6, MSG_SIX_ITEMS_IN_LIST_RIGHT);
+ }
- /**
- * Tests the "View Source" of the first example. It checks that the source
- * code is not visible, clicks on the link, and checks 7 lines of source
- * code.
- */
- @Test
- public void testFirstExampleSource() {
- String[] strings = new String[] {
- "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
- "<rich:panel>",
- "<f:facet name=\"header\">",
- "Write your own custom rich components with built-in AJAX support",
- "The CDK includes a code-generation facility and a",
- "</rich:panel>", "</ui:composition>", };
+ /**
+ * Tests the "View Source" of the first example. It checks that the source
+ * code is not visible, clicks on the link, and checks 7 lines of source
+ * code.
+ */
+ @Test
+ public void testFirstExampleSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"", "<rich:panel>",
+ "<f:facet name=\"header\">", "Write your own custom rich components with built-in AJAX support",
+ "The CDK includes a code-generation facility and a", "</rich:panel>", "</ui:composition>", };
- abstractTestSource(1, "View Source", strings);
- }
+ abstractTestSource(1, "View Source", strings);
+ }
- /**
- * Tests the "View Source" of the second example. It checks that the source
- * code is not visible, clicks on the link, and checks 6 lines of source
- * code.
- */
- @Test
- public void testSecondExampleSource() {
- String[] strings = new String[] {
- "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
- "xmlns:a4j=\"http://richfaces.org/a4j\"",
- "<rich:panel bodyClass=\"rich-laguna-panel-no-header\">",
- "RichFaces is a library for adding rich user interface features to JSF",
- "</rich:panel>", "</ui:composition>", };
+ /**
+ * Tests the "View Source" of the second example. It checks that the source
+ * code is not visible, clicks on the link, and checks 6 lines of source
+ * code.
+ */
+ @Test
+ public void testSecondExampleSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "xmlns:a4j=\"http://richfaces.org/a4j\"", "<rich:panel bodyClass=\"rich-laguna-panel-no-header\">",
+ "RichFaces is a library for adding rich user interface features to JSF", "</rich:panel>",
+ "</ui:composition>", };
- abstractTestSource(2, "View Source", strings);
- }
+ abstractTestSource(2, "View Source", strings);
+ }
- /**
- * Tests the "View Source" of the third example. It checks that the source
- * code is not visible, clicks on the link, and checks 7 lines of source
- * code.
- */
- @Test
- public void testThirdExampleSource() {
- String[] strings = new String[] {
- "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
- "<rich:panel style=\"padding:0\" headerClass=\"outpanelHeader\">",
- "<f:facet name=\"header\">",
- "<h2 align=\"center\"><h:outputText value=\"Benefits of Using Ajax4jsf\" /></h2>",
- "<rich:panel bodyClass=\"inpanelBody\">",
- "<li>Production quality Open Source</li>", "</ui:composition>", };
+ /**
+ * Tests the "View Source" of the third example. It checks that the source
+ * code is not visible, clicks on the link, and checks 7 lines of source
+ * code.
+ */
+ @Test
+ public void testThirdExampleSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<rich:panel style=\"padding:0\" headerClass=\"outpanelHeader\">", "<f:facet name=\"header\">",
+ "<h2 align=\"center\"><h:outputText value=\"Benefits of Using Ajax4jsf\" /></h2>",
+ "<rich:panel bodyClass=\"inpanelBody\">", "<li>Production quality Open Source</li>",
+ "</ui:composition>", };
- abstractTestSource(3, "View Source", strings);
- }
+ abstractTestSource(3, "View Source", strings);
+ }
- /**
- * Loads the page containing the component.
- */
- @BeforeMethod
- private void loadPage() {
- openComponent("Panel");
- }
+ /**
+ * Loads the page containing the component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Panel");
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelBar/PanelBarTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelBar/PanelBarTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelBar/PanelBarTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,22 +1,23 @@
-/**
- * License Agreement.
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces
+ * 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.
*
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This code is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful,
+ * 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
+ * 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 code; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 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.jboss.richfaces.integrationTest.panelBar;
@@ -37,86 +38,83 @@
*/
public class PanelBarTestCase extends AbstractSeleniumRichfacesTestCase {
- // messages
- private final String MSG_HEADER_N = getMsg("HEADER_N");
- private final String MSG_PANEL_N_SHOULD_BE_VISIBLE = getMsg("PANEL_N_SHOULD_BE_VISIBLE");
- private final String MSG_PANEL_N_SHOULD_NOT_BE_VISIBLE = getMsg("PANEL_N_SHOULD_NOT_BE_VISIBLE");
+ // messages
+ private final String MSG_HEADER_N = getMsg("HEADER_N");
+ private final String MSG_PANEL_N_SHOULD_BE_VISIBLE = getMsg("PANEL_N_SHOULD_BE_VISIBLE");
+ private final String MSG_PANEL_N_SHOULD_NOT_BE_VISIBLE = getMsg("PANEL_N_SHOULD_NOT_BE_VISIBLE");
- // locators
- private final String LOC_EXAMPLE_HEADER = getLoc("EXAMPLE_HEADER");
- private final String LOC_HEADER_1_N = getLoc("HEADER_1_N");
- private final String LOC_HEADER_2_N = getLoc("HEADER_2_N");
- private final String LOC_CONTENT_N = getLoc("CONTENT_N");
+ // locators
+ private final String LOC_EXAMPLE_HEADER = getLoc("EXAMPLE_HEADER");
+ private final String LOC_HEADER_1_N = getLoc("HEADER_1_N");
+ private final String LOC_HEADER_2_N = getLoc("HEADER_2_N");
+ private final String LOC_CONTENT_N = getLoc("CONTENT_N");
- /**
- * Tests all components as they appear after page is loaded.
- */
- @Test
- public void testInitialState() {
- String[] headers = new String[] {
- "Leverage the whole set of JSF benefits while working with AJAX",
- "Add AJAX capability to existing JSF applications",
- "Write your own custom rich components with built-in AJAX support",
- "Package resources with the application's Java classes",
- "Easily generate images on-the-fly",
- "Create a modern rich user interface look-and-feel with skins-based technology",
- "Test the components, actions, listeners, and pages as you are creating them" };
+ /**
+ * Tests all components as they appear after page is loaded.
+ */
+ @Test
+ public void testInitialState() {
+ String[] headers = new String[] { "Leverage the whole set of JSF benefits while working with AJAX",
+ "Add AJAX capability to existing JSF applications",
+ "Write your own custom rich components with built-in AJAX support",
+ "Package resources with the application's Java classes", "Easily generate images on-the-fly",
+ "Create a modern rich user interface look-and-feel with skins-based technology",
+ "Test the components, actions, listeners, and pages as you are creating them" };
String text = selenium.getText(format(LOC_HEADER_2_N, 1));
- assertEquals(text, headers[0], format(MSG_HEADER_N, 1));
- assertTrue(isDisplayed(format(LOC_CONTENT_N, 1)), format(MSG_PANEL_N_SHOULD_BE_VISIBLE, 1));
+ assertEquals(text, headers[0], format(MSG_HEADER_N, 1));
+ assertTrue(isDisplayed(format(LOC_CONTENT_N, 1)), format(MSG_PANEL_N_SHOULD_BE_VISIBLE, 1));
- for (int i = 2; i < 8; i++) {
- text = selenium.getText(format(LOC_HEADER_1_N, i));
- assertEquals(text, headers[i - 1], format(MSG_HEADER_N, i));
- assertFalse(isDisplayed(format(LOC_CONTENT_N, i)), format(MSG_PANEL_N_SHOULD_NOT_BE_VISIBLE, i));
- }
- }
+ for (int i = 2; i < 8; i++) {
+ text = selenium.getText(format(LOC_HEADER_1_N, i));
+ assertEquals(text, headers[i - 1], format(MSG_HEADER_N, i));
+ assertFalse(isDisplayed(format(LOC_CONTENT_N, i)), format(MSG_PANEL_N_SHOULD_NOT_BE_VISIBLE, i));
+ }
+ }
- /**
- * Tests expanding each panel. It verifies that the clicked panel is visible
- * and that none of the other panels is visible.
- */
- @Test
- public void testExpanding() {
- for (int i = 7; i > 0; i--) {
- selenium.click(format(LOC_HEADER_1_N, i));
+ /**
+ * Tests expanding each panel. It verifies that the clicked panel is visible
+ * and that none of the other panels is visible.
+ */
+ @Test
+ public void testExpanding() {
+ for (int i = 7; i > 0; i--) {
+ selenium.click(format(LOC_HEADER_1_N, i));
- // check that clicked panel is visible
- assertTrue(isDisplayed(format(LOC_CONTENT_N, i)), format(MSG_PANEL_N_SHOULD_BE_VISIBLE, i));
+ // check that clicked panel is visible
+ assertTrue(isDisplayed(format(LOC_CONTENT_N, i)), format(MSG_PANEL_N_SHOULD_BE_VISIBLE, i));
- // check that other panel are not visible
- for (int j = 1; j < 8; j++) {
- if (j == i) {
- continue;
- }
- assertFalse(isDisplayed(format(LOC_CONTENT_N, j)), format(MSG_PANEL_N_SHOULD_NOT_BE_VISIBLE, i));
- }
- }
- }
+ // check that other panel are not visible
+ for (int j = 1; j < 8; j++) {
+ if (j == i) {
+ continue;
+ }
+ assertFalse(isDisplayed(format(LOC_CONTENT_N, j)), format(MSG_PANEL_N_SHOULD_NOT_BE_VISIBLE, i));
+ }
+ }
+ }
- /**
- * Tests the "View Source". It checks that the source code is not visible,
- * clicks on the link, and checks 6 lines of source code.
- */
- @Test
- public void testPageSource() {
- String[] strings = new String[] {
- "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
- "<rich:panelBar height=\"400\" width=\"500\">",
- "label=\"Leverage the whole set of JSF benefits while working with AJAX\">",
- "</rich:panelBarItem>", "</rich:panelBar>",
- "</ui:composition>", };
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 6 lines of source code.
+ */
+ @Test
+ public void testPageSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<rich:panelBar height=\"400\" width=\"500\">",
+ "label=\"Leverage the whole set of JSF benefits while working with AJAX\">", "</rich:panelBarItem>",
+ "</rich:panelBar>", "</ui:composition>", };
- abstractTestSource(1, "View Source", strings);
- }
+ abstractTestSource(1, "View Source", strings);
+ }
- /**
- * Loads the page containing the component.
- */
- @BeforeMethod
- private void loadPage() {
- openComponent("Panel Bar");
- scrollIntoView(LOC_EXAMPLE_HEADER, true);
- }
+ /**
+ * Loads the page containing the component.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Panel Bar");
+ scrollIntoView(LOC_EXAMPLE_HEADER, true);
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelMenu/PanelMenuTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelMenu/PanelMenuTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/panelMenu/PanelMenuTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.jboss.richfaces.integrationTest.panelMenu;
import static org.testng.Assert.assertEquals;
@@ -17,20 +39,19 @@
public class PanelMenuTestCase extends AbstractSeleniumRichfacesTestCase {
// messages
- private final String MSG_COMPONENT_DESCRIPTION = getMess("COMPONENT_DESCRIPTION");
- private final String MSG_CONTENT_OF_PANEL_ON_LOAD = getMess("CONTENT_OF_PANEL_ON_LOAD");
- private final String MSG_CONTENT_OF_PANEL = getMess("CONTENT_OF_PANEL");
- private final String MSG_IMAGE_BEFORE_GROUP_NAME = getMess("IMAGE_BEFORE_GROUP_NAME");
- private final String MSG_NAME_OF_GROUP = getMess("NAME_OF_GROUP");
- private final String MSG_IMAGE_AFTER_GROUP_NAME_DOWN = getMess("IMAGE_AFTER_GROUP_NAME_DOWN");
- private final String MSG_IMAGE_AFTER_GROUP_NAME_UP = getMess("IMAGE_AFTER_GROUP_NAME_UP");
- private final String MSG_IMAGE_AFTER_GROUP_NAME_SPACER = getMess("IMAGE_AFTER_GROUP_NAME_SPACER");
- private final String MSG_ITEM_M_N_NOT_VISIBLE = getMess("ITEM_M_N_NOT_VISIBLE");
- private final String MSG_ITEM_M_N_VISIBLE = getMess("ITEM_M_N_VISIBLE");
- private final String MSG_IMAGE_BEFORE_ITEM_GRID = getMess("IMAGE_BEFORE_ITEM_GRID");
- private final String MSG_DISK_BEFORE_GROUP_NAME = getMess("DISK_BEFORE_GROUP_NAME");
- private final String MSG_SUBITEM_M_NOT_VISIBLE = getMess("SUBITEM_M_NOT_VISIBLE");
- private final String MSG_SUBITEM_M_VISIBLE = getMess("SUBITEM_M_VISIBLE");
+ private final String MSG_CONTENT_OF_PANEL_ON_LOAD = getMsg("CONTENT_OF_PANEL_ON_LOAD");
+ private final String MSG_CONTENT_OF_PANEL = getMsg("CONTENT_OF_PANEL");
+ private final String MSG_IMAGE_BEFORE_GROUP_NAME = getMsg("IMAGE_BEFORE_GROUP_NAME");
+ private final String MSG_NAME_OF_GROUP = getMsg("NAME_OF_GROUP");
+ private final String MSG_IMAGE_AFTER_GROUP_NAME_DOWN = getMsg("IMAGE_AFTER_GROUP_NAME_DOWN");
+ private final String MSG_IMAGE_AFTER_GROUP_NAME_UP = getMsg("IMAGE_AFTER_GROUP_NAME_UP");
+ private final String MSG_IMAGE_AFTER_GROUP_NAME_SPACER = getMsg("IMAGE_AFTER_GROUP_NAME_SPACER");
+ private final String MSG_ITEM_M_N_NOT_VISIBLE = getMsg("ITEM_M_N_NOT_VISIBLE");
+ private final String MSG_ITEM_M_N_VISIBLE = getMsg("ITEM_M_N_VISIBLE");
+ private final String MSG_IMAGE_BEFORE_ITEM_GRID = getMsg("IMAGE_BEFORE_ITEM_GRID");
+ private final String MSG_DISK_BEFORE_GROUP_NAME = getMsg("DISK_BEFORE_GROUP_NAME");
+ private final String MSG_SUBITEM_M_NOT_VISIBLE = getMsg("SUBITEM_M_NOT_VISIBLE");
+ private final String MSG_SUBITEM_M_VISIBLE = getMsg("SUBITEM_M_VISIBLE");
// locators
private final String LOC_EXAMPLE_HEADER = getLoc("EXAMPLE_HEADER");
@@ -45,10 +66,9 @@
private final String LOC_ITEM_M_N_TEXT = getLoc("ITEM_M_N_TEXT");
private final String LOC_ITEM_M_N_STYLE = getLoc("ITEM_M_N_STYLE");
- private final String LOC_SUBITEM_GROUP = getLoc("SUBITEM_GROUP");
- private final String LOC_SUBITEM_M_IMAGE_BEFORE = formatLoc("SUBITEM_M_IMAGE_BEFORE_RELATIVE_TO_GROUP", LOC_SUBITEM_GROUP);
- private final String LOC_SUBITEM_M_TEXT = formatLoc("SUBITEM_M_TEXT_RELATIVE_TO_GROUP", LOC_SUBITEM_GROUP);
- private final String LOC_SUBITEM_M_STYLE = formatLoc("SUBITEM_M_STYLE_RELATIVE_TO_GROUP", LOC_SUBITEM_GROUP);
+ private final String LOC_SUBITEM_M_IMAGE = getLoc("SUBITEM_M_IMAGE");
+ private final String LOC_SUBITEM_M_TEXT = getLoc("SUBITEM_M_TEXT");
+ private final String LOC_SUBITEM_M_STYLE = getLoc("SUBITEM_M_STYLE");
/**
* Tests the first group. First it checks the image before group name, group
@@ -97,57 +117,38 @@
public void testSubgroup() {
String text = null;
- selenium.click(String.format(LOC_GROUP_N_TEXT, 2));
+ selenium.click(format(LOC_GROUP_N_TEXT, 2));
// image before subgroup name
- text = selenium.getAttribute(String.format(LOC_ITEM_M_N_IMAGE_BEFORE, 2, 4));
- assertTrue(text.contains("PanelMenuIconDisc"),
- MSG_DISK_BEFORE_GROUP_NAME);
+ text = selenium.getAttribute(format(LOC_ITEM_M_N_IMAGE_BEFORE, 2, 4));
+ assertTrue(text.contains("PanelMenuIconDisc"), MSG_DISK_BEFORE_GROUP_NAME);
// subgroup name
- text = selenium.getText(String.format(LOC_ITEM_M_N_TEXT, 2, 4));
+ text = selenium.getText(format(LOC_ITEM_M_N_TEXT, 2, 4));
assertEquals(text, "Group 2.4", MSG_NAME_OF_GROUP);
// image after subgroup name
- text = selenium.getAttribute(String.format(LOC_ITEM_M_N_IMAGE_AFTER, 2,
- 4));
- assertTrue(text.contains("PanelMenuIconSpacer"),
- MSG_IMAGE_AFTER_GROUP_NAME_SPACER);
+ text = selenium.getAttribute(format(LOC_ITEM_M_N_IMAGE_AFTER, 2, 4));
+ assertTrue(text.contains("PanelMenuIconSpacer"), MSG_IMAGE_AFTER_GROUP_NAME_SPACER);
for (int i = 1; i < 4; i++) {
- text = selenium.getAttribute(String.format(LOC_SUBITEM_M_STYLE, i));
- assertFalse(!text.contains("display: none;"), String.format(
- MSG_SUBITEM_M_NOT_VISIBLE, i));
+ assertFalse(isDisplayed(format(LOC_SUBITEM_M_STYLE, i)), format(MSG_SUBITEM_M_NOT_VISIBLE, i));
}
// click Group 2.4
- selenium.click(String.format(LOC_ITEM_M_N_TEXT, 2, 4));
+ selenium.click(format(LOC_ITEM_M_N_TEXT, 2, 4));
// image after subgroup name
- text = selenium.getAttribute(String.format(LOC_ITEM_M_N_IMAGE_AFTER, 2,
- 4));
- assertTrue(text.contains("PanelMenuIconSpacer"),
- MSG_IMAGE_AFTER_GROUP_NAME_SPACER);
+ text = selenium.getAttribute(format(LOC_ITEM_M_N_IMAGE_AFTER, 2, 4));
+ assertTrue(text.contains("PanelMenuIconSpacer"), MSG_IMAGE_AFTER_GROUP_NAME_SPACER);
for (int i = 1; i < 4; i++) {
// check that items are not hidden
- try {
- text = selenium.getAttribute(String.format(LOC_SUBITEM_M_STYLE,
- i));
- assertTrue(!text.contains("display: none;"), String.format(
- MSG_SUBITEM_M_VISIBLE, i));
- } catch (Exception e) {
- // OK -- there is no style attribute
- }
-
+ assertTrue(isDisplayed(format(LOC_SUBITEM_M_STYLE, i)), format(MSG_SUBITEM_M_VISIBLE, i));
+
// check the image left of the item
- System.out.println("--------------"
- + String.format(LOC_SUBITEM_M_IMAGE_BEFORE, i) + "-----");
- text = selenium.getAttribute(String.format(
- LOC_SUBITEM_M_IMAGE_BEFORE, i));
- System.out.println("--------------" + text + "-----");
- assertTrue(text.contains("PanelMenuIconGrid"),
- MSG_IMAGE_BEFORE_ITEM_GRID);
+ text = selenium.getAttribute(format(LOC_SUBITEM_M_IMAGE, i));
+ assertTrue(text.contains("PanelMenuIconGrid"), MSG_IMAGE_BEFORE_ITEM_GRID);
}
}
@@ -164,24 +165,22 @@
// check items on the first level (1.1, 1.2, etc.)
for (int i = 1; i < 4; i++) {
- selenium.click(String.format(LOC_GROUP_N_TEXT, i));
+ selenium.click(format(LOC_GROUP_N_TEXT, i));
for (int j = 1; j < 4; j++) {
- selenium.click(String.format(LOC_ITEM_M_N_TEXT, i, j));
+ selenium.click(format(LOC_ITEM_M_N_TEXT, i, j));
waitFor(500); // it use Ajax mode
text = selenium.getText(LOC_PANEL);
- assertEquals(text, String.format("Item %d.%d selected", i, j),
- MSG_CONTENT_OF_PANEL);
+ assertEquals(text, format("Item {0}.{1} selected", i, j), MSG_CONTENT_OF_PANEL);
}
}
// check items on the second level (2.4.1, 2.4.2, 2.4.3)
- selenium.click(String.format(LOC_ITEM_M_N_TEXT, 2, 4));
+ selenium.click(format(LOC_ITEM_M_N_TEXT, 2, 4));
for (int i = 1; i < 4; i++) {
- selenium.click(String.format(LOC_SUBITEM_M_TEXT, i));
+ selenium.click(format(LOC_SUBITEM_M_TEXT, i));
waitFor(500); // it use Ajax mode
text = selenium.getText(LOC_PANEL);
- assertEquals(text, String.format("Item 2.4.%d selected", i),
- MSG_CONTENT_OF_PANEL);
+ assertEquals(text, format("Item 2.4.{0} selected", i), MSG_CONTENT_OF_PANEL);
}
}
@@ -213,62 +212,44 @@
String text = null;
// spacer before group name
- text = selenium.getAttribute(String.format(LOC_GROUP_N_IMAGE_BEFORE,
- index));
- assertTrue(text.contains("PanelMenuIconSpacer"),
- MSG_IMAGE_BEFORE_GROUP_NAME);
+ text = selenium.getAttribute(format(LOC_GROUP_N_IMAGE_BEFORE, index));
+ assertTrue(text.contains("PanelMenuIconSpacer"), MSG_IMAGE_BEFORE_GROUP_NAME);
// group name
- text = selenium.getText(String.format(LOC_GROUP_N_TEXT, index));
+ text = selenium.getText(format(LOC_GROUP_N_TEXT, index));
assertEquals(text, "Group " + index, MSG_NAME_OF_GROUP);
// image after group name
- text = selenium.getAttribute(String.format(LOC_GROUP_N_IMAGE_AFTER,
- index));
- assertTrue(text.contains("PanelMenuIconChevronDown"),
- MSG_IMAGE_AFTER_GROUP_NAME_DOWN);
+ text = selenium.getAttribute(format(LOC_GROUP_N_IMAGE_AFTER, index));
+ assertTrue(text.contains("PanelMenuIconChevronDown"), MSG_IMAGE_AFTER_GROUP_NAME_DOWN);
for (int i = 1; i < 4; i++) {
- text = selenium.getAttribute(String.format(LOC_ITEM_M_N_STYLE,
- index, i));
- assertFalse(!text.contains("display: none;"), String.format(
- MSG_ITEM_M_N_NOT_VISIBLE, index, i));
+ assertFalse(isDisplayed(format(LOC_ITEM_M_N_STYLE, index, i)), format(MSG_ITEM_M_N_NOT_VISIBLE, index, i));
}
- selenium.click(String.format(LOC_GROUP_N_TEXT, index));
+ selenium.click(format(LOC_GROUP_N_TEXT, index));
// image after group name
- text = selenium.getAttribute(String.format(LOC_GROUP_N_IMAGE_AFTER,
- index));
- assertTrue(text.contains("PanelMenuIconChevronUp"),
- MSG_IMAGE_AFTER_GROUP_NAME_UP);
+ text = selenium.getAttribute(format(LOC_GROUP_N_IMAGE_AFTER, index));
+ assertTrue(text.contains("PanelMenuIconChevronUp"), MSG_IMAGE_AFTER_GROUP_NAME_UP);
for (int i = 1; i < 4; i++) {
// check that items are not hidden
- try {
- text = selenium.getAttribute(String.format(LOC_ITEM_M_N_STYLE,
- index, i));
- assertTrue(!text.contains("display: none;"), String.format(
- MSG_ITEM_M_N_VISIBLE, index, i));
- } catch (Exception e) {
- // OK -- there is no style attribute
- }
-
+ assertTrue(isDisplayed(format(LOC_ITEM_M_N_STYLE, index, i)), format(MSG_ITEM_M_N_VISIBLE, index, i));
+
// check the image left of the item
- text = selenium.getAttribute(String.format(
- LOC_ITEM_M_N_IMAGE_BEFORE, index, i));
- assertTrue(text.contains("PanelMenuIconGrid"),
- MSG_IMAGE_BEFORE_ITEM_GRID);
+ text = selenium.getAttribute(format(LOC_ITEM_M_N_IMAGE_BEFORE, index, i));
+ assertTrue(text.contains("PanelMenuIconGrid"), MSG_IMAGE_BEFORE_ITEM_GRID);
}
}
/**
* Loads the page containing the component.
*/
+ @SuppressWarnings("unused")
@BeforeMethod
private void loadPage() {
-// selenium.allowNativeXpath("true");
- super.loadPage("richOutputs", 5, 1, MSG_COMPONENT_DESCRIPTION);
- scrollIntoView(LOC_EXAMPLE_HEADER, true);
+ openComponent("Panel Menu");
+ scrollIntoView(LOC_EXAMPLE_HEADER, true);
}
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/pickList/PickListTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/pickList/PickListTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/pickList/PickListTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.jboss.richfaces.integrationTest.pickList;
import static org.testng.Assert.assertEquals;
@@ -8,267 +30,315 @@
import org.testng.annotations.Test;
/**
+ * Test case for pick list.
*
- * <ul>
- * <li><b>TODO</b> check that buttons are enabled and disabled properly</li>
- * <li><b>TODO</b> implement tests for multiple files with shift and control key
- * </li>
- * <li><b>TODO</b> check not only one table, but both</li>
- * <li><b>TODO</b> check the header of panel with capitals</li>
- * </ul>
- *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
+// TODO check that buttons are enabled and disabled properly
+// TODO implement tests for multiple files with shift and control key
+// TODO check not only one table, but both
+// TODO check the header of panel with capitals
public class PickListTestCase extends AbstractSeleniumRichfacesTestCase {
- private final String leftUpperTable = "//fieldset[1]/div/table/tbody/tr/td[1]/div/table/tbody/tr/td/div/div/table/tbody";
- private final String upperButtons = "//fieldset[1]/div/table/tbody/tr/td[2]/div";
- private final String rightUpperTable = "//fieldset[1]/div/table/tbody/tr/td[3]/div/table/tbody/tr/td/div/div/table/tbody";
+ // locators
+ private final String LOC_FIRST_EXAMPLE_HEADER = getLoc("FIRST_EXAMPLE_HEADER");
+ private final String LOC_FIRST_LEFT_ITEMS = getLoc("FIRST_LEFT_ITEMS");
+ private final String LOC_FIRST_LEFT_FIRST_ITEM = getLoc("FIRST_LEFT_FIRST_ITEM");
+ private final String LOC_FIRST_RIGHT_ITEMS = getLoc("FIRST_RIGHT_ITEMS");
+ private final String LOC_FIRST_RIGHT_FIRST_ITEM = getLoc("FIRST_RIGHT_FIRST_ITEM");
+ private final String LOC_FIRST_BUTTON_COPY_ALL = getLoc("FIRST_BUTTON_COPY_ALL");
+ private final String LOC_FIRST_BUTTON_COPY = getLoc("FIRST_BUTTON_COPY");
+ private final String LOC_FIRST_BUTTON_REMOVE = getLoc("FIRST_BUTTON_REMOVE");
+ private final String LOC_FIRST_BUTTON_REMOVE_ALL = getLoc("FIRST_BUTTON_REMOVE_ALL");
+
+ private final String LOC_SECOND_EXAMPLE_HEADER = getLoc("SECOND_EXAMPLE_HEADER");
+ private final String LOC_SECOND_LEFT_ITEMS = getLoc("SECOND_LEFT_ITEMS");
+ private final String LOC_SECOND_LEFT_FIRST_ITEM = getLoc("SECOND_LEFT_FIRST_ITEM");
+ private final String LOC_SECOND_RIGHT_ITEMS = getLoc("SECOND_RIGHT_ITEMS");
+ private final String LOC_SECOND_RIGHT_FIRST_ITEM = getLoc("SECOND_RIGHT_FIRST_ITEM");
+ private final String LOC_SECOND_BUTTON_COPY_ALL = getLoc("SECOND_BUTTON_COPY_ALL");
+ private final String LOC_SECOND_BUTTON_COPY = getLoc("SECOND_BUTTON_COPY");
+ private final String LOC_SECOND_BUTTON_REMOVE = getLoc("SECOND_BUTTON_REMOVE");
+ private final String LOC_SECOND_BUTTON_REMOVE_ALL = getLoc("SECOND_BUTTON_REMOVE_ALL");
+
+ private final String LOC_SECOND_CHOSEN_OPTIONS_UL = getLoc("SECOND_CHOSEN_OPTIONS_UL");
+ private final String LOC_SECOND_CHOSEN_OPTIONS_LI = getLoc("SECOND_CHOSEN_OPTIONS_LI");
+ private final String LOC_SECOND_CHOSEN_OPTIONS_LI1 = getLoc("SECOND_CHOSEN_OPTIONS_LI1");
+
+ /**
+ * Test first pick list. It checks that there are some items on the left and no items on the right.
+ */
+ @Test
+ public void testFirstPickList() {
+ scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
+
+ int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
+ assertTrue(count > 0, "There are no lines in the upper left table.");
- private final String leftLowerTable = "//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[1]/div/table/tbody/tr/td/div/div/table/tbody";
- private final String lowerButtons = "//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[2]/div";
- private final String rightLowerTable = "//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[3]/div/table/tbody/tr/td/div/div/table/tbody";
- private final String chosenOptions = "//fieldset[2]/div/form/table/tbody/tr/td[2]/div/div[2]";
+ count = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
+ assertEquals(count, 0, "There should be no lines in the upper right table.");
+ }
- @Test
- public void testUpperPickList() {
- int count = selenium.getXpathCount(leftUpperTable + "/tr").intValue();
- assertTrue(count > 0, "There are no lines in the upper left table.");
+ /**
+ * Tests the button copy in the first example.
+ */
+ @Test
+ public void testFirstCopySingleItem() {
+ scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
+
+ int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
- count = selenium.getXpathCount(rightUpperTable + "/tr").intValue();
- assertEquals(count, 0,
- "There should be no lines in the upper right table.");
- }
+ selenium.click(LOC_FIRST_LEFT_FIRST_ITEM);
+ selenium.click(LOC_FIRST_BUTTON_COPY);
- @Test
- public void testUpperCopySingleFile() {
- int count = selenium.getXpathCount(leftUpperTable + "/tr").intValue();
+ int newCount = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
+ assertEquals(newCount, count - 1, "There should be less lines in the left table.");
+ }
- // click the first line
- selenium.click(leftUpperTable + "/tr[1]");
- // click 'Copy'
- selenium.click(upperButtons + "/div[3]");
+ // @Test
+ // public void testFirstCopyMultipleItemsShift() {
+ // fail("TODO");
+ // }
+ //
+ // @Test
+ // public void testFirstCopyMultipleItemsCtrl() {
+ // fail("TODO");
+ // }
- int newCount = selenium.getXpathCount(leftUpperTable + "/tr")
- .intValue();
- assertEquals(newCount, count - 1,
- "There should be less lines in the left table.");
- }
+ /**
+ * Tests the button copy all in the first example.
+ */
+ @Test
+ public void testFirstCopyAll() {
+ scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
+
+ int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
- // @Test
- // public void testUpperCopyMultipleFilesShift() {
- // fail("TODO");
- // }
- //
- // @Test
- // public void testUpperCopyMultipleFilesCtrl() {
- // fail("TODO");
- // }
+ selenium.click(LOC_FIRST_BUTTON_COPY_ALL);
- @Test
- public void testUpperCopyAll() {
- int count = selenium.getXpathCount(leftUpperTable + "/tr").intValue();
+ int newCount = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
+ assertEquals(newCount, 0, "There should be no lines in the left table.");
- // click 'Copy All'
- selenium.click(upperButtons + "/div[1]");
+ newCount = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
+ assertEquals(newCount, count, "All items from left table should be now in the right table.");
+ }
- int newCount = selenium.getXpathCount(leftUpperTable + "/tr")
- .intValue();
- assertEquals(newCount, 0, "There should be no lines in the left table.");
+ /**
+ * Tests the button remove in the first example.
+ */
+ @Test
+ public void testFirstRemoveSingleItem() {
+ scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
+
+ selenium.click(LOC_FIRST_BUTTON_COPY_ALL);
- newCount = selenium.getXpathCount(rightUpperTable + "/tr").intValue();
- assertEquals(newCount, count,
- "All items from left table should be now in the right table.");
- }
+ int count = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
- @Test
- public void testUpperRemoveSingleFile() {
- // click 'Copy All'
- selenium.click(upperButtons + "/div[1]");
+ selenium.click(LOC_FIRST_RIGHT_FIRST_ITEM);
+ selenium.click(LOC_FIRST_BUTTON_REMOVE);
- int count = selenium.getXpathCount(rightUpperTable + "/tr").intValue();
+ int newCount = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
+ assertEquals(newCount, count - 1, "There should be less lines in the right table.");
+ }
- // click the first line
- selenium.click(rightUpperTable + "/tr[1]");
- // click 'Remove'
- selenium.click(upperButtons + "/div[5]");
+ // @Test
+ // public void testFirstRemoveMultipleItemsShift() {
+ // fail("TODO");
+ // }
+ //
+ // @Test
+ // public void testFirstRemoveMultipleItemsCtrl() {
+ // fail("TODO");
+ // }
- int newCount = selenium.getXpathCount(rightUpperTable + "/tr")
- .intValue();
- assertEquals(newCount, count - 1,
- "There should be less lines in the right table.");
- }
+ /**
+ * Tests the button remove all in the first example.
+ */
+ @Test
+ public void testFirstRemoveAll() {
+ scrollIntoView(LOC_FIRST_EXAMPLE_HEADER, true);
+
+ int count = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
- // @Test
- // public void testUpperRemoveMultipleFilesShift() {
- // fail("TODO");
- // }
- //
- // @Test
- // public void testUpperRemoveMultipleFilesCtrl() {
- // fail("TODO");
- // }
+ selenium.click(LOC_FIRST_BUTTON_COPY_ALL);
+ selenium.click(LOC_FIRST_BUTTON_REMOVE_ALL);
- @Test
- public void testUpperRemoveAll() {
- int count = selenium.getXpathCount(leftUpperTable + "/tr").intValue();
+ int newCount = selenium.getXpathCount(LOC_FIRST_RIGHT_ITEMS).intValue();
+ assertEquals(newCount, 0, "There should be no lines in the right table.");
- // click 'Copy All'
- selenium.click(upperButtons + "/div[1]");
+ newCount = selenium.getXpathCount(LOC_FIRST_LEFT_ITEMS).intValue();
+ assertEquals(newCount, count, "All items from right table should be now in the left table.");
+ }
- // click 'Remove All'
- selenium.click(upperButtons + "/div[7]");
+ /**
+ * Tests the second pick list. It checks that there is something on the left, nothing on the right, and "chosen options" is empty.
+ */
+ @Test
+ public void testSecondPickList() {
+ scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
+
+ int count = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
+ assertTrue(count > 0, "There are no lines in the lower left table.");
- int newCount = selenium.getXpathCount(rightUpperTable + "/tr")
- .intValue();
- assertEquals(newCount, 0,
- "There should be no lines in the right table.");
+ count = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
+ assertEquals(count, 0, "There should be no lines in the lower right table.");
- newCount = selenium.getXpathCount(leftUpperTable + "/tr").intValue();
- assertEquals(newCount, count,
- "All items from right table should be now in the left table.");
- }
+ boolean empty = !selenium.isElementPresent(LOC_SECOND_CHOSEN_OPTIONS_UL);
+ assertTrue(empty, "Chosen options should not contain any items.");
+ }
- @Test
- public void testLowerPickList() {
- int count = selenium.getXpathCount(leftLowerTable + "/tr").intValue();
- assertTrue(count > 0, "There are no lines in the lower left table.");
+ /**
+ * Tests the button copy in the second example.
+ */
+ @Test
+ public void testSecondCopySingleItem() {
+ scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
+
+ int count = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
- count = selenium.getXpathCount(rightLowerTable + "/tr").intValue();
- assertEquals(count, 0,
- "There should be no lines in the lower right table.");
+ selenium.click(LOC_SECOND_LEFT_FIRST_ITEM);
+ selenium.click(LOC_SECOND_BUTTON_COPY);
- boolean empty = !selenium.isElementPresent(chosenOptions + "/ul");
- assertTrue(empty, "Chosen options should not contain any items.");
- }
+ int newCount = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
+ assertEquals(newCount, count - 1, "There should be less lines in the left table.");
- @Test
- public void testLowerCopySingleFile() {
- int count = selenium.getXpathCount(leftLowerTable + "/tr").intValue();
+ count = selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue();
+ assertEquals(count, 1, "There should be only one capital city.");
- // click the first line
- selenium.click(leftLowerTable + "/tr[1]");
- // click 'Copy'
- selenium.click(lowerButtons + "/div[3]");
+ String capital = selenium.getText(LOC_SECOND_CHOSEN_OPTIONS_LI1);
+ assertEquals(capital, "Montgomery", "Capital of Alaska.");
+ }
- int newCount = selenium.getXpathCount(leftLowerTable + "/tr")
- .intValue();
- assertEquals(newCount, count - 1,
- "There should be less lines in the left table.");
+ // @Test
+ // public void testSecondCopyMultipleItemsShift() {
+ // fail("TODO");
+ // }
+ //
+ // @Test
+ // public void testSecondCopyMultipleItemsCtrl() {
+ // fail("TODO");
+ // }
- count = selenium.getXpathCount(chosenOptions + "/ul/li").intValue();
- assertEquals(count, 1, "There should be only one capital city.");
+ /**
+ * Tests the button copy all in the second example.
+ */
+ @Test
+ public void testSecondCopyAll() {
+ scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
+
+ int count = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
- String capital = selenium.getText(chosenOptions + "/ul/li[1]");
- assertEquals(capital, "Montgomery", "Capital of Alaska.");
- }
+ selenium.click(LOC_SECOND_BUTTON_COPY_ALL);
- // @Test
- // public void testLowerCopyMultipleFilesShift() {
- // fail("TODO");
- // }
- //
- // @Test
- // public void testLowerCopyMultipleFilesCtrl() {
- // fail("TODO");
- // }
+ int newCount = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
+ assertEquals(newCount, 0, "There should be no lines in the left table.");
- @Test
- public void testLowerCopyAll() {
- int count = selenium.getXpathCount(leftLowerTable + "/tr").intValue();
+ newCount = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
+ assertEquals(newCount, count, "All items from left table should be now in the right table.");
- // click 'Copy All'
- selenium.click(lowerButtons + "/div[1]");
+ newCount = selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue();
+ assertEquals(newCount, count, "Not all capital cities were displayed in the panel.");
+ }
- int newCount = selenium.getXpathCount(leftLowerTable + "/tr")
- .intValue();
- assertEquals(newCount, 0, "There should be no lines in the left table.");
+ /**
+ * Tests the button remove in the second example.
+ */
+ @Test
+ public void testSecondRemoveSingleItem() {
+ scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
- newCount = selenium.getXpathCount(rightLowerTable + "/tr").intValue();
- assertEquals(newCount, count,
- "All items from left table should be now in the right table.");
+ selenium.click(LOC_SECOND_BUTTON_COPY_ALL);
- newCount = selenium.getXpathCount(chosenOptions + "/ul/li").intValue();
- assertEquals(newCount, count,
- "Not all capital cities were displayed in the panel.");
- }
+ int count = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
- @Test
- public void testLowerRemoveSingleFile() {
- // click 'Copy All'
- selenium.click(lowerButtons + "/div[1]");
+ selenium.click(LOC_SECOND_RIGHT_FIRST_ITEM);
+ selenium.click(LOC_SECOND_BUTTON_REMOVE);
- int count = selenium.getXpathCount(rightLowerTable + "/tr").intValue();
+ int newCount = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
+ assertEquals(newCount, count - 1, "There should be less lines in the right table.");
- // click the first line
- selenium.click(rightLowerTable + "/tr[1]");
- // click 'Remove'
- selenium.click(lowerButtons + "/div[5]");
+ newCount = selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue();
+ assertEquals(newCount, count - 1, "The capital city was not removed from panel.");
+ }
- int newCount = selenium.getXpathCount(rightLowerTable + "/tr")
- .intValue();
- assertEquals(newCount, count - 1,
- "There should be less lines in the right table.");
+ // @Test
+ // public void testSecondRemoveMultipleItemsShift() {
+ // fail("TODO");
+ // }
+ //
+ // @Test
+ // public void testSecondRemoveMultipleItemsCtrl() {
+ // fail("TODO");
+ // }
- newCount = selenium.getXpathCount(chosenOptions + "/ul/li").intValue();
- assertEquals(newCount, count - 1,
- "The capital city was not removed from panel.");
- }
+ /**
+ * Tests the button remove all in the second example.
+ */
+ @Test
+ public void testSecondRemoveAll() {
+ scrollIntoView(LOC_SECOND_EXAMPLE_HEADER, true);
- // @Test
- // public void testLowerRemoveMultipleFilesShift() {
- // fail("TODO");
- // }
- //
- // @Test
- // public void testLowerRemoveMultipleFilesCtrl() {
- // fail("TODO");
- // }
+ int count = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
- @Test
- public void testLowerRemoveAll() {
- int count = selenium.getXpathCount(leftLowerTable + "/tr").intValue();
+ selenium.click(LOC_SECOND_BUTTON_COPY_ALL);
+ selenium.click(LOC_SECOND_BUTTON_REMOVE_ALL);
- // click 'Copy All'
- selenium.click(lowerButtons + "/div[1]");
+ int newCount = selenium.getXpathCount(LOC_SECOND_RIGHT_ITEMS).intValue();
+ assertEquals(newCount, 0, "There should be no lines in the right table.");
- // click 'Remove All'
- selenium.click(lowerButtons + "/div[7]");
+ newCount = selenium.getXpathCount(LOC_SECOND_LEFT_ITEMS).intValue();
+ assertEquals(newCount, count, "All items from right table should be now in the left table.");
- int newCount = selenium.getXpathCount(rightLowerTable + "/tr")
- .intValue();
- assertEquals(newCount, 0,
- "There should be no lines in the right table.");
+ count = selenium.getXpathCount(LOC_SECOND_CHOSEN_OPTIONS_LI).intValue();
+ assertEquals(count, 0, "All capitals from the panel should be removed.");
+ }
- newCount = selenium.getXpathCount(leftLowerTable + "/tr").intValue();
- assertEquals(newCount, count,
- "All items from right table should be now in the left table.");
+ /**
+ * Tests the "View Source" in the first example. It checks that the source
+ * code is not visible, clicks on the link, and checks 5 lines of source
+ * code.
+ */
+ @Test
+ public void testFirstPickListSource() {
+ String[] strings = new String[] { "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"", "<rich:pickList>",
+ "<f:selectItem itemLabel=\"Option 1\" itemValue=\"1\"/>",
+ "<f:selectItem itemLabel=\"Option 2\" itemValue=\"2\"/>",
+ "<f:selectItem itemLabel=\"Option 3\" itemValue=\"3\"/>",
+ "<f:selectItem itemLabel=\"Option 4\" itemValue=\"4\"/>",
+ "<f:selectItem itemLabel=\"Option 5\" itemValue=\"5\"/>", "</rich:pickList>", };
- count = selenium.getXpathCount(chosenOptions + "/ul/li").intValue();
- assertEquals(count, 0, "All capitals from the panel should be removed.");
- }
+ abstractTestSource(1, "View Source", strings);
+ }
- @Test
- public void testUpperPickListSource() {
- abstractTestSource(1, 1, "<", "ui:composition");
- }
+ /**
+ * Tests the "View Source" in the second example. It checks that the source
+ * code is not visible, clicks on the link, and checks 5 lines of source
+ * code.
+ */
+ @Test
+ public void testSecondPickListSource() {
+ String[] strings = new String[] {
+ "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<h:panelGrid columns=\"2\" columnClasses=\"top, top\">",
+ "<rich:pickList value=\"#{pickListBean.result}\"> ",
+ "<f:selectItems value=\"#{capitalsBean.capitalsOptions}\"/>",
+ "<a4j:support event=\"onlistchanged\" reRender=\"result\"/>",
+ "<rich:panel id=\"result\" bodyClass=\"pbody\">",
+ "<f:facet name=\"header\">",
+ "<h:outputText value=\"#{pickListBean.items} Options Choosen\"></h:outputText>",
+ "<rich:dataList value=\"#{pickListBean.result}\" var=\"pickList\" rendered=\"#{pickListBean.items>0}\"> ",
+ "<h:outputText value=\"#{pickList}\"/>", };
- @Test
- public void testLowerPickListSource() {
- abstractTestSource(2, 1, "<", "ui:composition");
- }
+ abstractTestSource(2, "View Source", strings);
+ }
- /**
- * Loads the needed page.
- */
- @BeforeMethod
- private void loadPage() {
- super.loadPage("richSelect", 3,
- "Pick List component is a simple selection component");
-
- // click 'Remove All'
- selenium.click(upperButtons + "/div[7]");
- selenium.click(lowerButtons + "/div[7]");
- }
+ /**
+ * Loads the needed page.
+ */
+ @SuppressWarnings("unused")
+ @BeforeMethod
+ private void loadPage() {
+ openComponent("Pick List");
+ }
}
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/spinner/SpinnerTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/spinner/SpinnerTestCase.java 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/spinner/SpinnerTestCase.java 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,20 +1,24 @@
/*
* JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
+ * Copyright 2009, 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 copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
+ *
+ * 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.jboss.richfaces.integrationTest.spinner;
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/locators.properties (rev 0)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/locators.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -0,0 +1,16 @@
+EXAMPLE_HEADER=//fieldset/legend
+LEFT_TABLE_LINES=//fieldset/div/form/table[2]/tbody/tr[2]/td[1]/div/table/tbody/tr/td/div/div/table/tbody/tr
+RIGHT_TABLE_LINES=//fieldset/div/form/table[2]/tbody/tr[2]/td[3]/div/table/tbody/tr/td/div/div/table/tbody/tr
+LEFT_TABLE_LINE_1=//fieldset/div/form/table[2]/tbody/tr[2]/td[1]/div/table/tbody/tr/td/div/div/table/tbody/tr[1]
+RIGHT_TABLE_LINE_PREFORMATTED=//fieldset/div/form/table[2]/tbody/tr[2]/td[3]/div/table/tbody/tr/td/div/div/table/tbody/tr[{0}]
+TOOLBAR_ITEMS=//fieldset/div/form/table[1]/tbody/tr[1]/td[contains(@class,'rich-toolbar-item')]
+TOOLBAR_ITEM_PREFORMATTED=//fieldset/div/form/table[1]/tbody/tr/td[{0}*2-1]
+
+COPY_ALL_BUTTON=//fieldset/div/form/table[2]/tbody/tr[2]/td[2]/div/div[1]
+COPY_BUTTON=//fieldset/div/form/table[2]/tbody/tr[2]/td[2]/div/div[3]
+REMOVE_BUTTON=//fieldset/div/form/table[2]/tbody/tr[2]/td[2]/div/div[5]
+REMOVE_ALL_BUTTON=//fieldset/div/form/table[2]/tbody/tr[2]/td[2]/div/div[7]
+FIRST_BUTTON=//fieldset/div/form/table[2]/tbody/tr[2]/td[4]/div/div[1]
+UP_BUTTON=//fieldset/div/form/table[2]/tbody/tr[2]/td[4]/div/div[3]
+DOWN_BUTTON=//fieldset/div/form/table[2]/tbody/tr[2]/td[4]/div/div[5]
+LAST_BUTTON=//fieldset/div/form/table[2]/tbody/tr[2]/td[4]/div/div[7]
Property changes on: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/locators.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/messages.properties
===================================================================
Property changes on: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/listShuttle/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/modalPanel/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/modalPanel/locators.properties 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/modalPanel/locators.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,6 +1,6 @@
FIRST_EXAMPLE_HEADER=//fieldset[1]/legend
FIRST_PANEL=//div[contains(@class, 'rich-modalpanel') and contains(@id, 'panelContainer')]
-FIRST_PANEL_POSITION=//div[contains(@class, 'rich-modalpanel') and contains(@id, 'panelContainer')]/div[2]/div@style
+FIRST_PANEL_POSITION=//div[contains(@class, 'rich-modalpanel') and contains(@id, 'panelContainer')]/div[2]/div
FIRST_PANEL_OPEN=//fieldset[1]/div/a
FIRST_PANEL_CLOSE=//div[contains(@class, 'rich-modalpanel') and contains(@id, 'panelContainer')]/div[2]/div/div[2]/div/img
FIRST_PANEL_HEADER=//div[contains(@class, 'rich-modalpanel') and contains(@id, 'panelContainer')]/div[2]/div/div[2]/table/tbody/tr[1]/td/div
@@ -8,7 +8,7 @@
SECOND_EXAMPLE_HEADER=//fieldset[2]/legend
SECOND_PANEL=//div[@id='mpContainer']
-SECOND_PANEL_POSITION=//div[@id='mpContainer']/div[2]/div@style
+SECOND_PANEL_POSITION=//div[@id='mpContainer']/div[2]/div
SECOND_PANEL_OPEN=//fieldset[2]/div/a
SECOND_PANEL_CLOSE=//div[@id='mpContainer']/div[2]/div/div[2]/table/tbody/tr[2]/td/p[3]/a
SECOND_PANEL_HEADER=//div[@id='mpContainer']/div[2]/div/div[2]/table/tbody/tr[1]/td/div
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/modalPanel/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/modalPanel/messages.properties 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/modalPanel/messages.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,10 +1,4 @@
-COMPONENT_DESCRIPTION=RichFaces Modal Panel is a container that blocks an operation on the base page when the modal panel is shown.
-FIRST_PANEL_NOT_VISIBLE=The first panel should not be visible.
-FIRST_PANEL_VISIBLE=The first panel should be visible.
-FIRST_PANEL_WRONG_CONTENT=The content of the first panel is wrong.
-FIRST_PANEL_WRONG_HEADER=The header of the first panel is wrong.
-
-SECOND_PANEL_NOT_VISIBLE=The second panel should not be visible.
-SECOND_PANEL_VISIBLE=The second panel should be visible.
-SECOND_PANEL_WRONG_CONTENT=The content of the second panel is wrong.
-SECOND_PANEL_WRONG_HEADER=The header of the second panel is wrong.
\ No newline at end of file
+FIRST_PANEL_HEADER=Modal Panel
+FIRST_PANEL_CONTENT=This panel is called using Component Control Component \nClosure link (X) works also through Component Control
+SECOND_PANEL_HEADER=Modal Panel Title
+SECOND_PANEL_CONTENT=Any JSF content might be inside the panel.
\ No newline at end of file
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/locators.properties (rev 0)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/locators.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -0,0 +1,10 @@
+EXAMPLE_HEADER=//fieldset[1]/legend
+TABLE_LINES=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr[2]/td[1]/div/div[2]/table/tbody/tr
+TABLE_LINE_PREFORMATTED=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr[2]/td[1]/div/div[2]/table/tbody/tr[{0}]/td[1]
+SELECTION=//fieldset[1]/div/form/table/tbody/tr/td[2]/div/div[2]
+SELECTION_PREFORMATTED=//fieldset[1]/div/form/table/tbody/tr/td[2]/div/div[2]/ul/li[{0}]
+
+BUTTON_FIRST=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr[2]/td[2]/div/div[1]
+BUTTON_UP=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr[2]/td[2]/div/div[3]
+BUTTON_DOWN=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr[2]/td[2]/div/div[5]
+BUTTON_LAST=//fieldset[1]/div/form/table/tbody/tr/td[1]/div/table/tbody/tr[2]/td[2]/div/div[7]
\ No newline at end of file
Property changes on: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/locators.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/messages.properties (rev 0)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/messages.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -0,0 +1 @@
+ORDERING_LIST_SELECTION=No Songs Selected
\ No newline at end of file
Property changes on: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/orderingList/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/paint2d/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/paint2d/messages.properties 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/paint2d/messages.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,5 +1,47 @@
-TEXT_IN_IMAGE=Text in the image.
-COLOR_OF_IMAGE=Color of the image.
-SHADOW_SIZE=Size of the shadow.
-POSITION_OF_SLIDERS_HANDLE=Position of the slider's handle.
-IMAGE_HASH=Hash of the image.
\ No newline at end of file
+INITIAL_STATE_INPUT_TEXT=Paint 2D
+INITIAL_STATE_INPUT_COLOR=0003e8
+INITIAL_STATE_SHADOW_SLIDER_HANDLE=127
+INITIAL_STATE_HASH=da54ff0e62ee33804e270a863d7001a4
+
+CHANGE_TEXT_HASH_1=490d3b23e3f8c19290d3fbe351409be
+CHANGE_TEXT_HASH_2=f56c23afa5207cfdea008d298480c750
+
+CHANGE_COLOR_HASH_1=8f71bfc38cf5a26cdd548d3bb0f67291
+CHANGE_COLOR_HASH_2=6623c69f0397e00a955ed6bbb41e68e1
+
+CHANGE_SHADOW_SLIDER_HANDLE_1=0
+CHANGE_SHADOW_SLIDER_HANDLE_2=96
+CHANGE_SHADOW_SLIDER_HANDLE_3=191
+CHANGE_SHADOW_HASH_1=6f15cab627ffd32528a66ef9731990a2
+CHANGE_SHADOW_HASH_2=19063b8ea31e2939699abd7dc92cf23e
+CHANGE_SHADOW_HASH_3=d9e5b2f628d230b7dc41b8ece16a83ff
+
+CHANGE_TEXT_AND_COLOR_HASH=a18ff3c5c86154fc1c3ca2a59e60bbbf
+
+CHANGE_TEXT_AND_SHADOW_SLIDER_HANDLE=159
+CHANGE_TEXT_AND_SHADOW_HASH=74e992e595303a2f16c72a178a116189
+
+CHANGE_COLOR_AND_SHADOW_SLIDER_HANDLE=96
+CHANGE_COLOR_AND_SHADOW_HASH=fd6a4503b768b0a197851b78948b497c
+
+CHANGE_ALL_SLIDER_HANDLE=127
+CHANGE_ALL_HASH=f2016d2528b7d288f752bdaaefc7a666
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panel/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panel/messages.properties 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panel/messages.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -8,9 +8,12 @@
THIRD_HEADER=Header of the main panel in the third examnple.
# second tab
-CUST_PANEL_HEADER=Header of the panel.
-CUST_CLASS_HEADER=The "class" attribute of the header should contain "rich-panel-header".
-CUST_THIRD_HEADER=Header of the third panel should be green -- its class attribute has to contain "head2".
-CUST_THIRD_BODY=Body of the third panel should be green -- its class attribute has to contain "body3".
-CUST_FOURTH_PANEL_BODY_SCROLLABLE=Body of the fourth panel should be scrollable -- its class attribute has to contain "body3".
-CUST_FIFTH_PANEL_NO_HEADER=The fifth panel should have no header.
\ No newline at end of file
+CUST_FIRST_HEADER=Panel #1. Changing Style Synchronously
+CUST_FIRST_CLASS=rich-panel-header
+CUST_SECOND_HEADER=Panel #2. Changing Style Synchronously
+CUST_SECOND_CLASS=rich-panel-header
+CUST_THIRD_CLASS_1=head2
+CUST_THIRD_CLASS_2=body3
+CUST_FOURTH_HEADER=Scrolling Text Panel
+CUST_FOURTH_CLASS=body3
+CUST_FIFTH_COUNT=1
\ No newline at end of file
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/locators.properties 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/locators.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,23 +1,22 @@
EXAMPLE_HEADER=//fieldset/legend
PANEL=//span[@id='form:current']
-GROUP_N_IMAGE_BEFORE=//form[@id='form']/table/tbody/tr/td[1]/div/div[%d]/table/tbody/tr/td[1]/img@src
-GROUP_N_IMAGE_AFTER=//form[@id='form']/table/tbody/tr/td[1]/div/div[%d]/table/tbody/tr/td[3]/img@src
-GROUP_N_TEXT=//form[@id='form']/table/tbody/tr/td[1]/div/div[%d]/table/tbody/tr/td[2]
+GROUP_N_IMAGE_BEFORE=//form[@id='form']/table/tbody/tr/td[1]/div/div[{0}]/table/tbody/tr/td[1]/img@src
+GROUP_N_IMAGE_AFTER=//form[@id='form']/table/tbody/tr/td[1]/div/div[{0}]/table/tbody/tr/td[3]/img@src
+GROUP_N_TEXT=//form[@id='form']/table/tbody/tr/td[1]/div/div[{0}]/table/tbody/tr/td[2]
-ITEM_M_N_IMAGE_BEFORE=//form[@id='form']/table/tbody/tr/td[1]/div/div[%d]/div[%d]/table/tbody/tr/td[1]/img[2]@src
-ITEM_M_N_IMAGE_AFTER=//form[@id='form']/table/tbody/tr/td[1]/div/div[%d]/div[%d]/table/tbody/tr/td[3]/img@src
-ITEM_M_N_TEXT=//form[@id='form']/table/tbody/tr/td[1]/div/div[%d]/div[%d]/table/tbody/tr/td[2]
-ITEM_M_N_STYLE=//form[@id='form']/table/tbody/tr/td[1]/div/div[%d]/div[%d]@style
-SUBITEM_GROUP=//*[@class\='rich-pmenu']/*[contains(@class,'top-group')][2]/div[*[@class\='rich-pmenu-group']]
-
-SUBITEM_M_IMAGE_BEFORE_RELATIVE_TO_GROUP={0}/div[%d]/table/tbody/tr/td[1]/img[3]@src
-SUBITEM_M_TEXT_RELATIVE_TO_GROUP={0}/div[%d]/table/tbody/tr/td[2]
-SUBITEM_M_STYLE_RELATIVE_TO_GROUP={0}/div[%d]@style
+ITEM_M_N_IMAGE_BEFORE=//form[@id='form']/table/tbody/tr/td[1]/div/div[{0}]/div[{1}]/table/tbody/tr/td[1]/img[2]@src
+ITEM_M_N_IMAGE_AFTER=//form[@id='form']/table/tbody/tr/td[1]/div/div[{0}]/div[{1}]/table/tbody/tr/td[3]/img@src
+ITEM_M_N_TEXT=//form[@id='form']/table/tbody/tr/td[1]/div/div[{0}]/div[{1}]/table/tbody/tr/td[2]
+ITEM_M_N_STYLE=//form[@id='form']/table/tbody/tr/td[1]/div/div[{0}]/div[{1}]
+SUBITEM_M_IMAGE=//fieldset//div[contains(@class,'rich-pmenu')]/div[2]/div[4]/div[{0}]/table/tbody/tr/td[1]/img[3]@src
+SUBITEM_M_TEXT=//fieldset//div[contains(@class,'rich-pmenu')]/div[2]/div[4]/div[{0}]/table/tbody/tr/td[2]
+SUBITEM_M_STYLE=//fieldset//div[contains(@class,'rich-pmenu')]/div[2]/div[4]/div[{0}]
+
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/messages.properties 2009-09-10 15:37:39 UTC (rev 15531)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/panelMenu/messages.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -1,4 +1,3 @@
-COMPONENT_DESCRIPTION=The rich:panelMenu component is used to define a collapsible side-menu panel.
CONTENT_OF_PANEL_ON_LOAD=Content of the panel after the page is loaded.
CONTENT_OF_PANEL=Content of the panel.
IMAGE_BEFORE_GROUP_NAME=There should be a spacer before group name.
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/locators.properties (rev 0)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/locators.properties 2009-09-10 15:46:40 UTC (rev 15532)
@@ -0,0 +1,23 @@
+FIRST_EXAMPLE_HEADER=//fieldset[1]/legend
+FIRST_LEFT_ITEMS=//fieldset[1]/div/table/tbody/tr/td[1]/div/table/tbody/tr/td/div/div/table/tbody/tr
+FIRST_LEFT_FIRST_ITEM=//fieldset[1]/div/table/tbody/tr/td[1]/div/table/tbody/tr/td/div/div/table/tbody/tr[1]
+FIRST_RIGHT_ITEMS=//fieldset[1]/div/table/tbody/tr/td[3]/div/table/tbody/tr/td/div/div/table/tbody/tr
+FIRST_RIGHT_FIRST_ITEM=//fieldset[1]/div/table/tbody/tr/td[3]/div/table/tbody/tr/td/div/div/table/tbody/tr[1]
+FIRST_BUTTON_COPY_ALL=//fieldset[1]/div/table/tbody/tr/td[2]/div/div[1]
+FIRST_BUTTON_COPY=//fieldset[1]/div/table/tbody/tr/td[2]/div/div[3]
+FIRST_BUTTON_REMOVE=//fieldset[1]/div/table/tbody/tr/td[2]/div/div[5]
+FIRST_BUTTON_REMOVE_ALL=//fieldset[1]/div/table/tbody/tr/td[2]/div/div[7]
+
+SECOND_EXAMPLE_HEADER=//fieldset[1]/legend
+SECOND_LEFT_ITEMS=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[1]/div/table/tbody/tr/td/div/div/table/tbody/tr
+SECOND_LEFT_FIRST_ITEM=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[1]/div/table/tbody/tr/td/div/div/table/tbody/tr[1]
+SECOND_RIGHT_ITEMS=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[3]/div/table/tbody/tr/td/div/div/table/tbody/tr
+SECOND_RIGHT_FIRST_ITEM=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[3]/div/table/tbody/tr/td/div/div/table/tbody/tr[1]
+SECOND_BUTTON_COPY_ALL=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[2]/div/div[1]
+SECOND_BUTTON_COPY=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[2]/div/div[3]
+SECOND_BUTTON_REMOVE=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[2]/div/div[5]
+SECOND_BUTTON_REMOVE_ALL=//fieldset[2]/div/form/table/tbody/tr/td[1]/table/tbody/tr/td[2]/div/div[7]
+
+SECOND_CHOSEN_OPTIONS_UL=//fieldset[2]/div/form/table/tbody/tr/td[2]/div/div[2]/ul
+SECOND_CHOSEN_OPTIONS_LI=//fieldset[2]/div/form/table/tbody/tr/td[2]/div/div[2]/ul/li
+SECOND_CHOSEN_OPTIONS_LI1=//fieldset[2]/div/form/table/tbody/tr/td[2]/div/div[2]/ul/li[1]
\ No newline at end of file
Property changes on: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/locators.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/messages.properties
===================================================================
Property changes on: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/pickList/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 3 months
JBoss Rich Faces SVN: r15531 - branches/community/3.3.X/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-09-10 11:37:39 -0400 (Thu, 10 Sep 2009)
New Revision: 15531
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/panel3.png
Log:
RF-7804: Rich Output component group description review --> rich:panel
Modified: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/panel3.png
===================================================================
(Binary files differ)
15 years, 3 months
JBoss Rich Faces SVN: r15530 - branches/community/3.3.X/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-09-10 10:54:55 -0400 (Thu, 10 Sep 2009)
New Revision: 15530
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/panel2.png
Log:
RF-7804: Rich Output component group description review --> rich:panel
Modified: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/panel2.png
===================================================================
(Binary files differ)
15 years, 3 months
JBoss Rich Faces SVN: r15529 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-09-10 10:33:14 -0400 (Thu, 10 Sep 2009)
New Revision: 15529
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_fileUpload.xml
Log:
https://jira.jboss.org/jira/browse/RF-7803 - the component definition is reviewed and updated. The tables with style classes (selectors) are restructured;
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_fileUpload.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_fileUpload.xml 2009-09-10 14:25:37 UTC (rev 15528)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_fileUpload.xml 2009-09-10 14:33:14 UTC (rev 15529)
@@ -12,7 +12,7 @@
<title>Description</title>
<para>The <emphasis role="bold">
<property><rich:fileUpload></property>
- </emphasis> component designed to perform Ajax-ed files upload to server.
+ </emphasis> component is designed to perform Ajax-ed files upload to server.
</para>
<figure>
<title>
@@ -247,7 +247,7 @@
<listitem>
<para> The <emphasis>
<property> "onadd"</property>
- </emphasis>a event handler called on an add file operation </para>
+ </emphasis> event handler called on an add file operation </para>
</listitem>
<listitem>
@@ -311,7 +311,7 @@
<listitem>
<para>By means of JavaScript on the client side. Use the following syntax for that
<code>entries[i].propertyName</code>. For example
- <code>entries[0].state</code> will return the state of the file the is being
+ <code>entries[0].state</code> will return the state of the file that is being
processed or has just been processed.</para>
</listitem>
@@ -349,7 +349,7 @@
<para> Moreover, embedded Flash module provides a smoother representation of progress bar
- during the uploading process: the polling is performed is not by Ajax, but my means of
+ during the uploading process: the polling is performed is not by Ajax, but by means of
the flash module. </para>
<figure>
<title> Uploading using Flash module <emphasis role="bold">
@@ -363,7 +363,7 @@
</mediaobject>
</figure>
- <para>However, the Flash module doens't perform any visual representation of the
+ <para>However, the Flash module doesn't perform any visual representation of the
component.</para>
<!--End of Flash Module-->
@@ -469,13 +469,13 @@
<para>
<emphasis>
<property> "listHeight"</property>
- </emphasis> attribute specify height for list of files in pixels </para>
+ </emphasis> attribute specifies a height for list of files in pixels </para>
</listitem>
<listitem>
<para>
<emphasis>
<property> "listWidth"</property>
- </emphasis> attribute specify width for list of files in pixels </para>
+ </emphasis> attribute specifies a width for list of files in pixels </para>
</listitem>
</itemizedlist>
@@ -503,7 +503,7 @@
</mediaobject>
</figure>
<para>It's possible to handle events for fileUpload using JavaScript code. A
- simplest example of usage JavaScript API is placed below:</para>
+ simplest example of JavaScript API usage is placed below:</para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
@@ -513,9 +513,9 @@
...]]></programlisting>
<para>
- <emphasis role="bold">
+ The <emphasis role="bold">
<property><rich:fileUpload></property>
- </emphasis> component also provides a number of JavaScript property, that can be used to
+ </emphasis> component also provides a number of JavaScript properties, that can be used to
process uploaded files, file states etc. The given below example illustrates how the
<code>entries[0].state</code> property can be used to get access to the file state.
Full list of JavaScript properties can be found <link linkend="objectProperties">below</link>. </para>
@@ -560,7 +560,7 @@
<property><rich:fileUpload></property>
</emphasis> requests. </para-->
<para>To make <property><rich:fileUpload></property> component work properly
- with MyFaces extensions, the order in which filters are defined and mapped in web.xml,
+ with MyFaces extensions, the order in which filters are defined and mapped in web.xml
is important. See <ulink url="http://www.jboss.org/community/docs/DOC-13537">corresponding FAQ chapter</ulink>. </para>
</section>
@@ -858,13 +858,10 @@
<entry>Returns the date of the last file modification. Available in flash
enabled version only</entry>
</row>
-
-
-
-
</tbody>
</tgroup>
- </table>
+ </table>
+
<table>
<title>Facets</title>
<tgroup cols="2">
@@ -886,149 +883,207 @@
</tbody>
</tgroup>
- </table>
- <table id="fileUploadCN">
- <title>Classes names that define a component representation</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>rich-fileupload-list-decor</entry>
- <entry>Defines styles for a wrapper <div> element of a
- fileUpload</entry>
- </row>
- <row>
- <entry>rich-fileupload-font</entry>
- <entry>Defines styles for a font of buttons and items</entry>
- </row>
- <row>
- <entry>rich-fileupload-toolbar-decor</entry>
- <entry>Defines styles for a toolbar</entry>
- </row>
- <row>
- <entry> rich-fileupload-list-overflow</entry>
- <entry>Defines styles for a list of files</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
- <title>Classes names that define buttons representation</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>rich-fileupload-button</entry>
- <entry>Defines styles for a buttons</entry>
- </row>
- <row>
- <entry>rich-fileupload-button-border</entry>
- <entry>Defines styles for a border of buttons</entry>
- </row>
- <row>
- <entry>rich-fileupload-button-light</entry>
- <entry>Defines styles for a highlight of button</entry>
- </row>
- <row>
- <entry>rich-fileupload-button-press</entry>
- <entry>Defines styles for a pressed button</entry>
- </row>
- <row>
- <entry>rich-fileupload-button-dis</entry>
- <entry>Defines styles for a disabled button</entry>
- </row>
- <row>
- <entry>rich-fileupload-button-selection</entry>
- <entry>Defines styles for "Upload",
- "Clean" buttons</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
- <title>Classes names that define the representation of the buttons' icons</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>rich-fileupload-ico</entry>
- <entry>Defines styles for an icon</entry>
- </row>
- <row>
- <entry>rich-fileupload-ico-add</entry>
- <entry>Defines styles for a "Add" button icon</entry>
- </row>
- <row>
- <entry>rich-fileupload-ico-start</entry>
- <entry>Defines styles for a "Upload" button icon</entry>
- </row>
- <row>
- <entry>rich-fileupload-ico-stop</entry>
- <entry>Defines styles for a "Stop" button icon</entry>
- </row>
- <row>
- <entry>rich-fileupload-ico-clear</entry>
- <entry>Defines styles for a "Clear" button icon</entry>
- </row>
- <row>
- <entry>rich-fileupload-ico-add-dis</entry>
- <entry>Defines styles for a disabled "Add" button
- icon</entry>
- </row>
- <row>
- <entry>rich-fileupload-ico-start-dis</entry>
- <entry>Defines styles for a disabled "Upload" button
- icon</entry>
- </row>
- <row>
- <entry>rich-fileupload-ico-clear-dis</entry>
- <entry>Defines styles for a disabled "Clear" button
- icon</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
- <title>Classes names that define list items representation</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>rich-fileupload-table-td</entry>
- <entry>Defines styles for a wrapper <td> element of a list
- items</entry>
- </row>
- <row>
- <entry>rich-fileupload-anc</entry>
- <entry>Defines styles for "Cancel",
- "Stop", "Clear" links</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- You can find all necessary information about style classes redefinition in
+ </table>
+
+ <table>
+ <title>Style classes (selectors) with the corresponding skin parameters</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Class (selector) name</entry>
+ <entry>Description</entry>
+ <entry>Skin Parameter</entry>
+ <entry>CSS properties mapped</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry morerows="1">.rich-fileupload-font</entry>
+ <entry morerows="1">Defines styles for a font of buttons and items</entry>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-table-td</entry>
+ <entry>Defines styles for the <td> elements of the added item</entry>
+ <entry>tableBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.rich-fileupload-list-decor</entry>
+ <entry morerows="1">Defines styles for a wrapper <div> element of a fileUpload</entry>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-anc</entry>
+ <entry>Defines styles for the "Cancel", "Stop", "Clear" links</entry>
+ <entry>generalLinkColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry morerows="2">.rich-fileupload-toolbar-decor</entry>
+ <entry morerows="2">Defines styles for a toolbar</entry>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+ <row>
+ <entry>tableBackgroundColor</entry>
+ <entry>border-top-color, border-left-color</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-button-border</entry>
+ <entry>Defines styles for a border of buttons</entry>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-enrty-dis</entry>
+ <entry>Defines styles for a disabled entry</entry>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-button-content</entry>
+ <entry>Defines styles for the buttons content</entry>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-button</entry>
+ <entry>Defines styles for a buttons</entry>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.rich-fileupload-button-light</entry>
+ <entry morerows="1">Defines styles for a highlight of button</entry>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>selectControlColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.rich-fileupload-button-press</entry>
+ <entry morerows="1">Defines styles for a pressed button</entry>
+ <entry>selectControlColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-ico-add-dis</entry>
+ <entry>Defines styles for a disabled "Add" button icon</entry>
+ <entry>tableBorderColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-ico-start-dis</entry>
+ <entry>Defines styles for a disabled "Upload" button icon</entry>
+ <entry>tableBorderColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>.rich-fileupload-ico-clear-dis</entry>
+ <entry>Defines styles for a disabled "Clear" button icon</entry>
+ <entry>tableBorderColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Style classes (selectors) without skin parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry> rich-fileupload-list-overflow</entry>
+ <entry>Defines styles for a list of files</entry>
+ </row>
+
+ <row>
+ <entry>rich-fileupload-button-dis</entry>
+ <entry>Defines styles for a disabled button</entry>
+ </row>
+
+ <row>
+ <entry>rich-fileupload-button-selection</entry>
+ <entry>Defines styles for "Upload", "Clean" buttons</entry>
+ </row>
+
+ <row>
+ <entry>rich-fileupload-ico</entry>
+ <entry>Defines styles for an icon</entry>
+ </row>
+
+ <row>
+ <entry>rich-fileupload-ico-add</entry>
+ <entry>Defines styles for a "Add" button icon</entry>
+ </row>
+
+ <row>
+ <entry>rich-fileupload-ico-start</entry>
+ <entry>Defines styles for a "Upload" button icon</entry>
+ </row>
+
+ <row>
+ <entry>rich-fileupload-ico-stop</entry>
+ <entry>Defines styles for a "Stop" button icon</entry>
+ </row>
+
+ <row>
+ <entry>rich-fileupload-ico-clear</entry>
+ <entry>Defines styles for a "Clear" button icon</entry>
+ </row>
+
+ <row>
+ <entry>rich-fileupload-table-td</entry>
+ <entry>Defines styles for a wrapper <td> element of a list
+ items</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>You can find all necessary information about style classes redefinition in
<link linkend="customstyles">Definition of Custom Style Classes</link>
- section.
+ section.</para>
</section>
<section>
<title>Relevant Resources Links</title>
15 years, 3 months
JBoss Rich Faces SVN: r15528 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-09-10 10:25:37 -0400 (Thu, 10 Sep 2009)
New Revision: 15528
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_editor.xml
Log:
https://jira.jboss.org/jira/browse/RF-7803 - the tables with style classes (selectors) are restructured;
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_editor.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_editor.xml 2009-09-10 13:43:01 UTC (rev 15527)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_editor.xml 2009-09-10 14:25:37 UTC (rev 15528)
@@ -1,110 +1,130 @@
<section role="NotInToc" id="rich_editor">
- <title> < rich:editor > <emphasis role="since">
- <superscript> available since <emphasis role="version">3.3.0</emphasis>
- </superscript>
- </emphasis>
- </title>
- <section>
- <title>Description</title>
- <para>The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component is used for creating a WYSIWYG editor on a page. </para>
- <figure>
- <title>
- <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editor1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
- <section>
- <title>Key Features</title>
- <itemizedlist>
-
- <listitem>
- <para>Seam text support</para>
- </listitem>
- <listitem>
- <para>Manageable global configurations</para>
- </listitem>
- <listitem>
- <para>Possibility to use custom plug-ins</para>
- </listitem>
- <listitem>
- <para>Support of all TinyMCE's parameters through <emphasis role="bold">
- <property><f:param></property>
- </emphasis>
- </para>
- </listitem>
-
- </itemizedlist>
-
- </section>
- <section>
- <title>Details of Usage</title>
- <para>The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> is fully based on TinyMCE web based Javascript HTML WYSIWYG editor control and supports all of the features it has. The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> adapts the TinyMCE editor for JSF environment and adds some functional capabilities. </para>
- <para> The easiest way to place the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> on a page is as follows: </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
+ <title>
+ <
+ rich:editor
+ >
+ <emphasis role="since">
+ <superscript> available since <emphasis role="version">3.3.0</emphasis>
+ </superscript>
+ </emphasis>
+ </title>
+ <section>
+ <title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component is used for creating a WYSIWYG editor on a page.
+ </para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editor1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+
+ <listitem>
+ <para>Seam text support</para>
+ </listitem>
+ <listitem>
+ <para>Manageable global configurations</para>
+ </listitem>
+ <listitem>
+ <para>Possibility to use custom plug-ins</para>
+ </listitem>
+ <listitem>
+ <para>Support of all TinyMCE's parameters through <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis>
</para>
- <programlisting role="XML"><![CDATA[<rich:editor value="#{bean.editorValue}" />]]></programlisting>
- <para> Implementation of <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> provides three ways to define the properties of the component: </para>
+ </listitem>
+
+ </itemizedlist>
- <orderedlist>
- <listitem>
- <para>Using attributes</para>
- </listitem>
- <listitem>
- <para>Using using <emphasis role="bold">
- <property><f:param></property>
- </emphasis> JSF tag</para>
- </listitem>
- <listitem>
- <para>Using configuration files that allow you to set up multiple configurations for all editors in your application and change them in the runtime</para>
- </listitem>
- </orderedlist>
-
- <para>The three methods are described in details in the chapter.</para>
- <para> The most important properties are implemented as attributes and you can define them as any other attribute. The attributes of the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component match the corresponding properties of TinyMCE editor. </para>
- <para> For example, a theme for the editor can be defined using the <emphasis>
- <property>"theme"</property>
- </emphasis> attribute like this: </para>
+ </section>
+ <section>
+ <title>Details of Usage</title>
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> is fully based on TinyMCE web based Javascript HTML WYSIWYG editor control and supports all of the features it has.
+ The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> adapts the TinyMCE editor for JSF environment and adds some functional capabilities.
+ </para>
+ <para>
+ The easiest way to place the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> on a page is as follows:
+ </para>
<para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:editor value="#{bean.editorValue}" />]]></programlisting>
+ <para>
+ Implementation of <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> provides three ways to define the properties of the component:
+ </para>
+
+ <orderedlist>
+ <listitem>
+ <para>Using attributes</para>
+ </listitem>
+ <listitem>
+ <para>Using using <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> JSF tag</para>
+ </listitem>
+ <listitem>
+ <para>Using configuration files that allow you to set up multiple configurations for all editors in your application and change them in the runtime</para>
+ </listitem>
+ </orderedlist>
+
+ <para>The three methods are described in details in the chapter.</para>
+ <para>
+ The most important properties are implemented as attributes and you can define them as any other attribute.
+ The attributes of the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component match the corresponding properties of TinyMCE editor.
+ </para>
+ <para>
+ For example, a theme for the editor can be defined using the <emphasis>
+ <property>"theme"</property>
+ </emphasis> attribute like this:
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[
<rich:editor value="#{bean.editorValue}" theme="advanced" />
-]]></programlisting>
- <para>Setting a different skin for the editor can be done using the <emphasis>
- <property>"skin"</property>
- </emphasis> attribute.</para>
- <para> Another useful property that is implemented at attribute level is <emphasis>
- <property>"viewMode"</property>
- </emphasis>. The attribute switches between "visual" and "source" modes, toggling between modes is performed setting the attribute to "visual" and "source" respectively. Implementation of <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> also implies that you can change the modes dynamically setting the value of the <emphasis>
- <property>"viewMode"</property>
- </emphasis> attribute using EL-expression. </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+]]></programlisting>
+ <para>Setting a different skin for the editor can be done using the <emphasis>
+ <property>"skin"</property>
+ </emphasis> attribute.</para>
+ <para>
+ Another useful property that is implemented at attribute level is <emphasis>
+ <property>"viewMode"</property>
+ </emphasis>.
+ The attribute switches between "visual" and "source" modes, toggling between modes is performed setting the attribute to "visual" and "source" respectively.
+ Implementation of <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> also implies that you can change the modes dynamically setting the value of the <emphasis>
+ <property>"viewMode"</property>
+ </emphasis> attribute using EL-expression.
+ </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{editor.submit}" theme="advanced" viewMode="#{editor.viewMode}" >
...
<h:selectOneRadio value="#{editor.viewMode}" onchange="submit();">
@@ -113,91 +133,124 @@
</h:selectOneRadio>
...
</rich:editor>
-...]]></programlisting>
- <para> Most configuration options that TinyMCE provides can be applied using <emphasis role="bold">
- <property><f:param></property>
- </emphasis> JSF tag. The syntax is quite simple: the <emphasis>
- <property>"name"</property>
- </emphasis> attribute should contain the option, the <emphasis>
- <property>"value"</property>
- </emphasis> attribute assigns some value to the option. </para>
- <para> For example, this code adds some buttons to the editor and positions the toolbar. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ <para>
+ Most configuration options that TinyMCE provides can be applied using <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> JSF tag.
+ The syntax is quite simple: the <emphasis>
+ <property>"name"</property>
+ </emphasis> attribute should contain the option,
+ the <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute assigns some value to the option.
+ </para>
+ <para>
+ For example, this code adds some buttons to the editor and positions the toolbar.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" theme="advanced" plugins="save,paste" >
<f:param name="theme_advanced_buttons1" value="bold,italic,underline, cut,copy,paste,pasteword"/>
<f:param name="theme_advanced_toolbar_location" value="top"/>
<f:param name="theme_advanced_toolbar_align" value="left"/>
</rich:editor>
-...]]></programlisting>
- <para>This is what you get as a result:</para>
- <figure>
- <title> Setting configuration options with <f:param> </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editor2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <para>The third way to configure the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> is to use configuration file (.properties)</para>
-
- <para> This method eases your life if you need to configure multiple instances of the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis>: you configure the editor once and in one spot and the configuration properties can be applied to any <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> in your application. </para>
- <para>To implement this type of configuration you need to take a few steps:</para>
- <itemizedlist>
- <listitem>
- <para> Create a configuration file (.properties) in the classpath folder and add some properties to it. Use standard syntax for the .properties files: <code>parameter=value</code>. Here is an example of configuration
- file: </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[theme="advanced"
+...]]></programlisting>
+ <para>This is what you get as a result:</para>
+ <figure>
+ <title> Setting configuration options with <f:param>
+
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editor2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+ <para>The third way to configure the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> is
+ to use configuration file (.properties)</para>
+
+ <para>
+ This method eases your life if you need to configure multiple instances
+ of the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis>: you configure the editor once
+ and in one spot and the configuration properties can be applied to any
+ <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> in your application.
+ </para>
+ <para>To implement this type of configuration you need to take a few steps:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Create a configuration file (.properties) in the classpath folder and add some properties to it.
+ Use standard syntax for the .properties files: <code>parameter=value</code>.
+ Here is an example of configuration file:
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[theme="advanced"
plugins="save,paste"
theme_advanced_buttons1="bold,italic,underline, cut,copy,paste,pasteword"
theme_advanced_toolbar_location="top"
theme_advanced_toolbar_align="left"
-]]></programlisting>
- </listitem>
- <listitem>
- <para> The properties stored in configuration file are passed to the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> via <emphasis>
- <property>"configuration"</property>
- </emphasis> attribute which takes the name of the configuration file as a value (with out .properties extension). </para>
- <para> For example, if you named the configuration file "editorconfig", you would address it as follows: </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ The properties stored in configuration file are passed to the
+ <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> via
+ <emphasis>
+ <property>"configuration"</property>
+ </emphasis> attribute which takes the name of the configuration file
+ as a value (with out .properties extension).
+ </para>
+ <para>
+ For example, if you named the configuration file "editorconfig", you would address it as follows:
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" configuration="editorconfig"/>
-...]]></programlisting>
- </listitem>
- <listitem>
- <para> Alternately, you can use a EL-expression to define a configuration file. This way you can dynamically change the sets of configuration properties. </para>
-
- <para> For example, you have two configuration files "configurationAdvanced" and "configurationSimple" and you want them to be applied under some condition. </para>
- <para> To do this you need to bind <emphasis>
- <property>"configuration"</property>
- </emphasis> attribute to the appropriate bean property like this. </para>
-
+...]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Alternately, you can use a EL-expression to define a configuration file.
+ This way you can dynamically change the sets of configuration properties.
+ </para>
+
+ <para>
+ For example, you have two configuration files "configurationAdvanced" and "configurationSimple" and you want them to be
+ applied under some condition.
+ </para>
<para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ To do this you need to bind <emphasis>
+ <property>"configuration"</property>
+ </emphasis>
+ attribute to the appropriate bean property like this.
+ </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" configuration="#{editor.configuration}" />
-...]]></programlisting>
- <para>Your Java file should look like this.</para>
-
- <programlisting role="JAVA"><![CDATA[...
+...]]></programlisting>
+ <para>Your Java file should look like this.</para>
+
+ <programlisting role="JAVA"><![CDATA[...
String configuration;
if(some condition){//defines some condition
@@ -206,254 +259,537 @@
else{
configuration= "configurationSimple"; //the name on the file with simplified properties
}
-...]]></programlisting>
- </listitem>
-
- </itemizedlist>
-
-
- <para> You also might want to add some custom plug-ins to your editor. You can read about how to create a plugin in <ulink url="http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Plugin">TinyMCE Wiki article</ulink>. </para>
-
- <para> Adding a custom plugin also requires a few steps to take. Though, the procedure is very similar to adding a configuration file. </para>
-
- <para>This is what you need to add a plugin:</para>
- <itemizedlist>
- <listitem>
- <para>Create a .properties file and put the name of the plug-in and a path to it into the file. The file can contain multiple plug-in declarations. Your .properties file should be like this. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ </listitem>
+
+ </itemizedlist>
+
+
+ <para>
+ You also might want to add some custom plug-ins to your editor.
+ You can read about how to create a plugin in <ulink url="http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Plugin">TinyMCE Wiki article</ulink>.
+ </para>
+
+ <para>
+ Adding a custom plugin also requires a few steps to take. Though, the procedure is very similar to adding a configuration file.
+
+ </para>
+
+ <para>This is what you need to add a plugin:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Create a .properties file and put the name of the plug-in and a path to it into the file.
+ The file can contain multiple plug-in declarations. Your .properties file should be like this.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
pluginName=/mytinymceplugins/plugin1Name/editor_plugin.js
-...]]></programlisting>
- </listitem>
- <listitem>
- <para> Use the <emphasis>
- <property>"customPlugins"</property>
- </emphasis> attribute to specify the .properties file with a plugin name and a path to it. </para>
- <para> If your .properties file is named "myPlugins", then your will have this code on the page. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Use the <emphasis>
+ <property>"customPlugins"</property>
+ </emphasis> attribute to specify the .properties file with a plugin name and a path to it.
+ </para>
+ <para>
+ If your .properties file is named "myPlugins", then your will have this code on the page.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor theme="advanced" customPlugins="myPlugins" plugins="pluginName" />
-...]]></programlisting>
- </listitem>
- </itemizedlist>
- <note>
- <title>Note:</title>
- <para> Some plug-ins which available for download might have some dependencies on TinyMCE scripts. For example, dialog pop-ups require tiny_mce_popup.js script file. Assuming that you will not plug custom plugins to the RF
- jar with editor component (standard TinyMCE plugins creation implies that plugins are put into TinyMCE's corresponding directory) you should manually add required TinyMCE scripts to some project folder and correct
- the js includes. </para>
- </note>
- <para> The implementation of the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component has two methods for handling events. </para>
- <para>The attributes take some function name as a value with is triggered on the appropriate event. You need to use standard JavaScript function calling syntax. </para>
-
- <itemizedlist>
- <listitem>
- <para>Using attributes (<emphasis>
- <property>"onchange"</property>
- </emphasis>, <emphasis>
- <property>"oninit"</property>
- </emphasis>, <emphasis>
- <property>"onsave"</property>
- </emphasis>, <emphasis>
- <property>"onsetup"</property>
- </emphasis>) </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ </listitem>
+ </itemizedlist>
+ <note>
+ <title>Note:</title>
+ <para>
+Some plug-ins which available for download might have some dependencies on TinyMCE scripts.
+For example, dialog pop-ups require tiny_mce_popup.js script file.
+Assuming that you will not plug custom plugins to the RF jar with editor component
+(standard TinyMCE plugins creation implies that plugins are put into TinyMCE's corresponding directory)
+ you should manually add required TinyMCE scripts to some project folder and correct the js includes.
+ </para>
+ </note>
+ <para>
+ The implementation of the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component has two methods for handling
+ events.
+ </para>
+ <para>The attributes take some function name as a value with is triggered on the appropriate event. You need to use standard JavaScript function calling syntax. </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Using attributes (<emphasis>
+ <property>"onchange"</property>
+ </emphasis>,
+ <emphasis>
+ <property>"oninit"</property>
+ </emphasis>,
+ <emphasis>
+ <property>"onsave"</property>
+ </emphasis>,
+ <emphasis>
+ <property>"onsetup"</property>
+ </emphasis>)
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" onchange="myCustomOnChangeHandler()" />
-...]]></programlisting>
- </listitem>
- <listitem>
- <para> Using <emphasis role="bold">
- <property><f:param></property>
- </emphasis> as a child element defining the <emphasis>
- <property>"name"</property>
- </emphasis> attribute with one of the TinyMCE's callbacks and the <emphasis>
- <property>"value"</property>
- </emphasis> attribute takes the function name you want to be called on the corresponding event as the value. Note, that the syntax in this case is a bit different: parentheses are not required. </para>
+...]]></programlisting>
+ </listitem>
+ <listitem>
<para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ Using <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> as a child element defining the <emphasis>
+ <property>"name"</property>
+ </emphasis> attribute
+ with one of the TinyMCE's callbacks and the
+ <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute takes the function name you want to be called
+ on the corresponding event as the value. Note, that the syntax in this case is a bit different: parentheses are not required.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}">
<f:param name="onchange" value="myCustomOnChangeHandler" />
</rich:editor>
-...]]></programlisting>
- </listitem>
- </itemizedlist>
-
- <para>The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component has a build-in converter that renders HTML code generated by the editor to Seam text (you can read more on Seam in <ulink url="http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/text.html">Seam
- guide</ulink>.), it also interprets Seam text passed to the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> and renders it to HTML. The converter can be enable with the <emphasis>
- <property>"useSeamText"</property>
- </emphasis> attribute.</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
-
- <para>This HTML code generated by editor</para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ </listitem>
+ </itemizedlist>
+
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis>
+ component has a build-in converter that renders HTML code generated by the editor
+ to Seam text (you can read more on Seam in <ulink url="http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/text.html">Seam guide</ulink>.), it also interprets Seam text
+ passed to the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> and renders it to HTML.
+ The converter can be enable with the <emphasis>
+ <property>"useSeamText"</property>
+ </emphasis> attribute.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <para>This HTML code generated by editor</para>
+ <programlisting role="XML"><![CDATA[...
<p><a href="http://mysite.com">Lorem ipsum</a> <i>dolor sit</i> amet, ea <u>commodo</u> consequat.</p>
-...]]></programlisting>
- <para>will be parsed to the following Seam text:</para>
-
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ <para>will be parsed to the following Seam text:</para>
+
+ <programlisting role="XML"><![CDATA[...
[Lorem ipsum=>http://mysite.com] *dolor sit* amet, ea _commodo_ consequat.
...]]></programlisting>
- <para>Accordingly, if the Seam text is passed to the component it will be parsed to HTML code.</para>
+ <para>Accordingly, if the Seam text is passed to the component it will be parsed to HTML code.</para>
- </section>
- <section>
- <title>Reference Data</title>
- <para>
- <ulink url="&tlddoc;rich/editor.html">Table of <rich:editor> attributes</ulink>. </para>
- <table>
- <title>Component Identification Parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.component.editor</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.richfaces.component.html.Htmleditor</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.richfaces.component.editor</entry>
- </row>
- <row>
- <entry>renderer-type</entry>
- <entry>org.richfaces.renderkit.html.editorRenderer</entry>
- </row>
- <row>
- <entry>tag-class</entry>
- <entry>org.richfaces.taglib.editorTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
- <title>CSS selectors for the layout of the editor</title>
+ </section>
+ <section>
+ <title>Reference Data</title>
+ <para>
+ <ulink url="&tlddoc;rich/editor.html">Table of
+ <rich:editor>
+ attributes</ulink>.
+ </para>
+ <table>
+ <title>Component Identification Parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.component.Editor</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.Htmleditor</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.component.Editor</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.renderkit.html.EditorRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.EditorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Style classes (selectors) with the corresponding skin parameters</title>
<tgroup cols="4">
<thead>
<row>
- <entry>Class name (selector)</entry>
+ <entry>Class (selector) name</entry>
<entry>Description</entry>
<entry>Skin Parameter</entry>
- <entry>CSS property</entry>
+ <entry>CSS properties mapped</entry>
</row>
</thead>
- <tbody>
- <row>
- <entry>.richfacesSkin .mceButton</entry>
- <entry>Defines styles for the buttons</entry>
- <entry>n/a</entry>
- <entry>background-image</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin .mceButtonDisabled .mceIcon </entry>
- <entry>Defines styles for the icons</entry>
- <entry>n/a</entry>
- <entry>opacity</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin .mceIframeContainer</entry>
- <entry>Defines styles for the container</entry>
- <entry>panelBorderColor</entry>
- <entry>border-top-color, border-bottom-color</entry>
- </row>
-
- <row>
- <entry morerows="2">.richfacesSkin .mceListBox .mceText</entry>
- <entry morerows="2">Defines styles for the list box</entry>
- <entry>generalFamilyFont</entry>
- <entry>font-family</entry>
- </row>
- <row>
- <entry>panelBorderColor</entry>
- <entry>border-color</entry>
- </row>
- <row>
- <entry>tableBackgroundColor</entry>
- <entry>background</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin .mceExternalToolbar</entry>
- <entry>Defines styles for the toolbar</entry>
- <entry>panelBorderColor</entry>
- <entry>border-color</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin .mceMenu</entry>
- <entry>Defines styles for the menus</entry>
- <entry>panelBorderColor</entry>
- <entry>border-color</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
- <entry>Defines styles for the active menu items</entry>
- <entry>additionalBackgroundColor</entry>
- <entry>background-color</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin .mceSeparator</entry>
- <entry>Defines styles for the buttons separator</entry>
- <entry>n/a</entry>
- <entry>background-image</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin table.mceLayout</entry>
- <entry>Defines styles for the table layout</entry>
- <entry>panelBorderColor</entry>
- <entry>border-left-color, border-right-color</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin table.mceToolbar</entry>
- <entry>Defines styles for the rows of icons within toolbar</entry>
- <entry>n/a</entry>
- <entry>padding</entry>
- </row>
+ <tbody>
+ <row>
+ <entry>.richfacesSkin a:hover, .richfacesSkin a:link, .richfacesSkin a:visited, .richfacesSkin a:active</entry>
+ <entry>Defines styles for links state</entry>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin table</entry>
+ <entry>Defines styles for the wrapper <table> element of the editor</entry>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin iframe</entry>
+ <entry>Defines styles for the editor text area</entry>
+ <entry>tableBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceExternalToolbar</entry>
+ <entry>Defines styles for the toolbar</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin table.mceLayout</entry>
+ <entry>Defines styles for the table layout</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-left-color, border-right-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin table.mceLayout tr.mceFirst td</entry>
+ <entry>Defines styles for the toolbar elements</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-top-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin table.mceLayout tr.mceLast td</entry>
+ <entry>Defines styles for the editor window</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceIframeContainer</entry>
+ <entry>Defines styles for the editor container</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-top-color, border-bottom-color</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.richfacesSkin .mceStatusbar</entry>
+ <entry morerows="1">Defines styles for the status bar</entry>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin a.mceButtonEnabled:hover</entry>
+ <entry>Defines styles for the editor buttons hovered</entry>
+ <entry>headerBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin span.mceButtonLabel</entry>
+ <entry>Defines styles for the editor buttons labels</entry>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+
+ <row>
+ <entry morerows="2">.richfacesSkin .mceListBox .mceText</entry>
+ <entry morerows="2">Defines styles for the list box</entry>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin table.mceListBoxEnabled:hover .mceText, .richfacesSkin .mceListBoxSelected .mceText</entry>
+ <entry>Define styles for the list box hovered, selected respectively</entry>
+ <entry>tableBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.richfacesSkin div.mceColorSplitMenu table</entry>
+ <entry morerows="1">Defines styles for the wrapper <table> element of the popup element for color selecting</entry>
+ <entry>tableBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+ <row>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceColorSplitMenu a</entry>
+ <entry>Defines styles for the items in the popup element for color selecting</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.richfacesSkin .mceColorSplitMenu a.mceMoreColors</entry>
+ <entry morerows="1">Defines styles for the "More Colors" button</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.richfacesSkin .mceColorSplitMenu a.mceMoreColors:hover</entry>
+ <entry morerows="1">Defines styles for the "More Colors" button hovered</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin a.mceMoreColors:hover</entry>
+ <entry>Defines styles for the "More Colors" button hovered</entry>
+ <entry>headerBackgroundColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceColorPreview</entry>
+ <entry>Defines styles for the color preview</entry>
+ <entry>tableBorderColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceMenu</entry>
+ <entry>Defines styles for the menus</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceMenu table</entry>
+ <entry>Defines styles for the wrapper <table> element of the menu</entry>
+ <entry>tableBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.richfacesSkin .mceMenu .mceText</entry>
+ <entry morerows="1">Defines styles for the menus labels</entry>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
+ <entry>Defines styles for the active menu items</entry>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceMenu .mceMenuItemEnabled a:hover</entry>
+ <entry>Defines styles for the enabled menu items hovered</entry>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin td.mceMenuItemSeparator</entry>
+ <entry>Defines styles for the menu items separator</entry>
+ <entry>panelBorderColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry morerows="1">.richfacesSkin .mceMenuItemTitle a</entry>
+ <entry morerows="1">Defines styles for the titles of the menu items</entry>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+ <row>
+ <entry>panelBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceMenuItemDisabled .mceText</entry>
+ <entry>Defines styles for the disabled menu items</entry>
+ <entry>tabDisabledTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceBlocker</entry>
+ <entry>Defines styles for the editor blocker</entry>
+ <entry>tableBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mcePlaceHolder</entry>
+ <entry>Defines styles for the editor place holder</entry>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
</tbody>
</tgroup>
- </table> You can find all necessary information about style classes redefinition in <link linkend="customstyles">Definition of Custom Style Classes</link> section. </section>
- <section>
- <title>Relevant Resources Links</title>
-
- <para>The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> is based on TinyMCE editor and supports almost all its features and properties some of which are not described here since you can find more detailed documentation on them on the official <ulink
- url="http://wiki.moxiecode.com/index.php/TinyMCE:Index">web site.</ulink>
- </para>
-
-
- <para>
- <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/editor.jsf?c=editor">On RichFaces LiveDemo page </ulink> you can see an example of <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> usage and sources for the given example. </para>
- </section>
-</section>
+ </table>
+
+ <table>
+ <title>Style classes (selectors) without skin parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>.richfacesSkin table.mceToolbar</entry>
+ <entry>Defines styles for the rows of icons within toolbar</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceToolbar .mceToolbarStart span</entry>
+ <entry>Defines styles for the icon of the toolbar start element</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceToolbar .mceToolbarEnd span</entry>
+ <entry>Defines styles for the icon of the toolbar end element</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceIcon</entry>
+ <entry>Defines styles for the icons of the toolbar buttons</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceButton</entry>
+ <entry>Defines styles for the buttons</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceSeparator</entry>
+ <entry>Defines styles for the buttons separator</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceButtonDisabled .mceIcon </entry>
+ <entry>Defines styles for the icons of the disabled buttons</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceListBox .mceOpen</entry>
+ <entry>Defines styles for the icons of the list box "Open" button</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceSplitButton a.mceOpen</entry>
+ <entry>Defines styles for the icons of the split buttons for color selecting</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceSplitButton span.mceAction</entry>
+ <entry>Defines styles for the icons of the split buttons</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceMenuItemSelected .mceIcon</entry>
+ <entry>Defines styles for the icons of the selected menu items</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceNoIcons .mceMenuItemSelected a</entry>
+ <entry>Defines styles for the selected menu items without no icons</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceMenuItemSub a</entry>
+ <entry>Defines styles for the icon of the submenu item</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceProgress</entry>
+ <entry>Defines styles for the editor progress icon</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceStatusbar a.mceResize</entry>
+ <entry>Defines styles for the resize button</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>You can find all necessary information about style classes redefinition in
+ <link linkend="customstyles">Definition of Custom Style Classes</link>
+ section.</para>
+ </section>
+ <section>
+ <title>Relevant Resources Links</title>
+
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> is based on TinyMCE editor and supports almost all its features and properties some of which are not described here since you can find more detailed documentation on them on the official <ulink url="http://wiki.moxiecode.com/index.php/TinyMCE:Index">web site.</ulink>
+ </para>
+
+
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/editor.jsf?c=editor">On RichFaces LiveDemo page </ulink> you can see an example of <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> usage and sources for the given example. </para>
+ </section>
+</section>
\ No newline at end of file
15 years, 3 months
JBoss Rich Faces SVN: r15527 - branches/community/3.3.X/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-09-10 09:43:01 -0400 (Thu, 10 Sep 2009)
New Revision: 15527
Modified:
branches/community/3.3.X/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
Log:
RF-7804: Rich Output component group description review --> rich:modalPanel
Modified: branches/community/3.3.X/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
--- branches/community/3.3.X/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2009-09-10 13:41:53 UTC (rev 15526)
+++ branches/community/3.3.X/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2009-09-10 13:43:01 UTC (rev 15527)
@@ -4,16 +4,50 @@
xmlns:u="http://jsf.exadel.com/template/util"
xmlns="http://www.w3.org/1999/xhtml">
+ <u:selector name=".rich-mpnl-body">
+ <u:style name="font-size" skin="generalSizeFont" />
+ <u:style name="color" skin="generalTextColor" />
+ <u:style name="font-family" skin="generalFamilyFont" />
+ </u:selector>
+
+ <u:selector name=".rich-mpnl-content">
+ <u:style name="background-color" skin="generalBackgroundColor" />
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+
+ <u:selector name=".rich-mpnl-header">
+ <u:style name="background-color" skin="headerBackgroundColor" />
+ <u:style name="border-color" skin="headerBackgroundColor" />
+ <u:style name="background-image" >
+ <f:resource f:key="org.richfaces.renderkit.html.GradientA"/>
+ </u:style>
+ </u:selector>
+
+ <u:selector name=".rich-mpnl-shadow">
+ <u:style name="background-color" skin="shadowBackgroundColor" />
+ </u:selector>
+
+ <u:selector name=".rich-mpnl-spacer, .rich-mpnl-resizer">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/spacer.gif"/>
+ </u:style>
+ </u:selector>
+
+ <u:selector name=".rich-mpnl-text">
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="color" skin="headerTextColor" />
+ <u:style name="font-weight" skin="headerWeightFont" />
+ <u:style name="font-family" skin="headerFamilyFont" />
+ </u:selector>
+
<f:verbatim>
.rich-mpnl-ovf-hd {
overflow: hidden;
}
-
.rich-mpnl-trim {
position: relative;
z-index: 0;
}
-
.rich-mpnl-iframe {
position: absolute;
left: 0px;
@@ -22,7 +56,6 @@
overflow-y: hidden;
z-index: -1;
}
-
.rich-mpnl-mask-div {
position: fixed;
top: 0;
@@ -35,16 +68,13 @@
border-style: none;
background-color: #d0d0d0;
}
-
.rich-mpnl-mask-div-opaque {
filter: alpha(opacity=50);
opacity: 0.5;
}
-
.rich-mpnl-mask-div-transparent {
background-color: transparent;
}
-
.rich-mpnl-panel {
position: fixed;
margin: 0px;
@@ -54,7 +84,6 @@
left: 0px;
top: 0px;
}
-
.rich-mpnl-resizer {
line-height: 1px;
font-size: 1px;
@@ -63,14 +92,12 @@
filter: alpha(opacity=50);
opacity: 0.5;*/
}
-
.rich-mpnl-header-cell {
height: 20px;
width: 100%;
vertical-align: middle;
z-index: 5;
}
-
.rich-mpnl-button {
outline-style: none;
position: absolute;
@@ -83,90 +110,52 @@
top: 0px;
z-index: -300;
}
-
.rich-mpnl-controls {
position: absolute;
top: 3px;
right: 3px;
z-index: 1;
}
-
.rich-modalpanel {
left: 0px;
top: 0px;
}
</f:verbatim>
-
- <u:selector name=".rich-mpnl-spacer, .rich-mpnl-resizer">
- <u:style name="background-image">
- <f:resource f:key="/org/richfaces/renderkit/html/images/spacer.gif"/>
- </u:style>
- </u:selector>
-<f:verbatim>
-<![CDATA[
-.rich-mpnl-content {
- border-width: 1px;
- border-style: solid;
- padding : 1px;
- background-color: inherit;
-}
+ <f:verbatim>
+
+ <![CDATA[
+ .rich-mpnl-content {
+ border-width: 1px;
+ border-style: solid;
+ padding : 1px;
+ background-color: inherit;
+ }
-.rich-mpnl-header{
- padding : 2px;
- border-width: 1px;
- border-style: solid;
- background-position : top left;
- background-repeat : repeat-x;
-}
+ .rich-mpnl-header{
+ padding : 2px;
+ border-width: 1px;
+ border-style: solid;
+ background-position : top left;
+ background-repeat : repeat-x;
+ }
-.rich-mpnl-body{
- padding : 10px;
-}
+ .rich-mpnl-body{
+ padding : 10px;
+ }
-.rich-mpnl-shadow {
- position: absolute;
- height: 100%;
- width: 100%;
- z-index: -1;
- top: 4px;
- left: 4px;
- filter:alpha(opacity=10);
- opacity: 0.1;
-}
-
+ .rich-mpnl-shadow {
+ position: absolute;
+ height: 100%;
+ width: 100%;
+ z-index: -1;
+ top: 4px;
+ left: 4px;
+ filter:alpha(opacity=10);
+ opacity: 0.1;
+ }
]]>
</f:verbatim>
-<u:selector name=".rich-mpnl-content">
- <u:style name="background-color" skin="generalBackgroundColor" />
- <u:style name="border-color" skin="panelBorderColor" />
-</u:selector>
-<u:selector name=".rich-mpnl-header">
- <u:style name="background-color" skin="headerBackgroundColor" />
- <u:style name="border-color" skin="headerBackgroundColor" />
- <u:style name="background-image" >
- <f:resource f:key="org.richfaces.renderkit.html.GradientA"/>
- </u:style>
-</u:selector>
-
-
-<u:selector name=".rich-mpnl-text">
- <u:style name="font-size" skin="headerSizeFont" />
- <u:style name="color" skin="headerTextColor" />
- <u:style name="font-weight" skin="headerWeightFont" />
- <u:style name="font-family" skin="headerFamilyFont" />
-</u:selector>
-
-<u:selector name=".rich-mpnl-body">
- <u:style name="font-size" skin="generalSizeFont" />
- <u:style name="color" skin="generalTextColor" />
- <u:style name="font-family" skin="generalFamilyFont" />
-</u:selector>
-
-<u:selector name=".rich-mpnl-shadow">
- <u:style name="background-color" skin="shadowBackgroundColor" />
-</u:selector>
-
</f:template>
15 years, 3 months
JBoss Rich Faces SVN: r15526 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-09-10 09:41:53 -0400 (Thu, 10 Sep 2009)
New Revision: 15526
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_editor.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml
Log:
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_editor.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_editor.xml 2009-09-10 13:39:11 UTC (rev 15525)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_editor.xml 2009-09-10 13:41:53 UTC (rev 15526)
@@ -1,130 +1,110 @@
<section role="NotInToc" id="rich_editor">
- <title>
- <
- rich:editor
- >
- <emphasis role="since">
- <superscript> available since <emphasis role="version">3.3.0</emphasis>
- </superscript>
- </emphasis>
- </title>
- <section>
- <title>Description</title>
- <para>The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component is used for creating a WYSIWYG editor on a page.
- </para>
- <figure>
- <title>
- <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editor1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
- <section>
- <title>Key Features</title>
- <itemizedlist>
-
- <listitem>
- <para>Seam text support</para>
- </listitem>
- <listitem>
- <para>Manageable global configurations</para>
- </listitem>
- <listitem>
- <para>Possibility to use custom plug-ins</para>
- </listitem>
- <listitem>
- <para>Support of all TinyMCE's parameters through <emphasis role="bold">
- <property><f:param></property>
- </emphasis>
+ <title> < rich:editor > <emphasis role="since">
+ <superscript> available since <emphasis role="version">3.3.0</emphasis>
+ </superscript>
+ </emphasis>
+ </title>
+ <section>
+ <title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component is used for creating a WYSIWYG editor on a page. </para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editor1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+
+ <listitem>
+ <para>Seam text support</para>
+ </listitem>
+ <listitem>
+ <para>Manageable global configurations</para>
+ </listitem>
+ <listitem>
+ <para>Possibility to use custom plug-ins</para>
+ </listitem>
+ <listitem>
+ <para>Support of all TinyMCE's parameters through <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis>
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </section>
+ <section>
+ <title>Details of Usage</title>
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> is fully based on TinyMCE web based Javascript HTML WYSIWYG editor control and supports all of the features it has. The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> adapts the TinyMCE editor for JSF environment and adds some functional capabilities. </para>
+ <para> The easiest way to place the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> on a page is as follows: </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
</para>
- </listitem>
-
- </itemizedlist>
+ <programlisting role="XML"><![CDATA[<rich:editor value="#{bean.editorValue}" />]]></programlisting>
+ <para> Implementation of <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> provides three ways to define the properties of the component: </para>
- </section>
- <section>
- <title>Details of Usage</title>
- <para>The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> is fully based on TinyMCE web based Javascript HTML WYSIWYG editor control and supports all of the features it has.
- The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> adapts the TinyMCE editor for JSF environment and adds some functional capabilities.
- </para>
- <para>
- The easiest way to place the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> on a page is as follows:
- </para>
+ <orderedlist>
+ <listitem>
+ <para>Using attributes</para>
+ </listitem>
+ <listitem>
+ <para>Using using <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> JSF tag</para>
+ </listitem>
+ <listitem>
+ <para>Using configuration files that allow you to set up multiple configurations for all editors in your application and change them in the runtime</para>
+ </listitem>
+ </orderedlist>
+
+ <para>The three methods are described in details in the chapter.</para>
+ <para> The most important properties are implemented as attributes and you can define them as any other attribute. The attributes of the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component match the corresponding properties of TinyMCE editor. </para>
+ <para> For example, a theme for the editor can be defined using the <emphasis>
+ <property>"theme"</property>
+ </emphasis> attribute like this: </para>
<para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[<rich:editor value="#{bean.editorValue}" />]]></programlisting>
- <para>
- Implementation of <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> provides three ways to define the properties of the component:
- </para>
-
- <orderedlist>
- <listitem>
- <para>Using attributes</para>
- </listitem>
- <listitem>
- <para>Using using <emphasis role="bold">
- <property><f:param></property>
- </emphasis> JSF tag</para>
- </listitem>
- <listitem>
- <para>Using configuration files that allow you to set up multiple configurations for all editors in your application and change them in the runtime</para>
- </listitem>
- </orderedlist>
-
- <para>The three methods are described in details in the chapter.</para>
- <para>
- The most important properties are implemented as attributes and you can define them as any other attribute.
- The attributes of the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component match the corresponding properties of TinyMCE editor.
- </para>
- <para>
- For example, a theme for the editor can be defined using the <emphasis>
- <property>"theme"</property>
- </emphasis> attribute like this:
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[
<rich:editor value="#{bean.editorValue}" theme="advanced" />
-]]></programlisting>
- <para>Setting a different skin for the editor can be done using the <emphasis>
- <property>"skin"</property>
- </emphasis> attribute.</para>
- <para>
- Another useful property that is implemented at attribute level is <emphasis>
- <property>"viewMode"</property>
- </emphasis>.
- The attribute switches between "visual" and "source" modes, toggling between modes is performed setting the attribute to "visual" and "source" respectively.
- Implementation of <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> also implies that you can change the modes dynamically setting the value of the <emphasis>
- <property>"viewMode"</property>
- </emphasis> attribute using EL-expression.
- </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+]]></programlisting>
+ <para>Setting a different skin for the editor can be done using the <emphasis>
+ <property>"skin"</property>
+ </emphasis> attribute.</para>
+ <para> Another useful property that is implemented at attribute level is <emphasis>
+ <property>"viewMode"</property>
+ </emphasis>. The attribute switches between "visual" and "source" modes, toggling between modes is performed setting the attribute to "visual" and "source" respectively. Implementation of <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> also implies that you can change the modes dynamically setting the value of the <emphasis>
+ <property>"viewMode"</property>
+ </emphasis> attribute using EL-expression. </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{editor.submit}" theme="advanced" viewMode="#{editor.viewMode}" >
...
<h:selectOneRadio value="#{editor.viewMode}" onchange="submit();">
@@ -133,124 +113,91 @@
</h:selectOneRadio>
...
</rich:editor>
-...]]></programlisting>
- <para>
- Most configuration options that TinyMCE provides can be applied using <emphasis role="bold">
- <property><f:param></property>
- </emphasis> JSF tag.
- The syntax is quite simple: the <emphasis>
- <property>"name"</property>
- </emphasis> attribute should contain the option,
- the <emphasis>
- <property>"value"</property>
- </emphasis> attribute assigns some value to the option.
- </para>
- <para>
- For example, this code adds some buttons to the editor and positions the toolbar.
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ <para> Most configuration options that TinyMCE provides can be applied using <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> JSF tag. The syntax is quite simple: the <emphasis>
+ <property>"name"</property>
+ </emphasis> attribute should contain the option, the <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute assigns some value to the option. </para>
+ <para> For example, this code adds some buttons to the editor and positions the toolbar. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" theme="advanced" plugins="save,paste" >
<f:param name="theme_advanced_buttons1" value="bold,italic,underline, cut,copy,paste,pasteword"/>
<f:param name="theme_advanced_toolbar_location" value="top"/>
<f:param name="theme_advanced_toolbar_align" value="left"/>
</rich:editor>
-...]]></programlisting>
- <para>This is what you get as a result:</para>
- <figure>
- <title> Setting configuration options with <f:param>
-
- </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editor2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <para>The third way to configure the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> is
- to use configuration file (.properties)</para>
-
- <para>
- This method eases your life if you need to configure multiple instances
- of the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis>: you configure the editor once
- and in one spot and the configuration properties can be applied to any
- <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> in your application.
- </para>
- <para>To implement this type of configuration you need to take a few steps:</para>
- <itemizedlist>
- <listitem>
- <para>
- Create a configuration file (.properties) in the classpath folder and add some properties to it.
- Use standard syntax for the .properties files: <code>parameter=value</code>.
- Here is an example of configuration file:
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[theme="advanced"
+...]]></programlisting>
+ <para>This is what you get as a result:</para>
+ <figure>
+ <title> Setting configuration options with <f:param> </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editor2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+ <para>The third way to configure the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> is to use configuration file (.properties)</para>
+
+ <para> This method eases your life if you need to configure multiple instances of the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis>: you configure the editor once and in one spot and the configuration properties can be applied to any <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> in your application. </para>
+ <para>To implement this type of configuration you need to take a few steps:</para>
+ <itemizedlist>
+ <listitem>
+ <para> Create a configuration file (.properties) in the classpath folder and add some properties to it. Use standard syntax for the .properties files: <code>parameter=value</code>. Here is an example of configuration
+ file: </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[theme="advanced"
plugins="save,paste"
theme_advanced_buttons1="bold,italic,underline, cut,copy,paste,pasteword"
theme_advanced_toolbar_location="top"
theme_advanced_toolbar_align="left"
-]]></programlisting>
- </listitem>
- <listitem>
- <para>
- The properties stored in configuration file are passed to the
- <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> via
- <emphasis>
- <property>"configuration"</property>
- </emphasis> attribute which takes the name of the configuration file
- as a value (with out .properties extension).
- </para>
- <para>
- For example, if you named the configuration file "editorconfig", you would address it as follows:
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+]]></programlisting>
+ </listitem>
+ <listitem>
+ <para> The properties stored in configuration file are passed to the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> via <emphasis>
+ <property>"configuration"</property>
+ </emphasis> attribute which takes the name of the configuration file as a value (with out .properties extension). </para>
+ <para> For example, if you named the configuration file "editorconfig", you would address it as follows: </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" configuration="editorconfig"/>
-...]]></programlisting>
- </listitem>
- <listitem>
- <para>
- Alternately, you can use a EL-expression to define a configuration file.
- This way you can dynamically change the sets of configuration properties.
- </para>
-
- <para>
- For example, you have two configuration files "configurationAdvanced" and "configurationSimple" and you want them to be
- applied under some condition.
- </para>
+...]]></programlisting>
+ </listitem>
+ <listitem>
+ <para> Alternately, you can use a EL-expression to define a configuration file. This way you can dynamically change the sets of configuration properties. </para>
+
+ <para> For example, you have two configuration files "configurationAdvanced" and "configurationSimple" and you want them to be applied under some condition. </para>
+ <para> To do this you need to bind <emphasis>
+ <property>"configuration"</property>
+ </emphasis> attribute to the appropriate bean property like this. </para>
+
<para>
- To do this you need to bind <emphasis>
- <property>"configuration"</property>
- </emphasis>
- attribute to the appropriate bean property like this.
- </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" configuration="#{editor.configuration}" />
-...]]></programlisting>
- <para>Your Java file should look like this.</para>
-
- <programlisting role="JAVA"><![CDATA[...
+...]]></programlisting>
+ <para>Your Java file should look like this.</para>
+
+ <programlisting role="JAVA"><![CDATA[...
String configuration;
if(some condition){//defines some condition
@@ -259,184 +206,150 @@
else{
configuration= "configurationSimple"; //the name on the file with simplified properties
}
-...]]></programlisting>
- </listitem>
-
- </itemizedlist>
-
-
- <para>
- You also might want to add some custom plug-ins to your editor.
- You can read about how to create a plugin in <ulink url="http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Plugin">TinyMCE Wiki article</ulink>.
- </para>
-
- <para>
- Adding a custom plugin also requires a few steps to take. Though, the procedure is very similar to adding a configuration file.
-
- </para>
-
- <para>This is what you need to add a plugin:</para>
- <itemizedlist>
- <listitem>
- <para>Create a .properties file and put the name of the plug-in and a path to it into the file.
- The file can contain multiple plug-in declarations. Your .properties file should be like this.
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ </listitem>
+
+ </itemizedlist>
+
+
+ <para> You also might want to add some custom plug-ins to your editor. You can read about how to create a plugin in <ulink url="http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Plugin">TinyMCE Wiki article</ulink>. </para>
+
+ <para> Adding a custom plugin also requires a few steps to take. Though, the procedure is very similar to adding a configuration file. </para>
+
+ <para>This is what you need to add a plugin:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Create a .properties file and put the name of the plug-in and a path to it into the file. The file can contain multiple plug-in declarations. Your .properties file should be like this. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
pluginName=/mytinymceplugins/plugin1Name/editor_plugin.js
-...]]></programlisting>
- </listitem>
- <listitem>
- <para>
- Use the <emphasis>
- <property>"customPlugins"</property>
- </emphasis> attribute to specify the .properties file with a plugin name and a path to it.
- </para>
- <para>
- If your .properties file is named "myPlugins", then your will have this code on the page.
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ </listitem>
+ <listitem>
+ <para> Use the <emphasis>
+ <property>"customPlugins"</property>
+ </emphasis> attribute to specify the .properties file with a plugin name and a path to it. </para>
+ <para> If your .properties file is named "myPlugins", then your will have this code on the page. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor theme="advanced" customPlugins="myPlugins" plugins="pluginName" />
-...]]></programlisting>
- </listitem>
- </itemizedlist>
- <note>
- <title>Note:</title>
- <para>
-Some plug-ins which available for download might have some dependencies on TinyMCE scripts.
-For example, dialog pop-ups require tiny_mce_popup.js script file.
-Assuming that you will not plug custom plugins to the RF jar with editor component
-(standard TinyMCE plugins creation implies that plugins are put into TinyMCE's corresponding directory)
- you should manually add required TinyMCE scripts to some project folder and correct the js includes.
- </para>
- </note>
- <para>
- The implementation of the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> component has two methods for handling
- events.
- </para>
- <para>The attributes take some function name as a value with is triggered on the appropriate event. You need to use standard JavaScript function calling syntax. </para>
-
- <itemizedlist>
- <listitem>
- <para>Using attributes (<emphasis>
- <property>"onchange"</property>
- </emphasis>,
- <emphasis>
- <property>"oninit"</property>
- </emphasis>,
- <emphasis>
- <property>"onsave"</property>
- </emphasis>,
- <emphasis>
- <property>"onsetup"</property>
- </emphasis>)
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ </listitem>
+ </itemizedlist>
+ <note>
+ <title>Note:</title>
+ <para> Some plug-ins which available for download might have some dependencies on TinyMCE scripts. For example, dialog pop-ups require tiny_mce_popup.js script file. Assuming that you will not plug custom plugins to the RF
+ jar with editor component (standard TinyMCE plugins creation implies that plugins are put into TinyMCE's corresponding directory) you should manually add required TinyMCE scripts to some project folder and correct
+ the js includes. </para>
+ </note>
+ <para> The implementation of the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component has two methods for handling events. </para>
+ <para>The attributes take some function name as a value with is triggered on the appropriate event. You need to use standard JavaScript function calling syntax. </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Using attributes (<emphasis>
+ <property>"onchange"</property>
+ </emphasis>, <emphasis>
+ <property>"oninit"</property>
+ </emphasis>, <emphasis>
+ <property>"onsave"</property>
+ </emphasis>, <emphasis>
+ <property>"onsetup"</property>
+ </emphasis>) </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" onchange="myCustomOnChangeHandler()" />
-...]]></programlisting>
- </listitem>
- <listitem>
+...]]></programlisting>
+ </listitem>
+ <listitem>
+ <para> Using <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> as a child element defining the <emphasis>
+ <property>"name"</property>
+ </emphasis> attribute with one of the TinyMCE's callbacks and the <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute takes the function name you want to be called on the corresponding event as the value. Note, that the syntax in this case is a bit different: parentheses are not required. </para>
<para>
- Using <emphasis role="bold">
- <property><f:param></property>
- </emphasis> as a child element defining the <emphasis>
- <property>"name"</property>
- </emphasis> attribute
- with one of the TinyMCE's callbacks and the
- <emphasis>
- <property>"value"</property>
- </emphasis> attribute takes the function name you want to be called
- on the corresponding event as the value. Note, that the syntax in this case is a bit different: parentheses are not required.
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}">
<f:param name="onchange" value="myCustomOnChangeHandler" />
</rich:editor>
-...]]></programlisting>
- </listitem>
- </itemizedlist>
-
- <para>The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis>
- component has a build-in converter that renders HTML code generated by the editor
- to Seam text (you can read more on Seam in <ulink url="http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/text.html">Seam guide</ulink>.), it also interprets Seam text
- passed to the <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> and renders it to HTML.
- The converter can be enable with the <emphasis>
- <property>"useSeamText"</property>
- </emphasis> attribute.</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
-
- <para>This HTML code generated by editor</para>
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ </listitem>
+ </itemizedlist>
+
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component has a build-in converter that renders HTML code generated by the editor to Seam text (you can read more on Seam in <ulink url="http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/text.html">Seam
+ guide</ulink>.), it also interprets Seam text passed to the <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> and renders it to HTML. The converter can be enable with the <emphasis>
+ <property>"useSeamText"</property>
+ </emphasis> attribute.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <para>This HTML code generated by editor</para>
+ <programlisting role="XML"><![CDATA[...
<p><a href="http://mysite.com">Lorem ipsum</a> <i>dolor sit</i> amet, ea <u>commodo</u> consequat.</p>
-...]]></programlisting>
- <para>will be parsed to the following Seam text:</para>
-
- <programlisting role="XML"><![CDATA[...
+...]]></programlisting>
+ <para>will be parsed to the following Seam text:</para>
+
+ <programlisting role="XML"><![CDATA[...
[Lorem ipsum=>http://mysite.com] *dolor sit* amet, ea _commodo_ consequat.
...]]></programlisting>
- <para>Accordingly, if the Seam text is passed to the component it will be parsed to HTML code.</para>
+ <para>Accordingly, if the Seam text is passed to the component it will be parsed to HTML code.</para>
- </section>
- <section>
- <title>Reference Data</title>
- <para>
- <ulink url="&tlddoc;rich/editor.html">Table of
- <rich:editor>
- attributes</ulink>.
- </para>
- <table>
- <title>Component Identification Parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.component.editor</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.richfaces.component.html.Htmleditor</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.richfaces.component.editor</entry>
- </row>
- <row>
- <entry>renderer-type</entry>
- <entry>org.richfaces.renderkit.html.editorRenderer</entry>
- </row>
- <row>
- <entry>tag-class</entry>
- <entry>org.richfaces.taglib.editorTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
+ </section>
+ <section>
+ <title>Reference Data</title>
+ <para>
+ <ulink url="&tlddoc;rich/editor.html">Table of <rich:editor> attributes</ulink>. </para>
+ <table>
+ <title>Component Identification Parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.component.editor</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.Htmleditor</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.component.editor</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.renderkit.html.editorRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.editorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
<title>CSS selectors for the layout of the editor</title>
<tgroup cols="4">
<thead>
@@ -447,30 +360,30 @@
<entry>CSS property</entry>
</row>
</thead>
- <tbody>
+ <tbody>
<row>
- <entry>.richfacesSkin .mceButton</entry>
- <entry>Defines styles for the buttons</entry>
+ <entry>.richfacesSkin .mceButton</entry>
+ <entry>Defines styles for the buttons</entry>
<entry>n/a</entry>
<entry>background-image</entry>
</row>
-
+
<row>
- <entry>.richfacesSkin .mceButtonDisabled .mceIcon </entry>
+ <entry>.richfacesSkin .mceButtonDisabled .mceIcon </entry>
<entry>Defines styles for the icons</entry>
<entry>n/a</entry>
<entry>opacity</entry>
</row>
-
- <row>
- <entry>.richfacesSkin .mceIframeContainer</entry>
+
+ <row>
+ <entry>.richfacesSkin .mceIframeContainer</entry>
<entry>Defines styles for the container</entry>
<entry>panelBorderColor</entry>
<entry>border-top-color, border-bottom-color</entry>
</row>
-
+
<row>
- <entry morerows="2">.richfacesSkin .mceListBox .mceText</entry>
+ <entry morerows="2">.richfacesSkin .mceListBox .mceText</entry>
<entry morerows="2">Defines styles for the list box</entry>
<entry>generalFamilyFont</entry>
<entry>font-family</entry>
@@ -483,67 +396,64 @@
<entry>tableBackgroundColor</entry>
<entry>background</entry>
</row>
-
+
<row>
- <entry>.richfacesSkin .mceExternalToolbar</entry>
+ <entry>.richfacesSkin .mceExternalToolbar</entry>
<entry>Defines styles for the toolbar</entry>
<entry>panelBorderColor</entry>
<entry>border-color</entry>
</row>
-
+
<row>
<entry>.richfacesSkin .mceMenu</entry>
<entry>Defines styles for the menus</entry>
<entry>panelBorderColor</entry>
<entry>border-color</entry>
</row>
-
+
<row>
- <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
+ <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
<entry>Defines styles for the active menu items</entry>
<entry>additionalBackgroundColor</entry>
<entry>background-color</entry>
</row>
-
+
<row>
- <entry>.richfacesSkin .mceSeparator</entry>
+ <entry>.richfacesSkin .mceSeparator</entry>
<entry>Defines styles for the buttons separator</entry>
<entry>n/a</entry>
<entry>background-image</entry>
</row>
-
+
<row>
- <entry>.richfacesSkin table.mceLayout</entry>
+ <entry>.richfacesSkin table.mceLayout</entry>
<entry>Defines styles for the table layout</entry>
<entry>panelBorderColor</entry>
<entry>border-left-color, border-right-color</entry>
</row>
-
+
<row>
- <entry>.richfacesSkin table.mceToolbar</entry>
+ <entry>.richfacesSkin table.mceToolbar</entry>
<entry>Defines styles for the rows of icons within toolbar</entry>
<entry>n/a</entry>
<entry>padding</entry>
- </row>
+ </row>
</tbody>
</tgroup>
- </table>
- You can find all necessary information about style classes redefinition in
- <link linkend="customstyles">Definition of Custom Style Classes</link>
- section.
- </section>
- <section>
- <title>Relevant Resources Links</title>
-
- <para>The <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> is based on TinyMCE editor and supports almost all its features and properties some of which are not described here since you can find more detailed documentation on them on the official <ulink url="http://wiki.moxiecode.com/index.php/TinyMCE:Index">web site.</ulink>
- </para>
-
-
- <para>
- <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/editor.jsf?c=editor">On RichFaces LiveDemo page </ulink> you can see an example of <emphasis role="bold">
- <property><rich:editor></property>
- </emphasis> usage and sources for the given example. </para>
- </section>
-</section>
\ No newline at end of file
+ </table> You can find all necessary information about style classes redefinition in <link linkend="customstyles">Definition of Custom Style Classes</link> section. </section>
+ <section>
+ <title>Relevant Resources Links</title>
+
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> is based on TinyMCE editor and supports almost all its features and properties some of which are not described here since you can find more detailed documentation on them on the official <ulink
+ url="http://wiki.moxiecode.com/index.php/TinyMCE:Index">web site.</ulink>
+ </para>
+
+
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/editor.jsf?c=editor">On RichFaces LiveDemo page </ulink> you can see an example of <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> usage and sources for the given example. </para>
+ </section>
+</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml 2009-09-10 13:39:11 UTC (rev 15525)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml 2009-09-10 13:41:53 UTC (rev 15526)
@@ -423,7 +423,7 @@
<entry>Defines transparency for blocking <div> element</entry>
</row>
<row>
- <entry>rich-mpnl-ovf-hd</entry>
+ <entry>.rich-mpnl-ovf-hd</entry>
<entry>Defines style for block element content</entry>
</row>
<row>
15 years, 3 months
JBoss Rich Faces SVN: r15525 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-09-10 09:39:11 -0400 (Thu, 10 Sep 2009)
New Revision: 15525
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml
Log:
RF-7804: Rich Output component group description review --> rich:modalPanel
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml 2009-09-10 11:58:32 UTC (rev 15524)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_modalPanel.xml 2009-09-10 13:39:11 UTC (rev 15525)
@@ -1,624 +1,519 @@
<section role="NotInToc" id="rich_modalPanel">
- <title>
- <
- rich:modalPanel
- >
- <emphasis role="since">
- <superscript> available since <emphasis role="version">3.0.0</emphasis>
- </superscript>
- </emphasis>
- </title>
- <section>
- <title>Description</title>
- <para>The component implements a modal dialog window. All operations in
- the main application window are locked out while this window is active.
- Opening and closing the window is done through client JavaScript
- code.</para>
-
- <figure>
- <title>The <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> component opens in closest to observer layer.
- All other layers are dimmed by blocking <code><div></code> element (gray on the picture).</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/modalPanel_init.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section>
- <title>Key Features</title>
-
- <itemizedlist>
- <listitem>
- <para>Highly customizable look and feel</para>
- </listitem>
- <listitem>
- <para>Support of draggable operations and size changes by you</para>
- </listitem>
- <listitem>
- <para>Easy positioning for the modal dialog window</para>
- </listitem>
- <listitem>
- <para>Possibility to restore of the previous component state on a page (including position on the screen) after submitting and reloading</para>
- </listitem>
- </itemizedlist>
- </section>
- <section>
- <title>Details of Usage</title>
-
- <para>The component is defined as a panel with some content inside that displays
- its content as a modal dialog. To call it and to close it, the client
- API for the window is used.</para>
-
- <table>
- <title>Functions description</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Function</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>Richfaces.showModalPanel (client
- Id)</entry>
-
- <entry>Opens a window with a specified client
- Id</entry>
- </row>
-
- <row>
- <entry>Richfaces.hideModalPanel (client
- Id)</entry>
-
- <entry>Closes a window with a specified client
- Id</entry>
- </row>
-
- <row>
- <entry>Richfaces.hideTopModalPanel ()</entry>
-
- <entry>Closes the current visible window at the top</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <important>
- <title>Important:</title>
- <para>To work properly the <rich:modalPanel> should
- always be placed outside the original <h:form>
- and must include its own <h:form> for such
- cases like performing submissions from within the
- <rich:modalPanel>. </para>
- </important>
- <note>
- <title>Note:</title>
- <para>In order to avoid a bug in IE, the root node of the dialog is
- moved on the top of a DOM tree. </para>
- </note>
-
-
- <para>It's possible to add a <emphasis>
- <property>"header"</property>
- </emphasis> facet to the component to set the content for the
- header.</para>
-
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[<a onclick="Richfaces.showModalPanel('pnl');" href="#">Show ModalPanel</a>
+ <title><rich:modalPanel> <emphasis role="since"><superscript> available since <emphasis role="version">3.0.0</emphasis></superscript></emphasis></title>
+ <section>
+ <title>Description</title>
+ <para>
+ The component implements a modal window that blocks user interaction with the main application while active.
+ </para>
+
+ <figure>
+ <title>The <emphasis role="bold"><property><rich:modalPanel></property></emphasis> is opened in "closest" to an observer layer.
+ Other layers are dimmed by blocking <code><div></code> (gray on the picture).</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/modalPanel_init.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>
+ <para>Easy positionable on thе screen</para>
+ </listitem>
+ <listitem>
+ <para>Resizable by end user</para>
+ </listitem>
+ <listitem>
+ <para>Supports drag operations</para>
+ </listitem>
+ <listitem>
+ <para>Restores it's state including position after submitting and reloading</para>
+ </listitem>
+ <listitem>
+ <para>Has customizable look and feel</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Details of Usage</title>
+
+ <important>
+ <title>Important:</title>
+ <para>
+ <!-- DO NOT wrap component names into <property> — they become unreadable on the "Important" background. -->
+ To work properly, the <emphasis role="bold"><rich:modalPanel></emphasis> should always be placed outside the original <emphasis role="bold"><h:form></emphasis>.
+ For performing submits from within the <emphasis role="bold"><rich:modalPanel></emphasis> it must include its own <emphasis role="bold"><h:form></emphasis>.
+ </para>
+
+ <para>
+ In order to avoid a bug in IE, the root node of the dialog is moved on the top of a DOM tree.
+ </para>
+ </important>
+
+ <para>
+ Position the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> on the screen by specifying coordinates of it's top-left corner.
+ Set values for <emphasis><property>"top"</property></emphasis> and <emphasis><property>"left"</property></emphasis> attributes in pixels for Y and X coordinates correspondingly.
+ By default the component is autopositionable.
+ </para>
+
+ <para>
+ The modal window can be moved and resized by the end user.
+ To disable those features (which are enabled by default) set <emphasis><property>"moveable"</property></emphasis>
+ and <emphasis><property>"resizeable"</property></emphasis> attributes to <code>false</code>.
+ Resizing may be limited by specifying window's minimal sizes with the <emphasis><property>"minWidth"</property></emphasis> and <emphasis><property>"minHeight"</property></emphasis> attributes.
+ </para>
+
+ <para>
+ To open and close the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> use one of three <link linkend="mp_jsapi">JS API functions</link> (offset to the "Reference Data" below in this chapter):
+ </para>
+ <programlisting role="XML"><![CDATA[<a onclick="Richfaces.showModalPanel('pnl');" href="#">Show ModalPanel</a>
<a4j:form>
- <rich:modalPanel id="pnl">
- <f:facet name="header">
- <h:outputText value="This is a panel header" />
- </f:facet>
- <p>The &lt;rich:modalPanel&gt; accepts different types of information:
- from simple text to iterative components such as &lt;rich:dataTable&gt;, etc.
- </p>
- <a onclick="Richfaces.hideModalPanel('pnl');" href="#">Hide</a>
- </rich:modalPanel>
+ <rich:modalPanel id="pnl" >
+ <a onclick="Richfaces.hideModalPanel('pnl');" href="#">Hide ModalPanel</a>
+ </rich:modalPanel>
</a4j:form>]]></programlisting>
-
- <para>Here is what happening on the page:</para>
-
- <figure>
- <title>
- <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> with links</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/modalPanel2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>A facet named <emphasis>
- <property>"controls"</property>
- </emphasis> can be added to the component to place control elements on
- a header.</para>
-
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[<a onclick="Richfaces.showModalPanel('pnl');" href="#">Show ModalPanel</a>
-<a4j:form>
- <rich:modalPanel id="pnl">
- <f:facet name="header">
- <h:outputText value="This is a panel header" />
- </f:facet>
- <f:facet name="controls">
- <h:graphicImage value="/pages/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('pnl')" />
- </f:facet>
- <p>The &lt;rich:modalPanel&gt; accepts different types of information:
- from simple text to iterative components such as &lt;rich:dataTable&gt;, etc.
- </p>
- </rich:modalPanel>
-</a4j:form>]]></programlisting>
-
- <para>The result:</para>
-
- <figure>
- <title>
- <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> with 'Close' control</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/modalPanel3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>To understand the sence of "<emphasis>
- <property>domElementAttachment</property>
- </emphasis>" attribute you should understand the
- <emphasis>stacking context</emphasis> in the division
- element (<code><div></code>) HTML makeup. Since each
- positioned or z-indexed element (in CSS <code>position:
- absolute</code> or <code>relative</code> or <code>z-index:
- [any integer value different from 0]</code>) form their own
- stacking context the <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> nested into such element may be overlapped with another
- elements, which appear later in HTML hierarchy and assimilated with
- basic stacking context (HTML <body>). To make the panel
- rendered in closest to the observer layer and avoid such overlapping,
- the component was designed in way when it is always being
- automatically assimilated with <code><body></code> and
- with a very high rendering layer (<code>z-index</code>). Due to some
- side effects the <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> should not always be assimilated with
- <code><body></code> stacking context. The "<emphasis>
- <property>domElementAttachment</property>
- </emphasis>" attribute helps to reassign the panel to it
- '<emphasis>parent</emphasis>' or
- '<emphasis>form</emphasis>' element. If
- '<emphasis>form</emphasis>' is used and no
- parent form is available the panel is functioning as if it is
- assimilated with <code><body></code>. </para>
-
- <note>
- <title>Note:</title>
- <para>If "<emphasis>
- <property>domElementAttachment</property>
- </emphasis>" value is not
- '<emphasis>body</emphasis>' then
- some overlapping may occur. </para>
- </note>
-
- <para>To manage window placement relative to the component, there are <emphasis>
- <property>"left"</property>
- </emphasis> and <emphasis>
- <property>"top"</property>
- </emphasis> attributes defining a window shifting relative to the
- top-left corner of the window.</para>
-
- <para>Modal windows can also support resize and move operations on the client
- side. To allow or disallow these operations, set the <emphasis>
- <property>"resizeable"</property>
- </emphasis> and <emphasis>
- <property>"moveable"</property>
- </emphasis> attributes to "true" or
- "false" values. Window resizing is also limited by <emphasis>
- <property>"minWidth"</property>
- </emphasis> and <emphasis>
- <property>"minHeight"</property>
- </emphasis> attributes specifying the minimal window sizes.</para>
- <para> Also you can use <emphasis>
- <property>"minWidth"</property>
- </emphasis> and <emphasis>
- <property>"minHeight"</property>
- </emphasis> attributes used as <code>showModalPanel()</code> arguments
- in JavaScript options. </para>
- <para> You can pass your parameters during modalPanel opening or closing. This
- passing could be performed in the following way: </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[Richfaces.showModalPanel('panelId', {left: auto, param1: value1});]]></programlisting>
- <para> Thus, except the standard modalPanel parameters you can pass any of your
- own parameters. </para>
- <para> Also modalPanel allows to handle its own opening and closing events on
- the client side. The <emphasis>
- <property>"onshow"</property>
- </emphasis> attribute is used in this case. </para>
- <para> The following example shows how on the client side to define opening and
- closing event handling in such a way that your own parameters could
- also be obtained: </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
-
- <programlisting role="XML"><![CDATA[onshow="alert(event.parameters.param1)"]]></programlisting>
-
- <para> Here, during modalPanel opening the value of a passing parameter is
- output. </para>
- <para> More information about this problem could be found on the <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=111804">RichFaces Development Forum</ulink>.</para>
- <para> There is a possibility to restore of the previous component state on a
- page (including position on the screen) after submitting and
- reloading. The modalPanel has some special attributes like <emphasis>
- <property>"showWhenRendered"</property>
- </emphasis> and <emphasis>
- <property>"keepVisualState"</property>
- </emphasis>. </para>
- <para>
- <emphasis>
- <property>"showWhenRendered"</property>
- </emphasis> - This boolean attribute is used if modalPanel should be
- rendered after first page loading. </para>
- <para>
- <emphasis>
- <property> "keepVisualState"</property>
- </emphasis> - Used if modalPanel should save state after submission.
- If <code>keepVisualState="true"</code> then
- parameters which modalPanel has during opening should be submitted and
- passed to new page. </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
-
- <programlisting role="XML"><![CDATA[<a href="javascript:Richfaces.showModalPanel('pnl', {top:'10px', left:'10px', height:'400'});">Show</a>]]></programlisting>
-
- <para> Here, if you open modal dialog window using current link and after
- submits data then modalPanel destination and height on new loaded page
- is restored. </para>
- <para>if you need the content of the modalPanel to be submitted - you need to
- remember two important rules: </para>
- <itemizedlist>
- <listitem>
- <para>modalPanel must have its own form if it has form
- elements (input or/and command components) inside
- (as it was shown in the example above) </para>
- </listitem>
- <listitem>
- <para>modalPanel must not be included into the form (on any
- level up) if it has the form inside.</para>
- </listitem>
- </itemizedlist>
- <para>Simple example of using commandButton within modalPanel is placed
- below.</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
-
- <programlisting role="XML"><![CDATA[<a4j:form>
-<rich:modalPanel>
- <f:facet name="header">
- <h:outputText value="Test" />
- </f:facet>
- <f:facet name="controls">
- <h:commandLink value="Close" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
- </f:facet>
- <h:form>
- <h:commandButton value="Test" action="#{TESTCONTROLLER.test}" />
- </h:form>
+
+ <para>The result:</para>
+
+ <figure>
+ <title>
+ The panel is opened with "Richfaces.showModalPanel();" JS API function.
+ Clicking 'Hide ModalPanel' will call "Richfaces.hideModalPanel();" function.
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/modalPanel1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>
+ Besides client ID it is possible to pass other parameters while opening and closing the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> with the JS API function.
+ For example, you can pass top and left indents or panel size:
+ </para>
+ <programlisting role="XML"><![CDATA[<a onclick="Richfaces.showModalPanel('pnl', {top:'10px', left:'10px', height:'400px'});">Show ModalPanel</a>]]></programlisting>
+
+ <para>
+ Also the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> allows to handle its own opening and closing events on the client side.
+ Custom parameters passed with JS API are also obtained in this case:
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:modalPanel onshow="alert(event.parameters.param1)">
+ ...
</rich:modalPanel>]]></programlisting>
-
-
-
- <para>See also discussion about this problem on the <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064191">RichFaces Users Forum</ulink>.</para>
- <para> The <emphasis>
- <property>"label"</property>
- </emphasis> attribute is a generic attribute. The <emphasis>
- <property>"label"</property>
- </emphasis> attribute provides an association between a component, and
- the message that the component (indirectly) produced. This attribute
- defines the parameters of localized error and informational messages
- that occur as a result of conversion, validation, or other application
- actions during the request processing lifecycle. With the help of this
- attribute you can replace the last parameter substitution token shown
- in the messages. For example, {1} for
- <code>"DoubleRangeValidator.MAXIMUM"</code>,
- {2} for <code>"ShortConverter.SHORT"</code>. </para>
- <para>In RichFaces Cookbook article about
- <ulink url="http://wiki.jboss.org/auth/wiki/RichFacesCookbook/DetailModalPanelFromTable"> Modal Panel </ulink> there is information for those of you who
- would like to click on a details link in table and have it show a
- modal panel with information loaded from the server. </para>
-
- <para>
- To avoid overlapping of the <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> component on the page by any embed objects (inserted with HTML <code><EMBED></code> tag) set the <emphasis>
- <property>"overlapEmbedObjects"</property>
- </emphasis> attribute to "true".
- </para>
-
-
+
+
+ <para>
+ The component can restore it's previous state (including position on the screen) after submitting and reloading.
+ Set <emphasis><property>"keepVisualState"</property></emphasis> to <code>true</code> to submit and pass <emphasis role="bold"><property><rich:modalPanel></property></emphasis> current parameters to a new page.
+ The <emphasis><property>"showWhenRendered"</property></emphasis> bolean attribute is used in cases when component should be rendered after first page loading.
+ </para>
+
+ <para>
+ To understand sence of the <emphasis><property>"domElementAttachment"</property></emphasis> attribute it is necessary to understand
+ what is <emphasis>stacking context</emphasis> and how it works in the HTML makeup.
+ Since each <emphasis>positioned</emphasis> or <emphasis>z-indexed</emphasis> element (CSS <code>position:absolute</code> or <code>relative</code> and <code>z-index:*any integer different from 0*</code>)
+ form their own stacking context the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> rendered as a child of such element may be overlapped with an element
+ that appears later in HTML hierarchy or assimilated with <code><body></code> stacking context (basic for HTML page).
+ Not so fast!
+ To make the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> rendered in "closest" to an observer layer and avoid such overlapping,
+ the component was designed in way when it is always being automatically assimilated with <code><body></code> with a very high rendering layer (<code>z-index</code>).
+ But our panel should be assimilated with <code><body></code> not always, because of some side effects that take place in this case.
+ The <emphasis><property>"domElementAttachment"</property></emphasis> attribute helps to reassign the panel to it <emphasis>parent</emphasis> or <emphasis>form</emphasis> element.
+ If <emphasis>form</emphasis> is used and no parent form is available the panel is functioning as if it is assimilated with <code><body></code>.
+ </para>
+
+ <note>
+ <title>Notes:</title>
+ <para>
+ If the <emphasis><property>"domElementAttachment"</property></emphasis> value is not <code>body</code> then some overlapping may occur.
+ </para>
+ <para>
+ To avoid overlapping by an embed object (inserted with HTML <code><embed></code> tag)
+ set the <emphasis><property>"overlapEmbedObjects"</property></emphasis> to <code>true</code>.
+ </para>
+ </note>
+
+ <para>
+ The <emphasis><property>"label"</property></emphasis> attribute is a generic one.
+ It provides an association between a component and message the component produces.
+ This attribute defines parameters of localized error and informational messages that occur as a result of conversion, validation or other application actions during the request processing lifecycle.
+ With this attribute you can replace the last parameter substitution token shown in the message.
+ For example, <code>DoubleRangeValidator.MAXIMUM</code> or <code>ShortConverter.SHORT</code>.
+ </para>
+
+ <para>
+ The <emphasis role="bold"><property><rich:modalPanel></property></emphasis> supports two facets.
+ The <code>header</code> facet defines header and text label on it:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:modalPanel id="pnl">
+ <f:facet name="header">
+ <h:outputText value="I'm panel header" />
+ </f:facet>
+ <p>The <rich:modalPanel> accepts different types of information: from simple text to iterative components such as <rich:dataTable>, etc.
+ </p>
+ <a onclick="Richfaces.hideModalPanel('pnl');" href="#">Hide ModalPanel</a>
+</rich:modalPanel>
+...]]></programlisting>
+
+ <para>The result:</para>
+ <figure>
+ <title>
+ The <emphasis role="bold"><property><rich:modalPanel></property></emphasis> with header.
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/modalPanel2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>
+ The <code>controls</code> facet places any control on a header, defines image, style and function for it. For example, "Close" control:
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:modalPanel id="pnl">
+ ...
+ <f:facet name="controls">
+ <h:graphicImage value="/pages/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('pnl')" />
+ </f:facet>
+ ...
+</rich:modalPanel>]]></programlisting>
+
+ <para>The result:</para>
+ <figure>
+ <title>
+ The <emphasis role="bold"><property><rich:modalPanel></property></emphasis> with "Close" control.
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/modalPanel3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>
+ An example of using <emphasis role="bold"><property><h:commandButton></property></emphasis> within the <emphasis role="bold"><property><rich: modalPanel></property></emphasis>:
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:form>
+ <rich:modalPanel>
+ <h:form>
+ <h:commandButton value="Test" action="#{TESTCONTROLLER.test}" />
+ </h:form>
+ </rich:modalPanel>
+</a4j:form>]]></programlisting>
+
+ </section>
+
+ <section>
+ <title>Reference Data</title>
+ <para>
+ <ulink url="&tlddoc;rich/modalPanel.html">Table of <rich:modalPanel> attributes</ulink>.
+ </para>
+
+ <table>
+ <title>Component Identification Parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.ModalPanel</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.HtmlModalPanel</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.ModalPanel</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.ModalPanelRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.ModalPanelTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="mp_jsapi">
+ <title>JavaScript API functions</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Function</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Richfaces.showModalPanel('ID');</entry>
+ <entry>Opens the modal panel with specified ID</entry>
+ </row>
+ <row>
+ <entry>Richfaces.hideModalPanel('ID');</entry>
+ <entry>Closes the modal panel with specified ID</entry>
+ </row>
+ <row>
+ <entry>Richfaces.hideTopModalPanel('ID');</entry>
+ <entry>Closes the current top visible modal panel with specified ID</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Facets</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Facet</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>header</entry>
+ <entry>Defines header content</entry>
+ </row>
+ <row>
+ <entry>controls</entry>
+ <entry>Defines a control on the header</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="mPC">
+ <title>Style classes (selectors) and mapped skin parameters</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Class name (selector)</entry>
+ <entry>Description</entry>
+ <entry>Skin Parameter</entry>
+ <entry>CSS property</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry morerows="2">.rich-mpnl-body</entry>
+ <entry morerows="2">Defines styles for modalPanel content</entry>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry morerows="1">.rich-mpnl-content</entry>
+ <entry morerows="1">Defines style for modalPanel content area</entry>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry morerows="1">.rich-mpnl-header</entry>
+ <entry morerows="1">Defines styles for modalPanel header</entry>
+ <entry>headerBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>headerBackgroundColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-shadow</entry>
+ <entry>Defines styles for a modalPanel shadow</entry>
+ <entry>shadowBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry morerows="3">.rich-mpnl-text</entry>
+ <entry morerows="3">Defines styles for a wrapper <div> element of a header text</entry>
+ <entry>headerSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>headerWeightFont</entry>
+ <entry>font-weight</entry>
+ </row>
+ <row>
+ <entry>headerFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>headerTextColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table>
+ <title>Internal style classes (selectors)</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name (selector)</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>.rich-modalpanel</entry>
+ <entry>Defines styles for a wrapper <div> element of a modalPanel</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-body</entry>
+ <entry>Defines styles for modalPanel content</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-button</entry>
+ <entry>Defines styles for modalPanel button</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-controls</entry>
+ <entry>Defines styles for a wrapper <div> element of a modalPanel control</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-header-cell</entry>
+ <entry>Defines styles for a header cell</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-header</entry>
+ <entry>Defines styles for modalPanel header</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-iframe</entry>
+ <entry>Defines styles for modalPanel <iframe> container</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-mask-div</entry>
+ <entry>Defines styles for blocking <div> element</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-mask-div-opaque</entry>
+ <entry>Defines opacity for blocking <div> element</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-mask-div-transparent</entry>
+ <entry>Defines transparency for blocking <div> element</entry>
+ </row>
+ <row>
+ <entry>rich-mpnl-ovf-hd</entry>
+ <entry>Defines style for block element content</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-panel</entry>
+ <entry>Defines styles for a modalPanel</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-trim</entry>
+ <entry>Defines styles for a modalPanel</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-resizer</entry>
+ <entry>Defines styles for a wrapper <div> where cursor changes it state for resizing</entry>
+ </row>
+ <row>
+ <entry>.rich-mpnl-shadow</entry>
+ <entry>Defines styles for a modalPanel shadow</entry>
+ </row>
+
+
+ <!-- NO such classses in modalPanel.xcss
+ <row>
+ <entry>.rich-mp-container </entry>
+ <entry>Defines styles for a modalPanel container</entry>
+ </row>
+ <row>
+ <entry>.rich-mp-content-table</entry>
+ <entry>Defines styles for a <table> element of a modalPanel</entry>
+ </row>
+ -->
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ You can find all necessary information about style classes redefinition in <link linkend="customstyles">Definition of Custom Style Classes</link> section.
+ </para>
+ </section>
+
+ <section>
+ <title>Relevant Resources Links</title>
+ <para>
+ Visit <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/modalPanel.jsf?c=moda..."> ModalPanel page</ulink> at RichFaces Livedemo for examples of component usage and their sources.
+ </para>
+
+ <para>
+ Useful articles:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ "<ulink url="http://www.jboss.org/community/docs/DOC-11436">ModalPanelWizards</ulink>" — describes how to create a wizard using <emphasis role="bold"><property><rich:modalPanel></property></emphasis>
+ (the same in the RichFaces FAQ "<ulink url="http://www.jboss.org/community/wiki/PanelsandOutput#Organizewizards">section</ulink>");
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ "<ulink url="http://eclipse.dzone.com/articles/an-introduction-to-jboss-richf?page=0%2C0">An Introduction To JBoss RichFaces</ulink>" — by Max Katz describes the way
+ the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> edits and saves changes for table entries;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ "<ulink url="http://www.jboss.org/community/docs/DOC-11853">How to do a detail view modalPanel in a table</ulink>" describes how to load an information from a table to the modal panel;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ "<ulink url="http://www.jboss.org/community/docs/DOC-11435">ModalPanelValidation</ulink>" gives examples of validation in the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> (the same in the RichFaces UsersForum <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061517">topic</ulink>);
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ "<ulink url="http://www.jboss.org/community/docs/DOC-11863">RichFacesPleaseWaitBox</ulink>" describes how to show "Please wait" box and block the input
+ while an Ajax request is being processed using the combination of <emphasis role="bold"><property><a4j:status></property></emphasis> and <emphasis role="bold"><property><rich:modalPanel></property></emphasis>;
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ If you have any questions or ideas regarding the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> tell about them at the <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064191">RichFaces Users Forum</ulink>.
+ </para>
+
+
</section>
- <section>
- <title>Reference Data</title>
- <para>
- <ulink url="&tlddoc;rich/modalPanel.html">Table of
- <rich:modalPanel>
- attributes</ulink>.
- </para>
- <table>
- <title>Component Identification Parameters</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
-
- <entry>Value</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>component-type</entry>
-
- <entry>org.richfaces.ModalPanel</entry>
- </row>
-
- <row>
- <entry>component-class</entry>
-
- <entry>org.richfaces.component.html.HtmlModalPanel</entry>
- </row>
-
- <row>
- <entry>component-family</entry>
-
- <entry>org.richfaces.ModalPanel</entry>
- </row>
-
- <row>
- <entry>renderer-type</entry>
-
- <entry>org.richfaces.ModalPanelRenderer</entry>
- </row>
-
- <row>
- <entry>tag-class</entry>
-
- <entry>org.richfaces.taglib.ModalPanelTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
- <title>JavaScript API</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Function</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
-
- <row>
- <entry>show()</entry>
- <entry>Opens the corresponding modalPanel</entry>
- </row>
-
- <row>
- <entry>hide()</entry>
- <entry>Closes the corresponding modalPanel</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
- <table>
- <title>Facets</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Facet</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>header</entry>
- <entry>Define the header content</entry>
- </row>
- <row>
- <entry>controls</entry>
- <entry>Defines the control elements on the
- header</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table id="mPC">
- <title>Classes names that define a component appearance</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>rich-modalpanel</entry>
-
- <entry>Defines styles for a wrapper
- <div> element of a
- modalPanel</entry>
- </row>
-
- <row>
- <entry>rich-mpnl-mask-div</entry>
-
- <entry>Defines styles for a wrapper
- <div> element of a mask</entry>
- </row>
-
- <row>
- <entry>rich-mpnl_panel</entry>
-
- <entry>Defines styles for a modalPanel</entry>
- </row>
-
- <row>
- <entry>rich-mp-container </entry>
-
- <entry>Defines styles for a modalPanel
- container</entry>
- </row>
-
- <row>
- <entry>rich-mpnl-resizer</entry>
-
- <entry>Defines styles for a wrapper
- <div> element of a resizing
- element</entry>
- </row>
-
- <row>
- <entry>rich-mpnl-shadow</entry>
-
- <entry>Defines styles for a modalPanel
- shadow</entry>
- </row>
-
- <row>
- <entry>rich-mp-content-table</entry>
-
- <entry>Defines styles for a <table>
- element of a modalPanel</entry>
- </row>
-
- <row>
- <entry>rich-mpnl-header</entry>
-
- <entry>Defines styles for a modalPanel
- header</entry>
- </row>
-
- <row>
- <entry>rich-mpnl-header-cell</entry>
-
- <entry>Defines styles for a header cell</entry>
- </row>
-
- <row>
- <entry>rich-mpnl-text</entry>
-
- <entry>Defines styles for a wrapper
- <div> element of a header
- text</entry>
- </row>
-
- <row>
- <entry>rich-mpnl-body</entry>
-
- <entry>Defines styles for a content inside a
- modalPanel</entry>
- </row>
-
- <row>
- <entry>rich-mpnl-controls</entry>
-
- <entry>Defines styles for a wrapper
- <div> element of a modalPanel
- control</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- You can find all necessary information about style classes redefinition in
- <link linkend="customstyles">Definition of Custom Style Classes</link>
- section.
- </section>
- <section>
- <title>Relevant Resources Links</title>
- <para>Visit <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/modalPanel.jsf?c=moda..."> ModalPanel page</ulink> at RichFaces Livedemo for examples
- of component usage and their sources. </para>
-
- <para>Read the "<ulink url="http://eclipse.dzone.com/articles/an-introduction-to-jboss-richf?page=0%2C0"> An Introduction To JBoss RichFaces</ulink>"
- tutorial by Max Katz to find out how the <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> helps to edit and save changes for table entries. </para>
-
- <para>Some articles at JBoss portal describing different aspects of <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> usage: </para>
-
- <itemizedlist>
- <listitem>
- <para> "<ulink url="http://www.jboss.org/community/docs/DOC-11436">ModalPanelWizards</ulink>" article
- describes how to create a typical wizard with the
- help of <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> component (the same could also be
- found in the "<ulink url="http://www.jboss.org/community/wiki/PanelsandOutput#Organizewizards"> How to organize wizards using the
- <rich:modalPanel>
- component?</ulink>" chapter of RichFaces
- FAQ guide); </para>
- </listitem>
- <listitem>
- <para>Refer to the "<ulink url="http://www.jboss.org/community/docs/DOC-11853">How to do a detail view modalPanel in a
- table</ulink>" article in the RichFaces cookbook at JBoss Portal to find out how to
- build a table with details link clicking on which
- will display a modal panel with information loaded from the server.</para>
- </listitem>
- <listitem>
- <para>"<ulink url="http://www.jboss.org/community/docs/DOC-11435">ModalPanelValidation</ulink>" article
- gives examples of validation in <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> (the same in the <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061517">corresponding topic</ulink> at RichFaces Users
- Forum);</para>
- </listitem>
- <listitem>
- <para>"<ulink url="http://www.jboss.org/community/docs/DOC-11863">RichFacesPleaseWaitBox</ulink>" article
- describes how to show a "Please
- wait" box and block the input while the
- Ajax request is being processed using combination
- of <emphasis role="bold">
- <property><a4j:status></property>
- </emphasis> and <emphasis role="bold">
- <property><rich:modalPanel></property>
- </emphasis> components. </para>
- </listitem>
- </itemizedlist>
-
- </section>
</section>
\ No newline at end of file
15 years, 3 months
JBoss Rich Faces SVN: r15524 - in branches/community/3.3.X/docs/userguide/en/src/main/docbook: modules and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2009-09-10 07:58:32 -0400 (Thu, 10 Sep 2009)
New Revision: 15524
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_log.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_repeat.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_dataTable.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_datascroller.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_page.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_tree.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml
Log:
https://jira.jboss.org/jira/browse/RF-2063 links to wiki articles are added
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_log.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_log.xml 2009-09-10 11:20:36 UTC (rev 15523)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_log.xml 2009-09-10 11:58:32 UTC (rev 15524)
@@ -49,7 +49,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[<a4j:log level="ALL" popup="false" width="400" height="200"/>]]></programlisting>
+ <programlisting role="XML"><a4j:log level="ALL" popup="false" width="400" height="200"/></programlisting>
<para>
The component defined this way is decoded on a page as <emphasis role="bold">
@@ -107,5 +107,10 @@
<para>
Visit the <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/log.jsf?c=log">Log page</ulink> at RichFaces LiveDemo for example of component usage and their sources.
</para>
+ <para>
+ You can find some cases when <emphasis role="bold">
+ <property><a4j:log></property>
+ </emphasis> might cause JavaScript error on <ulink url="http://www.jboss.org/community/wiki/AjaxCoreComponents"> Ajax Core Components Page.</ulink>
+ </para>
</section>
</section>
\ No newline at end of file
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_repeat.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_repeat.xml 2009-09-10 11:20:36 UTC (rev 15523)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_repeat.xml 2009-09-10 11:58:32 UTC (rev 15524)
@@ -41,18 +41,18 @@
</para>
- <programlisting role="XML"><![CDATA[...
-<table>
- <tbody>
- <a4j:repeat value="#{repeatBean.items}" var="item" ajaxKeys="#{updateBean.updatedRow}">
- <tr>
- <td><h:outputText value="#{item.code}" id="item1" /></td>
- <td><h:outputText value="#{item.price}" id="item2" /></td>
- </tr>
- </a4j:repeat>
- </tbody>
-</table>
- ...]]></programlisting>
+ <programlisting role="XML">...
+<table>
+ <tbody>
+ <a4j:repeat value="#{repeatBean.items}" var="item" ajaxKeys="#{updateBean.updatedRow}">
+ <tr>
+ <td><h:outputText value="#{item.code}" id="item1" /></td>
+ <td><h:outputText value="#{item.price}" id="item2" /></td>
+ </tr>
+ </a4j:repeat>
+ </tbody>
+</table>
+ ...</programlisting>
<para>
The example above the <emphasis role="bold">
@@ -78,13 +78,13 @@
</para>
<para>The next example shows collection output as a plain HTML list:</para>
- <programlisting role="XML"><![CDATA[<ul>
- <a4j:repeat ...>
- <li>...<li/>
+ <programlisting role="XML"><ul>
+ <a4j:repeat ...>
+ <li>...<li/>
...
- <li>...<li/>
- </a4j:repeat>
-</ul>]]></programlisting>
+ <li>...<li/>
+ </a4j:repeat>
+</ul></programlisting>
<para>All other general attributes are defined according to the similar
attributes of iterative components (<emphasis role="bold">
<property><h:dataTable></property>
@@ -134,5 +134,11 @@
<para>
Visit the <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/repeat.jsf?c=repeat">Repeat page</ulink> at RichFaces LiveDemo for examples of component usage and their sources.
</para>
- </section>
+
+ <para>
+ <ulink url="http://www.jboss.org/community/wiki/Cantusea4jrepeattoiteratethemenuItems...">Here</ulink> you can find information why you can't use <emphasis role="bold"><property><a4j:repeat></property> </emphasis> to iterate the menuItems, tabs and way to solve this problem.
+
+ </para>
+
+ </section>
</section>
\ No newline at end of file
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_dataTable.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_dataTable.xml 2009-09-10 11:20:36 UTC (rev 15523)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_dataTable.xml 2009-09-10 11:58:32 UTC (rev 15524)
@@ -72,40 +72,40 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
- <f:facet name="caption">
- <h:outputText value="United States Capitals" />
- </f:facet>
- <f:facet name="header">
- <h:outputText value="Capitals and States Table" />
- </f:facet>
- <rich:column>
- <f:facet name="header">State Flag</f:facet>
- <h:graphicImage value="#{cap.stateFlag}"/>
- <f:facet name="footer">State Flag</f:facet>
- </rich:column>
- <rich:column>
- <f:facet name="header">State Name</f:facet>
- <h:outputText value="#{cap.state}"/>
- <f:facet name="footer">State Name</f:facet>
- </rich:column>
- <rich:column >
- <f:facet name="header">State Capital</f:facet>
- <h:outputText value="#{cap.name}"/>
- <f:facet name="footer">State Capital</f:facet>
- </rich:column>
- <rich:column>
- <f:facet name="header">Time Zone</f:facet>
- <h:outputText value="#{cap.timeZone}"/>
- <f:facet name="footer">Time Zone</f:facet>
- </rich:column>
- <f:facet name="footer">
- <h:outputText value="Capitals and States Table" />
- </f:facet>
-</rich:dataTable>
+ <programlisting role="XML">...
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
+ <f:facet name="caption">
+ <h:outputText value="United States Capitals" />
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="Capitals and States Table" />
+ </f:facet>
+ <rich:column>
+ <f:facet name="header">State Flag</f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ <f:facet name="footer">State Flag</f:facet>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">State Name</f:facet>
+ <h:outputText value="#{cap.state}"/>
+ <f:facet name="footer">State Name</f:facet>
+ </rich:column>
+ <rich:column >
+ <f:facet name="header">State Capital</f:facet>
+ <h:outputText value="#{cap.name}"/>
+ <f:facet name="footer">State Capital</f:facet>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Time Zone</f:facet>
+ <h:outputText value="#{cap.timeZone}"/>
+ <f:facet name="footer">Time Zone</f:facet>
+ </rich:column>
+ <f:facet name="footer">
+ <h:outputText value="Capitals and States Table" />
+ </f:facet>
+</rich:dataTable>
...
-]]></programlisting>
+</programlisting>
<para>This is a result:</para>
@@ -328,5 +328,8 @@
<para>From <ulink url="http://www.jboss.org/community/docs/DOC-11861">"rich:dataTable border to 0px "</ulink> article you'll figure out how to set rich:dataTable border to 0px </para>
<para>
<ulink url="http://www.jboss.org/community/docs/DOC-11860">dataTable Background Out </ulink> tells you how to remove rich:dataTable header background</para>
+ <para>
+ <ulink url="http://www.jboss.org/community/wiki/RichfacesDatatableCheckbox">"Richfaces Datatable Checkbox"</ulink> article helps you to create a Richface Datatable with Checkbox Column and an CheckAll Checkbox in Header.
+ </para>
</section>
</section>
\ No newline at end of file
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_datascroller.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_datascroller.xml 2009-09-10 11:20:36 UTC (rev 15523)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_datascroller.xml 2009-09-10 11:58:32 UTC (rev 15524)
@@ -108,16 +108,16 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[ ...
-<rich:datascroller for="table" maxPages="10">
- <f:facet name="first">
- <h:outputText value="First"/>
- </f:facet>
- <f:facet name="last">
- <h:outputText value="Last"/>
- </f:facet>
-</rich:datascroller>
-...]]></programlisting>
+ <programlisting role="XML"> ...
+<rich:datascroller for="table" maxPages="10">
+ <f:facet name="first">
+ <h:outputText value="First"/>
+ </f:facet>
+ <f:facet name="last">
+ <h:outputText value="Last"/>
+ </f:facet>
+</rich:datascroller>
+...</programlisting>
<figure>
<title>
<emphasis role="bold">
@@ -151,42 +151,42 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<h:form id="myForm">
- <rich:dataTable id="carList" rows="7" value="#{dataTableScrollerBean.allCars}" var="category">
- <f:facet name="header">
- <rich:columnGroup>
- <h:column>
- <h:outputText value="Make" />
- </h:column>
- <h:column>
- <h:outputText value="Model" />
- </h:column>
- <h:column>
- <h:outputText value="Price" />
- </h:column>
- </rich:columnGroup>
- </f:facet>
- <h:column>
- <h:outputText value="#{category.make}" />
- </h:column>
- <h:column>
- <h:outputText value="#{category.model}" />
- </h:column>
- <h:column>
- <h:outputText value="#{category.price}" />
- </h:column>
- </rich:dataTable>
- <rich:datascroller id="sc2" for="carList" reRender="sc1" maxPages="7" page="#{dataTableScrollerBean.scrollerPage}" />
- <h:panelGrid>
- <h:panelGroup>
- <h:outputText value="Set current page number:" />
- <h:inputText value="#{dataTableScrollerBean.scrollerPage}" id="sc1" size="1"/>
- <h:commandButton value="Set" />
- </h:panelGroup>
- </h:panelGrid>
-</h:form>
-...]]></programlisting>
+ <programlisting role="XML">...
+<h:form id="myForm">
+ <rich:dataTable id="carList" rows="7" value="#{dataTableScrollerBean.allCars}" var="category">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <h:column>
+ <h:outputText value="Make" />
+ </h:column>
+ <h:column>
+ <h:outputText value="Model" />
+ </h:column>
+ <h:column>
+ <h:outputText value="Price" />
+ </h:column>
+ </rich:columnGroup>
+ </f:facet>
+ <h:column>
+ <h:outputText value="#{category.make}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{category.model}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{category.price}" />
+ </h:column>
+ </rich:dataTable>
+ <rich:datascroller id="sc2" for="carList" reRender="sc1" maxPages="7" page="#{dataTableScrollerBean.scrollerPage}" />
+ <h:panelGrid>
+ <h:panelGroup>
+ <h:outputText value="Set current page number:" />
+ <h:inputText value="#{dataTableScrollerBean.scrollerPage}" id="sc1" size="1"/>
+ <h:commandButton value="Set" />
+ </h:panelGroup>
+ </h:panelGrid>
+</h:form>
+...</programlisting>
<para> In the example above you can enter the page number you want and set it by
clicking on the <emphasis role="bold">
@@ -232,32 +232,32 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<h:form>
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
- <rich:column>
- <h:outputText value="#{cap.name}" />
- </rich:column>
- <f:facet name="footer">
- <rich:datascroller pageIndexVar="pageIndex" pagesVar="pages">
- <f:facet name="pages">
- <h:outputText value="#{pageIndex} / #{pages}" />
- </f:facet>
- </rich:datascroller>
- </f:facet>
- </rich:dataTable>
-</h:form>
+ <programlisting role="XML">...
+<h:form>
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
+ <rich:column>
+ <h:outputText value="#{cap.name}" />
+ </rich:column>
+ <f:facet name="footer">
+ <rich:datascroller pageIndexVar="pageIndex" pagesVar="pages">
+ <f:facet name="pages">
+ <h:outputText value="#{pageIndex} / #{pages}" />
+ </f:facet>
+ </rich:datascroller>
+ </f:facet>
+ </rich:dataTable>
+</h:form>
...
-]]></programlisting>
+</programlisting>
<para> It's possible to insert optional separators between controls.
For this purpose use a <emphasis>
<property>"controlsSeparator"</property>
</emphasis> facet. An example is placed below. </para>
- <programlisting role="XML"><![CDATA[ ...
-<f:facet name="controlsSeparator">
- <h:graphicImage value="/image/sep.png"/>
-</f:facet>
-...]]></programlisting>
+ <programlisting role="XML"> ...
+<f:facet name="controlsSeparator">
+ <h:graphicImage value="/image/sep.png"/>
+</f:facet>
+...</programlisting>
<para> Starting from 3.2.1 of RichFaces multiple <emphasis role="bold">
<property><rich:datascroller></property>
</emphasis> instances behavior and page bindings are corrected.
@@ -534,5 +534,14 @@
</emphasis> and <emphasis role="bold">
<property><rich:datascroller></property>
</emphasis> in a context of Extended Data Model see on the <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=115636">RichFaces Users Forum</ulink>.</para>
+ <para>
+ <ulink url="http://www.jboss.org/community/wiki/DataTablemodeldoesntgetupdatedwhenric...">This article</ulink> describes how to solve <emphasis role="bold"><property><rich:datatable></property></emphasis> update problem when <emphasis role="bold"><property><rich:datascroller></property></emphasis> used.
+ </para>
+ <para>
+ <ulink url="http://www.jboss.org/community/wiki/Howtousepairofrichdatascrollersoutsid..."> Here</ulink> you can find out how to use pair of <emphasis role="bold"><property><rich:datascrollers></property></emphasis> outside the any dataTable.
+ </para>
+ <para>
+ The solution about how to make <emphasis role="bold"><property><rich:datascroller></property></emphasis> be updated after sorting/filtering can be found on <ulink url="http://www.jboss.org/community/wiki/richdataScrollerisnotupdatedaftersort...">Data Iteration Components FAQ. </ulink>
+ </para>
</section>
</section>
\ No newline at end of file
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_page.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_page.xml 2009-09-10 11:20:36 UTC (rev 15523)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_page.xml 2009-09-10 11:58:32 UTC (rev 15524)
@@ -92,17 +92,17 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<rich:page pageTitle="The title of the page" markupType="xhtml">
- <f:facet name="pageHeader">
- <meta content="The rich:page component" name="keywords" />
- <link rel="shortcut icon" href="/images/favicon.ico" />
- <link href="/css/style.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="/js/menu.js"></script>
- </f:facet>
- <!-- page content -->
-</rich:page>
-...]]></programlisting>
+ <programlisting role="XML">...
+<rich:page pageTitle="The title of the page" markupType="xhtml">
+ <f:facet name="pageHeader">
+ <meta content="The rich:page component" name="keywords" />
+ <link rel="shortcut icon" href="/images/favicon.ico" />
+ <link href="/css/style.css" rel="stylesheet" type="text/css" />
+ <script type="text/javascript" src="/js/menu.js"></script>
+ </f:facet>
+ <!-- page content -->
+</rich:page>
+...</programlisting>
<note>
<title>Note:</title>
<para>Note, the <emphasis role="bold">
@@ -125,20 +125,20 @@
- <programlisting role="XML"><![CDATA[...
-<rich:page sidebarPosition="left" sidebarWidth="300">
- <f:facet name="header">
- <!-- header content -->
- </f:facet>
- <f:facet name="sidebar">
- <!-- side panel content -->
- </f:facet>
- <!-- body content -->
- <f:facet name="footer">
- <!-- footer content -->
- </f:facet>
-</rich:page>
-...]]></programlisting>
+ <programlisting role="XML">...
+<rich:page sidebarPosition="left" sidebarWidth="300">
+ <f:facet name="header">
+ <!-- header content -->
+ </f:facet>
+ <f:facet name="sidebar">
+ <!-- side panel content -->
+ </f:facet>
+ <!-- body content -->
+ <f:facet name="footer">
+ <!-- footer content -->
+ </f:facet>
+</rich:page>
+...</programlisting>
<para>The <emphasis role="bold">
<property><rich:page></property>
</emphasis> component also provides attributes to define CSS classes for each nested facet as well as a body part of the page created with the component.</para>
@@ -286,5 +286,9 @@
<property><rich:page></property>
</emphasis> component usage and sources for the given example. </para>
<para>The <ulink url="http://www.jboss.org/community/docs/DOC-13336">Layout components for RichFaces 3.3.1</ulink> on the JBoss.org Wiki</para>
+ <para>
+ Refer to the <ulink url="https://www.jboss.org/community/wiki/Changingthelayoutofthepagedynamically">"Changing the layout of the page dynamically"</ulink> to find out how to change the layout of a page on the fly with <emphasis role="bold">
+ <property><rich:page></property></emphasis>.
+ </para>
</section>
</section>
\ No newline at end of file
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_tree.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_tree.xml 2009-09-10 11:20:36 UTC (rev 15523)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_tree.xml 2009-09-10 11:58:32 UTC (rev 15524)
@@ -93,7 +93,7 @@
<property><rich:tree></property>
</emphasis> is built from a simple
<code>org.richfaces.model.TreeNode</code> model: </para>
- <programlisting role="JAVA"><![CDATA[...
+ <programlisting role="JAVA">...
private TreeNodeImpl<String> stationRoot = new TreeNodeImpl<String>();
private TreeNodeImpl<String> stationNodes = new TreeNodeImpl<String>();
private String[] kickRadioFeed = { "Hall & Oates - Kiss On My List",
@@ -108,20 +108,20 @@
child.setData(kickRadioFeed[i]);
stationRoot.addChild(i, child);
}
-...]]></programlisting>
+...</programlisting>
<para> As it is mentioned before you need to pass
<code>#{stations.stationNodes}</code> property to the <emphasis>
<property>"value"</property>
</emphasis> attribute and define the <emphasis>
<property>"var"</property>
</emphasis> attribute in order to refer to the data: </para>
- <programlisting role="XML"><![CDATA[...
-<rich:tree value="#{stations.stationNodes}" var="station">
- <rich:treeNode>
- <h:outputText value="#{station}" />
- </rich:treeNode>
-</rich:tree>
-...]]></programlisting>
+ <programlisting role="XML">...
+<rich:tree value="#{stations.stationNodes}" var="station">
+ <rich:treeNode>
+ <h:outputText value="#{station}" />
+ </rich:treeNode>
+</rich:tree>
+...</programlisting>
<para> This is a result: </para>
<figure>
<title>A simple <emphasis role="bold">
@@ -151,39 +151,39 @@
<property><rich:tree></property>
</emphasis> from a local XML file. In the following example a simple
XML file (stations.xml) is used as a radio station playlist: </para>
- <programlisting role="XML"><![CDATA[<?xml version="1.0"?>
-<station name="KickRadio">
- <feed date="today">
- <song time="07:00">Hall & Oates - Kiss On My List</song>
- <song time="07:03">David Bowie - Let's Dance</song>
- <song time="07:06">Lyn Collins - Think (About It)</song>
- <song time="07:10">Kim Carnes - Bette Davis Eyes</song>
- <song time="07:15">KC & the Sunshine Band - Give It Up</song>
- </feed>
-</station>]]></programlisting>
+ <programlisting role="XML"><?xml version="1.0"?>
+<station name="KickRadio">
+ <feed date="today">
+ <song time="07:00">Hall & Oates - Kiss On My List</song>
+ <song time="07:03">David Bowie - Let's Dance</song>
+ <song time="07:06">Lyn Collins - Think (About It)</song>
+ <song time="07:10">Kim Carnes - Bette Davis Eyes</song>
+ <song time="07:15">KC & the Sunshine Band - Give It Up</song>
+ </feed>
+</station></programlisting>
<para> Now you need to create a bean that holds a model nodes: </para>
- <programlisting role="JAVA"><![CDATA[...
+ <programlisting role="JAVA">...
private TreeNode data;
...
FacesContext context = FacesContext.getCurrentInstance();
data = XmlTreeDataBuilder.build(new InputSource(getClass().getResourceAsStream("stations.xml")));
-...]]></programlisting>
+...</programlisting>
<para> Finally you should set the <emphasis>
<property>"value"</property>
</emphasis> attribute to the <code>data</code> bean property and
define the <emphasis>
<property>"var"</property>
</emphasis> attribute in order to refer to the data of nodes: </para>
- <programlisting role="XML"><![CDATA[...
-<rich:tree id="treeXML" value="#{stations.data}" var="vardata">
- <rich:treeNode>
- <h:outputText value="#{vardata.attributes['name']}" />
- <h:outputText value="#{vardata.attributes['date']}" />
- <h:outputText value="#{vardata.attributes['time']}" />
- <h:outputText value=" #{vardata.text}" />
- </rich:treeNode>
-</rich:tree>
-...]]></programlisting>
+ <programlisting role="XML">...
+<rich:tree id="treeXML" value="#{stations.data}" var="vardata">
+ <rich:treeNode>
+ <h:outputText value="#{vardata.attributes['name']}" />
+ <h:outputText value="#{vardata.attributes['date']}" />
+ <h:outputText value="#{vardata.attributes['time']}" />
+ <h:outputText value=" #{vardata.text}" />
+ </rich:treeNode>
+</rich:tree>
+...</programlisting>
<para>This is a result:</para>
<figure>
<title>A simple <emphasis role="bold">
@@ -220,21 +220,21 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<h:form>
- <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
- <rich:treeNode type="artist" iconLeaf="/images/tree/singer.png" icon="/images/tree/singer.png">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
- <rich:treeNode type="album" iconLeaf="/images/tree/disc.png" icon="/images/tree/disc.png">
- <h:outputText value="#{item.title}" />
- </rich:treeNode>
- <rich:treeNode type="song" iconLeaf="/images/tree/song.png" icon="/images/tree/song.png">
- <h:outputText value="#{item.title}" />
- </rich:treeNode>
- </rich:tree>
-</h:form>
-...]]></programlisting>
+ <programlisting role="XML">...
+<h:form>
+ <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
+ <rich:treeNode type="artist" iconLeaf="/images/tree/singer.png" icon="/images/tree/singer.png">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ <rich:treeNode type="album" iconLeaf="/images/tree/disc.png" icon="/images/tree/disc.png">
+ <h:outputText value="#{item.title}" />
+ </rich:treeNode>
+ <rich:treeNode type="song" iconLeaf="/images/tree/song.png" icon="/images/tree/song.png">
+ <h:outputText value="#{item.title}" />
+ </rich:treeNode>
+ </rich:tree>
+</h:form>
+...</programlisting>
<para>This is a result: </para>
<figure>
<title>The <emphasis>
@@ -282,9 +282,9 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="JAVA"><![CDATA[
+ <programlisting role="JAVA">
nodeFace="#{data.name != 'param-value' ? 'artist' : 'album'}"
- ]]></programlisting>
+ </programlisting>
<para>There are some essential points in a <emphasis>
<property>"nodeFace"</property>
</emphasis> attribute usage: you need to define notions for
@@ -309,9 +309,9 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<h:outputText value="#{varAttributeName}">
-...]]></programlisting>
+ <programlisting role="XML">...
+<h:outputText value="#{varAttributeName}">
+...</programlisting>
<para>
<emphasis>
<property>"varAttributeName"</property>
@@ -366,22 +366,22 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<h:form>
- <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
+ <programlisting role="XML">...
+<h:form>
+ <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
...
- <rich:treeNode type="album" iconLeaf="/images/tree/album.gif" icon="/images/tree/album.gif"
- rendered="#{item.exist}">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
- <rich:treeNode type="album" iconLeaf="/images/tree/album_absent.gif" icon="/images/tree/album_absent.gif"
- rendered="#{not item.exist}">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
+ <rich:treeNode type="album" iconLeaf="/images/tree/album.gif" icon="/images/tree/album.gif"
+ rendered="#{item.exist}">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ <rich:treeNode type="album" iconLeaf="/images/tree/album_absent.gif" icon="/images/tree/album_absent.gif"
+ rendered="#{not item.exist}">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
...
- </rich:tree>
-</h:form>
-...]]></programlisting>
+ </rich:tree>
+</h:form>
+...</programlisting>
<para>This is a result of the code: </para>
<figure>
<title>The <emphasis>
@@ -456,24 +456,24 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<rich:tree value="#{library.data}" var="item">
+ <programlisting role="XML">...
+<rich:tree value="#{library.data}" var="item">
...
- <f:facet name="icon">
- <h:graphicImage value="/images/tree/singer.png "/>
- </f:facet>
- <f:facet name="iconCollapsed">
- <h:graphicImage value="/images/tree/singer.png" />
- </f:facet>
- <f:facet name="iconExpanded">
- <h:graphicImage value="/images/tree/singer.png" />
- </f:facet>
- <f:facet name="iconLeaf">
- <h:graphicImage value="/images/tree/song.png" />
- </f:facet>
+ <f:facet name="icon">
+ <h:graphicImage value="/images/tree/singer.png "/>
+ </f:facet>
+ <f:facet name="iconCollapsed">
+ <h:graphicImage value="/images/tree/singer.png" />
+ </f:facet>
+ <f:facet name="iconExpanded">
+ <h:graphicImage value="/images/tree/singer.png" />
+ </f:facet>
+ <f:facet name="iconLeaf">
+ <h:graphicImage value="/images/tree/song.png" />
+ </f:facet>
...
-</rich:tree>
-...]]></programlisting>
+</rich:tree>
+...</programlisting>
<para> The <emphasis role="bold">
<property><rich: tree></property>
@@ -566,17 +566,17 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<rich:tree value="#{treeBean.data}" var="node" switchType="ajax" rowKeyConverter="org.richfaces.TreeRowKeyConverter">
- <rich:treeNode ajaxSingle="true">
- <h:outputText value="#{node}"/>
- </rich:treeNode>
-</rich:tree>
-...]]></programlisting>
+ <programlisting role="XML">...
+<rich:tree value="#{treeBean.data}" var="node" switchType="ajax" rowKeyConverter="org.richfaces.TreeRowKeyConverter">
+ <rich:treeNode ajaxSingle="true">
+ <h:outputText value="#{node}"/>
+ </rich:treeNode>
+</rich:tree>
+...</programlisting>
<para>In the example the tree uses the following data model:</para>
- <programlisting role="JAVA"><![CDATA[...
+ <programlisting role="JAVA">...
String[ ] components = {"< a4j:ajaxListener >", "< a4j:keepAlive >", "< a4j:actionparam >" };
String[ ][ ] attributes = {{"type"},
{"ajaxOnly", "beanName"},
@@ -595,7 +595,7 @@
child.addChild(attributes[i][j], grandChild);
}
}
-...]]></programlisting>
+...</programlisting>
</section>
<section id="tsebro" role="updated">
@@ -716,23 +716,23 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...
-<h:form>
- <rich:tree style="width:300px" value="#{libraryAjaxTree.data}" nodeFace="#{item.type}" var="item" dragIndicator=":treeDragIndicator" dropListener="#{libraryAjaxTree.processDrop}">
- <rich:treeNode type="artist" icon="/images/tree/group.png" iconLeaf="/images/tree/group.png" acceptedTypes="album">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
- <rich:treeNode type="album" icon="/images/tree/cd.png" iconLeaf="/images/tree/cd.png" dragType="album" acceptedTypes="song">
- <h:outputText value="#{item.title}" />
- <rich:dndParam name="label" type="drag" value="Album: #{item.title}" />
- </rich:treeNode>
- <rich:treeNode type="song" icon="/images/tree/music.png" iconLeaf="/images/tree/music.png" dragType="song">
- <h:outputText value="#{item.title}" />
- <rich:dndParam name="label" type="drag" value="Song: #{item.title}" />
- </rich:treeNode>
- </rich:tree>
-</h:form>
-...]]></programlisting>
+ <programlisting role="XML">...
+<h:form>
+ <rich:tree style="width:300px" value="#{libraryAjaxTree.data}" nodeFace="#{item.type}" var="item" dragIndicator=":treeDragIndicator" dropListener="#{libraryAjaxTree.processDrop}">
+ <rich:treeNode type="artist" icon="/images/tree/group.png" iconLeaf="/images/tree/group.png" acceptedTypes="album">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ <rich:treeNode type="album" icon="/images/tree/cd.png" iconLeaf="/images/tree/cd.png" dragType="album" acceptedTypes="song">
+ <h:outputText value="#{item.title}" />
+ <rich:dndParam name="label" type="drag" value="Album: #{item.title}" />
+ </rich:treeNode>
+ <rich:treeNode type="song" icon="/images/tree/music.png" iconLeaf="/images/tree/music.png" dragType="song">
+ <h:outputText value="#{item.title}" />
+ <rich:dndParam name="label" type="drag" value="Song: #{item.title}" />
+ </rich:treeNode>
+ </rich:tree>
+</h:form>
+...</programlisting>
<para>This code renders following tree:</para>
@@ -946,5 +946,8 @@
<property><rich:tree></property>
</emphasis> usage and sources for the given example. </para>
<para>How to Expand/Collapse Tree Nodes from code, see in this<ulink url="http://labs.jboss.com/wiki/ExpandCollapseTreeNodes">wiki article</ulink>. </para>
+ <para>
+ Read <ulink url="https://www.jboss.org/community/wiki/RichFacesTreeFAQ"> RichFaces Tree FAQ </ulink> to know how to avoid problem with showing only two levels of node when tree actually contains more.
+ </para>
</section>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml 2009-09-10 11:20:36 UTC (rev 15523)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml 2009-09-10 11:58:32 UTC (rev 15524)
@@ -550,7 +550,10 @@
</listitem>
- </itemizedlist>
+ </itemizedlist>
+ <para>
+ Read <ulink url="http://www.jboss.org/community/wiki/RichFacesinstallingandconfiguration">"RichFaces installing and configuration"</ulink> article to find out how to integrate RichFaces and Trinidad and possible problems that may occur while launching the RichFaces sample on the JBoss server.
+ </para>
<para>Read also the <ulink url="http://mkblog.exadel.com/?p=110">quick overview</ulink> to "Practical RichFaces " book by Max Katz at his blog.</para>
15 years, 3 months
JBoss Rich Faces SVN: r15523 - in branches/community/3.3.X/test-applications/richfaces-docs/src/main: webapp/WEB-INF and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-09-10 07:20:36 -0400 (Thu, 10 Sep 2009)
New Revision: 15523
Added:
branches/community/3.3.X/test-applications/richfaces-docs/src/main/java/org/docs/richfaces/ActionparamBean.java
branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/a4j/actionparam.xhtml
Modified:
branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/WEB-INF/faces-config.xml
branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/layout/mainMenu.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-7275 - <a4j:actionparam> sample is added
Added: branches/community/3.3.X/test-applications/richfaces-docs/src/main/java/org/docs/richfaces/ActionparamBean.java
===================================================================
--- branches/community/3.3.X/test-applications/richfaces-docs/src/main/java/org/docs/richfaces/ActionparamBean.java (rev 0)
+++ branches/community/3.3.X/test-applications/richfaces-docs/src/main/java/org/docs/richfaces/ActionparamBean.java 2009-09-10 11:20:36 UTC (rev 15523)
@@ -0,0 +1,14 @@
+package org.docs.richfaces;
+
+
+public class ActionparamBean {
+ private String name = "John";
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Modified: branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/WEB-INF/faces-config.xml 2009-09-10 11:19:50 UTC (rev 15522)
+++ branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/WEB-INF/faces-config.xml 2009-09-10 11:20:36 UTC (rev 15523)
@@ -173,6 +173,11 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>actionparamBean</managed-bean-name>
+ <managed-bean-class>org.docs.richfaces.ActionparamBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>caledar</managed-bean-name>
<managed-bean-class>org.docs.richfaces.Caledar</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
Copied: branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/a4j/actionparam.xhtml (from rev 15521, branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/a4j/ajaxListener.xhtml)
===================================================================
--- branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/a4j/actionparam.xhtml (rev 0)
+++ branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/a4j/actionparam.xhtml 2009-09-10 11:20:36 UTC (rev 15523)
@@ -0,0 +1,23 @@
+<!DOCTYPE composition 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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ template="../layout/template.xhtml"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+ <ui:define name="body">
+ <rich:panel>
+ <h:form id="form" ajaxSubmit="true">
+ <a4j:commandButton value="Set Name to Alex" reRender="rep">
+ <a4j:actionparam name="username" value="Alex" assignTo="#{actionparamBean.name}"/>
+ </a4j:commandButton>
+ <br/>
+ <h:outputText id="rep" value="Name: #{actionparamBean.name}"/>
+ </h:form>
+ </rich:panel>
+ </ui:define>
+</ui:composition>
Modified: branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/layout/mainMenu.xhtml
===================================================================
--- branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/layout/mainMenu.xhtml 2009-09-10 11:19:50 UTC (rev 15522)
+++ branches/community/3.3.X/test-applications/richfaces-docs/src/main/webapp/layout/mainMenu.xhtml 2009-09-10 11:20:36 UTC (rev 15523)
@@ -1,113 +1,137 @@
<!-- mainMenu -->
-<rich:panelMenu
-xmlns="http://www.w3.org/1999/xhtml"
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:rich="http://richfaces.org/rich"
-
- mode="client"
- iconExpandedGroup="disc"
- iconCollapsedGroup="disc"
- iconExpandedTopGroup="chevronUp"
- iconGroupTopPosition="right"
- iconCollapsedTopGroup="chevronDown"
- iconCollapsedTopPosition="right"
- id="mainMenu">
- <rich:panelMenuGroup label="Rich Components" id="group1" value="#{menuState.menu['group1']}" >
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/calendar.xhtml" >rich:calendar</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/colorPicker.xhtml" >rich:colorPicker</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/comboBox.xhtml" >rich:comboBox</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/contextMenu.xhtml" >rich:contextMenu</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/editor.xhtml" >rich:editor</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/fileUpload.xhtml" >rich:fileUpload</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/jQuery.xhtml" >rich:jQuery</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/inplaceInput.xhtml" >rich:inplaceInput</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/modalPanel.xhtml" >rich:modalPanel</h:outputLink>
- </rich:panelMenuItem>
+<rich:panelMenu
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/layout.xhtml" >rich:layout</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/page.xhtml" >rich:page</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/pickList.xhtml" >rich:pickList</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/progressBar.xhtml" >rich:progressBar</h:outputLink>
- </rich:panelMenuItem>
-
- <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/rich/tree.xhtml" >rich:tree</h:outputLink>
- </rich:panelMenuItem>
+ mode="client"
+ iconExpandedGroup="disc"
+ iconCollapsedGroup="disc"
+ iconExpandedTopGroup="chevronUp"
+ iconGroupTopPosition="right"
+ iconCollapsedTopGroup="chevronDown"
+ iconCollapsedTopPosition="right"
+ id="mainMenu">
+ <rich:panelMenuGroup label="Rich Components" id="group1" value="#{menuState.menu['group1']}">
- </rich:panelMenuGroup>
-
-<rich:panelMenuGroup label="A4J Components" id="group2" value="#{menuState.menu['group2']}">
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/a4j/ajaxListener.xhtml" >a4j:ajaxListener</h:outputLink>
-</rich:panelMenuItem>
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/a4j/queue.xhtml" >a4j:queue</h:outputLink>
-</rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/calendar.xhtml">rich:calendar</h:outputLink>
+ </rich:panelMenuItem>
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/a4j/support.xhtml" >a4j:support</h:outputLink>
-</rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/colorPicker.xhtml">rich:colorPicker</h:outputLink>
+ </rich:panelMenuItem>
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/a4j/media.xhtml" >a4j:mediaOutput</h:outputLink>
-</rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/comboBox.xhtml">rich:comboBox</h:outputLink>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/contextMenu.xhtml">rich:contextMenu</h:outputLink>
+ </rich:panelMenuItem>
-</rich:panelMenuGroup>
-<rich:panelMenuGroup label="Framework" id="group3" value="#{menuState.menu['group3']}">
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/editor.xhtml">rich:editor</h:outputLink>
+ </rich:panelMenuItem>
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
-<h:outputLink value="#{facesContext.externalContext.requestContextPath}/framework/framework.xhtml" >Framework</h:outputLink>
-</rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/fileUpload.xhtml">rich:fileUpload</h:outputLink>
+ </rich:panelMenuItem>
-</rich:panelMenuGroup>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/jQuery.xhtml">rich:jQuery</h:outputLink>
+ </rich:panelMenuItem>
-<rich:panelMenuGroup label="Skinnability" id="group4" value="#{menuState.menu['group4']}">
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/inplaceInput.xhtml">rich:inplaceInput</h:outputLink>
+ </rich:panelMenuItem>
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
-<h:outputLink value="#{facesContext.externalContext.requestContextPath}/skinning/stskinning.xhtml" >Standard Skinning</h:outputLink>
-</rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/modalPanel.xhtml">rich:modalPanel</h:outputLink>
+ </rich:panelMenuItem>
-</rich:panelMenuGroup>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/layout.xhtml">rich:layout</h:outputLink>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/page.xhtml">rich:page</h:outputLink>
+ </rich:panelMenuItem>
+
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/pickList.xhtml">rich:pickList</h:outputLink>
+ </rich:panelMenuItem>
+
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/progressBar.xhtml">rich:progressBar</h:outputLink>
+ </rich:panelMenuItem>
+
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/rich/tree.xhtml">rich:tree</h:outputLink>
+ </rich:panelMenuItem>
+
+ </rich:panelMenuGroup>
+
+ <rich:panelMenuGroup label="A4J Components" id="group2" value="#{menuState.menu['group2']}">
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/a4j/ajaxListener.xhtml">a4j:ajaxListener</h:outputLink>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/a4j/actionparam.xhtml">a4j:actionparam</h:outputLink>
+ </rich:panelMenuItem>
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/a4j/queue.xhtml">a4j:queue</h:outputLink>
+ </rich:panelMenuItem>
+
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/a4j/support.xhtml">a4j:support</h:outputLink>
+ </rich:panelMenuItem>
+
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/a4j/media.xhtml">a4j:mediaOutput</h:outputLink>
+ </rich:panelMenuItem>
+
+
+ </rich:panelMenuGroup>
+ <rich:panelMenuGroup label="Framework" id="group3" value="#{menuState.menu['group3']}">
+
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/framework/framework.xhtml">Framework</h:outputLink>
+ </rich:panelMenuItem>
+
+ </rich:panelMenuGroup>
+
+ <rich:panelMenuGroup label="Skinnability" id="group4" value="#{menuState.menu['group4']}">
+
+ <rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/skinning/stskinning.xhtml">Standard Skinning</h:outputLink>
+ </rich:panelMenuItem>
+
+ </rich:panelMenuGroup>
+
</rich:panelMenu>
\ No newline at end of file
15 years, 3 months