[richfaces-svn-commits] JBoss Rich Faces SVN: r5346 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo and 14 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Jan 14 07:31:08 EST 2008


Author: sergeyhalipov
Date: 2008-01-14 07:31:08 -0500 (Mon, 14 Jan 2008)
New Revision: 5346

Added:
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/Converter.java
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java
   trunk/samples/richfaces-demo/src/main/webapp/images/cn_componentControl.gif
   trunk/samples/richfaces-demo/src/main/webapp/images/cn_contextMenu.gif
   trunk/samples/richfaces-demo/src/main/webapp/images/cn_listShuttle.gif
   trunk/samples/richfaces-demo/src/main/webapp/images/cn_orderingList.gif
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/cmenuusage.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/control.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/mpusage.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/usage.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/playlist.xhtml
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/orderingList.xhtml
Modified:
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java
   trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java
   trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
   trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
   trunk/samples/richfaces-demo/src/main/webapp/templates/include/components-navigation.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-1901

Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java	2008-01-14 12:16:46 UTC (rev 5345)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java	2008-01-14 12:31:08 UTC (rev 5346)
@@ -77,6 +77,15 @@
 		return allCars;
 	}
 
+	public List<DemoInventoryItem> getTenRandomCars() {
+		List<DemoInventoryItem> result = new ArrayList<DemoInventoryItem>();
+		int size = getAllCars().size()-1; 
+		for (int i = 0; i < 10; i++) {
+			result.add(getAllCars().get(rand(1, size)));
+		}
+		return result;
+	}
+	
 	public int genRand() {
 		return rand(1,10000);
 	}

Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java	2008-01-14 12:16:46 UTC (rev 5345)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java	2008-01-14 12:31:08 UTC (rev 5346)
@@ -118,6 +118,10 @@
 		return ret;
 	}
 	
+	public List getSelectComponents() {
+		return getFilteredComponents("richSelect");
+	}
+	
 	public List getRichDragDropComponents() {
 		return getFilteredComponents("richDragDrop");
 	}

Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/Converter.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/Converter.java	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/Converter.java	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,23 @@
+package org.richfaces.demo.listShuttle;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+public class Converter implements javax.faces.convert.Converter{
+
+	public Object getAsObject(FacesContext context, UIComponent component,
+			String value) {
+
+		int index = value.indexOf(':');
+		
+		return new ToolBarItem(value.substring(0, index), value.substring(index + 1));
+	}
+
+	public String getAsString(FacesContext context, UIComponent component,
+			Object value) {
+
+		ToolBarItem optionItem = (ToolBarItem) value;
+		return optionItem.getLabel() + ":" + optionItem.getIcon();
+	}
+
+}
\ No newline at end of file

Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,54 @@
+package org.richfaces.demo.listShuttle;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ToolBar {
+	private List<ToolBarItem> items = new ArrayList<ToolBarItem>();
+	private List<ToolBarItem> freeItems = new ArrayList<ToolBarItem>();
+	public ToolBar() {
+		ToolBarItem item = new ToolBarItem();
+		item.setIcon("create_folder");
+		item.setLabel("Create Folder");
+		items.add(item);
+		item = new ToolBarItem();
+		item.setIcon("create_doc");
+		item.setLabel("Create Doc");
+		items.add(item);
+		item = new ToolBarItem();
+		item.setIcon("find");
+		item.setLabel("Find");
+		items.add(item);
+		item = new ToolBarItem();
+		item.setIcon("open");
+		item.setLabel("Open");
+		freeItems.add(item);
+		item = new ToolBarItem();
+		item.setIcon("save");
+		item.setLabel("Save");
+		freeItems.add(item);
+		item = new ToolBarItem();
+		item.setIcon("save_all");
+		item.setLabel("Save All");
+		freeItems.add(item);
+		item = new ToolBarItem();
+		item.setIcon("delete");
+		item.setLabel("Delete");
+		freeItems.add(item);
+	}
+	
+	public List<ToolBarItem> getItems() {
+		return items;
+	}
+	public void setItems(List<ToolBarItem> items) {
+		this.items = items;
+	}
+
+	public List<ToolBarItem> getFreeItems() {
+		return freeItems;
+	}
+
+	public void setFreeItems(List<ToolBarItem> freeItems) {
+		this.freeItems = freeItems;
+	}
+}

Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,67 @@
+package org.richfaces.demo.listShuttle;
+
+public class ToolBarItem {
+private String icon;
+private String label;
+private String iconURI;
+public ToolBarItem() {
+	// TODO Auto-generated constructor stub
+}
+
+public ToolBarItem(String label, String icon) {
+	setLabel(label);
+	setIcon(icon);
+}
+
+public String getLabel() {
+	return label;
+}
+public void setLabel(String label) {
+	this.label = label;
+}
+
+public String getIcon() {
+	return icon;
+}
+
+public void setIcon(String icon) {
+	this.icon = icon;
+}
+
+
+
+public int hashCode() {
+	final int prime = 31;
+	int result = 1;
+	result = prime * result + ((icon == null) ? 0 : icon.hashCode());
+	result = prime * result + ((label == null) ? 0 : label.hashCode());
+	return result;
+}
+
+public boolean equals(Object obj) {
+	if (this == obj)
+		return true;
+	if (obj == null)
+		return false;
+	if (getClass() != obj.getClass())
+		return false;
+	final ToolBarItem other = (ToolBarItem) obj;
+	if (icon == null) {
+		if (other.icon != null)
+			return false;
+	} else if (!icon.equals(other.icon))
+		return false;
+	if (label == null) {
+		if (other.label != null)
+			return false;
+	} else if (!label.equals(other.label))
+		return false;
+	return true;
+}
+
+public String getIconURI() {
+	return "/images/icons/"+icon+".gif";
+}
+
+
+}

Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java	2008-01-14 12:16:46 UTC (rev 5345)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java	2008-01-14 12:31:08 UTC (rev 5346)
@@ -3,8 +3,10 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 
@@ -144,4 +146,20 @@
 		this.state2 = state2;
 	}
 	
+	public void walk(TreeNode node, List<TreeNode> appendTo, Class<? extends TreeNode> type) {
+		if (type.isInstance(node)){
+			appendTo.add(node);
+		}
+		Iterator<Map.Entry<Object, TreeNode>> iterator = node.getChildren();
+		while(iterator.hasNext()) {
+			walk(iterator.next().getValue(), appendTo, type);
+		}
+		
+	}
+	
+	public ArrayList getLibraryAsList(){
+		ArrayList appendTo = new ArrayList();
+		walk(this, appendTo, Song.class);
+		return appendTo;
+	}
 }

Modified: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties	2008-01-14 12:16:46 UTC (rev 5345)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties	2008-01-14 12:31:08 UTC (rev 5346)
@@ -68,3 +68,7 @@
 page=               ajaxMisc,             Ajax Page,            /images/ico_common.gif,                 /images/cn_AjaxPage.gif,                 RichFacesComponentsLibrary.html#page,                                               jbossajax4jsf/freezone/docs/tlddoc/a4j/page.html,                 jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxRegion.html,                        /richfaces/page.jsf
 portlet=            ajaxMisc,             Ajax Portlet,         /images/ico_common.gif,                 /images/cn_AjaxPortlet.gif,              RichFacesComponentsLibrary.html#portlet,                                            jbossajax4jsf/freezone/docs/tlddoc/a4j/portlet.html,              jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIPortlet.html,                           /richfaces/portlet.jsf
 effect=             richMisc,             Effect,               /images/ico_common.gif,                 /images/cn_Effect.gif,                   RichFacesComponentsLibrary.html#effect,                                             jbossrichfaces/freezone/docs/tlddoc/rich/effect.html,             jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIEffect.html,                     /richfaces/effect.jsf
+contextMenu=		richMenu,             Context Menu,         /images/ico_dropDownMenu.gif,           /images/cn_contextMenu.gif,             RichFacesComponentsLibrary.html\#contextMenu,                                        jbossrichfaces/freezone/docs/tlddoc/rich/contextMenu.html,        jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIContextMenu.html,                /richfaces/contextMenu.jsf
+componentControl=	richMisc,            Component Control,    /images/ico_common.gif,           /images/cn_componentControl.gif,         RichFacesComponentsLibrary.html\#componentControl,                                 jbossrichfaces/freezone/docs/tlddoc/rich/componentControl.html,        jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomponentControl.html,                /richfaces/componentControl.jsf
+orderingList=		richSelect,          Ordering List, 	   /images/ico_DataTable.gif,           /images/cn_orderingList.gif,         RichFacesComponentsLibrary.html\#orderingList,                                 jbossrichfaces/freezone/docs/tlddoc/rich/orderingList.html,        jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIorderingList.html,                /richfaces/orderingList.jsf
+listShuttle=		richSelect,          List Shuttle,    		/images/ico_DataTable.gif,           /images/cn_listShuttle.gif,         RichFacesComponentsLibrary.html\#listShuttle,                                 jbossrichfaces/freezone/docs/tlddoc/rich/listShuttle.html,        jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIlistShuttle.html,                /richfaces/listShuttle.jsf
\ No newline at end of file

Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml	2008-01-14 12:16:46 UTC (rev 5345)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -2,6 +2,10 @@
 <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
                               "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
 <faces-config>
+ <converter>
+  <converter-id>listShuttleconverter</converter-id>
+  <converter-class>org.richfaces.demo.listShuttle.Converter</converter-class>
+ </converter>
  <managed-bean>
   <managed-bean-name>skinBean</managed-bean-name>
   <managed-bean-class>org.richfaces.demo.common.SkinBean</managed-bean-class>
@@ -264,6 +268,11 @@
    <value>true</value>
   </managed-property>
  </managed-bean>
+ <managed-bean>
+  <managed-bean-name>toolBar</managed-bean-name>
+  <managed-bean-class>org.richfaces.demo.listShuttle.ToolBar</managed-bean-class>
+  <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
  <navigation-rule>
   <from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
   <navigation-case>

Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_componentControl.gif
===================================================================
(Binary files differ)


Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/cn_componentControl.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_contextMenu.gif
===================================================================
(Binary files differ)


Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/cn_contextMenu.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_listShuttle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/cn_listShuttle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_orderingList.gif
===================================================================
(Binary files differ)


Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/cn_orderingList.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/cmenuusage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/cmenuusage.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/cmenuusage.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,73 @@
+<f:subview xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:a4j="http://richfaces.org/a4j"
+      xmlns:rich="http://richfaces.org/rich" id="subview"> 
+	<style>
+	.cur{
+		cursor:pointer; 
+	}
+	</style>
+	<h:form id="form">
+		
+		<rich:contextMenu attached="false" id="menu" submitMode="ajax">
+			<rich:menuItem ajaxSingle="true">
+				<b>{car} {model}</b> details
+				<a4j:actionparam name="det" assignTo="#{ddmenu.current}" value="{car} {model} details"/>
+			</rich:menuItem>
+			<rich:menuGroup value="Actions">  
+				<rich:menuItem ajaxSingle="true">
+					Put <b>{car} {model}</b> To Basket
+					<a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Put {car} {model} To Basket"/>
+				</rich:menuItem>
+				<rich:menuItem value="Read Comments" ajaxSingle="true">
+					<a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Read Comments"/>
+				</rich:menuItem>				
+				<rich:menuItem ajaxSingle="true">
+					Go to <b>{car}</b> site
+					<a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Go to {car} site"/>
+				</rich:menuItem>
+			</rich:menuGroup>
+		</rich:contextMenu> 
+		
+		<h:panelGrid columns="2">
+		
+		<rich:dataTable value="#{dataTableScrollerBean.tenRandomCars}" var="car" id="table"
+		onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
+		onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" rowClasses="cur">
+			<rich:column>
+				<f:facet name="header">
+					Make
+				</f:facet>
+					<h:outputText value="#{car.make}"/>
+			</rich:column>
+			<rich:column>
+				<f:facet name="header">
+					Model
+				</f:facet>
+					<h:outputText value="#{car.model}"/>
+			</rich:column>
+			<rich:column>
+				<f:facet name="header">
+					Price
+				</f:facet>
+					<h:outputText value="#{car.price}" />
+			</rich:column>
+
+			<rich:componentControl event="onRowClick" for="menu" operation="show">
+				<f:param value="#{car.model}" name="model"/>
+				<f:param value="#{car.make}" name="car"/>
+			</rich:componentControl>
+
+		</rich:dataTable>
+	
+		<a4j:outputPanel ajaxRendered="true">
+			<rich:panel>
+				<f:facet name="header">Last Menu Action</f:facet>
+				<h:outputText value="#{ddmenu.current}"></h:outputText>
+			</rich:panel>		
+		</a4j:outputPanel>
+		</h:panelGrid>
+	</h:form>			
+</f:subview>
\ No newline at end of file

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/control.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/control.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/control.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,75 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:a4j="http://richfaces.org/a4j"
+      xmlns:rich="http://richfaces.org/rich">
+	<style>
+	.atop{
+		vertical-align:top;
+	}
+	</style>
+		<p>RichFaces Component Control is a universal component that allows to call JS API functions on the
+		components after defined events. 
+		</p>
+		<p>
+			In this simple example <b>componentControl</b> components are used to open and close modal panel.
+			The component is attached to links and calls "show" and "hide" functions on Modal Panel. 
+		</p>
+		<div class="sample-container">
+			<ui:include src="/richfaces/componentControl/examples/mpusage.xhtml" />
+		<rich:spacer height="20"/>
+		<ui:include src="/templates/include/sourceview.xhtml">
+			<ui:param name="sourcepath" value="/richfaces/componentControl/examples/mpusage.xhtml"/>
+		</ui:include>		
+		</div>
+		<p>
+			<b>Main component attributes:</b>
+			<ul>
+				<li><b>for</b> - specifies client identifier of the target component.</li>
+				<li><b>attachTo</b> - specifies client identifier of the component or id of the existing DOM element that is a source
+					for a given event. If <b>attachTo</b> is not defined, the event is attached on the server to the closest in the
+					component tree parent component.</li>
+				<li><b>event</b> - is used to trigger the <b>operation</b> on the target component 
+				<br/><i><b>Note:</b> the component could use "oncontextmenu" event to call the JS API on right click event.
+				But in this case this component should be defined via <b>for</b> attribute rather than using a4j:support style. 
+				In case of support-like definition, the component will not work properly, as many of the components don't encode this event.
+				</i>
+				
+				</li>
+				<li><b>operation</b> - name of the javascript function that will be invoked on a target component. The API method
+					is attached to the 'component' property of the root DOM element that represents
+					the target component. The function has two parameters - <b>event</b> and <b>params</b>.</li>
+				<li><b>params</b> - a set of parameters passed to the function of Javascript API that will be invoked. 
+				The JSON syntax is used to define the parameters, but without open and closed curve 
+				bracket.
+				As an alternative, a set of f:param can be used to define the parameters passed to the 
+				API function. </li>  
+			</ul>
+		</p>
+		<p>
+			Thus, one of the main features is that Component Control component allows to transfer 
+			parameters to managed components. 
+		</p>
+		<p>
+			You may put <b>f:param</b> components as nested to component control component (instead of <b>params</b> attribute usage) 
+			and all the parameters that are defined will be available from target component.
+		</p>
+		<p>
+			In the next example, component control is used inside <b>rich:dataTable</b> component. 
+			Component control is defined with two parameters which have the current row values.
+			Hence the <b>rich:contextMenu</b> component that called by this Component Control
+			will take this parameters and will be able to display them in its items values.  
+		</p>
+		<p>
+			Click at any table row to see the context menu that generated individually for
+			every row using parameters.
+		</p>
+		<div class="sample-container">
+			<ui:include src="/richfaces/componentControl/examples/cmenuusage.xhtml" />
+		<rich:spacer height="20"/>
+		<ui:include src="/templates/include/sourceview.xhtml">
+			<ui:param name="sourcepath" value="/richfaces/componentControl/examples/cmenuusage.xhtml"/>
+		</ui:include> 
+		</div>
+</ui:composition>
\ No newline at end of file

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/mpusage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/mpusage.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/mpusage.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,27 @@
+<f:subview xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:a4j="http://richfaces.org/a4j"
+      xmlns:rich="http://richfaces.org/rich"> 
+	<rich:modalPanel id="panel" width="350" height="100">
+		<f:facet name="header">
+			<h:panelGroup>
+				<h:outputText value="Modal Panel"></h:outputText>
+			</h:panelGroup>
+		</f:facet>
+		<f:facet name="controls">
+			<h:panelGroup>
+				<h:graphicImage value="/images/modal/close.png" style="cursor:pointer" id="hidelink"/>
+				<rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
+			</h:panelGroup>
+		</f:facet>
+		<h:outputText value="This panel is called using Component Control Component"></h:outputText>
+		<br/>
+		<h:outputText value="Closure link (X) works also through Component Control"></h:outputText>
+	</rich:modalPanel> 
+	<h:outputLink value="#" id="link">
+		Show Modal Panel 
+		<rich:componentControl for="panel" attachTo="link" operation="show" event="onclick"/>
+	</h:outputLink>
+</f:subview>
\ No newline at end of file

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/usage.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/usage.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+	<ui:composition template="/templates/component-sample.xhtml">
+		<ui:define name="sample">
+ 			
+				<ui:include src="/richfaces/componentControl/examples/control.xhtml"/>
+
+		</ui:define>
+
+	</ui:composition>
+</html>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/componentControl.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+	<ui:define name="title">RichFaces - Open Source Rich JSF Components - Component Control Component</ui:define>
+	<ui:define name="body">
+		<rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class"  inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+			<rich:tab label="Usage">
+				<ui:include src="/richfaces/componentControl/usage.xhtml"/>
+			</rich:tab>			
+			<ui:include src="/templates/include/tagInfo.xhtml">
+				<ui:param name="path" value="rich/componentControl"/>
+			</ui:include>		
+		</rich:tabPanel>
+	</ui:define>
+</ui:composition>
+</html>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+	<ui:define name="title">RichFaces - Open Source Rich JSF Components - Context Menu Component</ui:define>
+	<ui:define name="body">
+		<rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class"  inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+			<rich:tab label="Usage">
+				<ui:include src="/richfaces/contextMenu/usage.xhtml"/>
+			</rich:tab>			
+			<ui:include src="/templates/include/tagInfo.xhtml">
+				<ui:param name="path" value="rich/contextMenu"/>
+			</ui:include>		
+		</rich:tabPanel>
+	</ui:define>
+</ui:composition>
+</html>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,46 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich"
+	xmlns:c="http://java.sun.com/jstl/core">
+
+<style>
+.pic{
+margin-bottom:-4px; 
+margin-right:2px;
+}
+a{
+text-decoration:none;
+color:#{a4jSkin.headerTextColor};
+}
+</style>
+	<h:form>
+		<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="#">
+						<h:outputText value="#{item.label}"></h:outputText>
+					</h:outputLink>
+				</h:panelGroup>
+			</c:forEach>
+		</rich:toolBar>
+		<rich:spacer height="20"></rich:spacer>
+
+		<rich:listShuttle sourceValue="#{toolBar.freeItems}"
+			targetValue="#{toolBar.items}" var="items" listHeight="300" listWidth="300"
+			sourceCaptionLabel="Available Items"
+			targetCaptionLabel="Currently Active Items"
+			converter="listShuttleconverter">
+			<rich:column width="18">
+				<h:graphicImage value="#{items.iconURI}"></h:graphicImage>
+			</rich:column>
+			<rich:column>
+				<h:outputText value="#{items.label}"></h:outputText>
+			</rich:column>
+			<a4j:support event="onlistchanged" reRender="toolBar"/>
+		</rich:listShuttle>
+	</h:form>
+</ui:composition>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+	<ui:composition template="/templates/component-sample.xhtml">
+		<ui:define name="sample">
+			<p>
+				<b>listShuttle</b> component allows to select items using two lists with move controls and reorder items in result list. 
+			</p>
+			<p>
+				List Shuttle could contain several columns in list representation. And it
+				also has strong keyboard support out of the box.
+			</p>
+			<p><b>Example.</b>Customize simple application toolbar using List Shuttle. 
+				In this example you may select items and their order within the toolBar.
+			<br/>
+			After you move some items between lists or reorder them in "Currently Active" list - you'll
+			see the changes on the toolbar
+			</p>
+			<div class="sample-container">
+				<ui:include src="/richfaces/listShuttle/examples/toolBarCustomization.xhtml"/>
+				<ui:include src="/templates/include/sourceview.xhtml">
+					<ui:param name="sourcepath" value="/richfaces/listShuttle/examples/toolBarCustomization.xhtml"/>
+				</ui:include>		 
+
+			</div>			
+			
+			<p>
+				Content definition for this component - analogous to any Iteration component.
+				So, all you need is define collection in List Shuttle <b>sourceValue</b> attribute 
+				and iterate the collection in nested columns through <b>var</b> attribute.
+			</p>
+			<p>
+				Result items will be stored under the collection defined in <b>targetValue</b> attribute.  
+			</p>
+			<p>
+				In order to set initially selected rows or to process submitted selection - 
+				use <b>sourceSelection</b> and <b>targetSelection</b> attributes.
+			</p>
+		</ui:define>
+
+	</ui:composition>
+</html>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+	<ui:define name="title">RichFaces - Open Source Rich JSF Components - Ordering List Component</ui:define>
+	<ui:define name="body">
+		<rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class"  inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+			<rich:tab label="Usage">
+				<ui:include src="/richfaces/listShuttle/listShuttle.xhtml"/>
+			</rich:tab>			
+			<ui:include src="/templates/include/tagInfo.xhtml">
+				<ui:param name="path" value="rich/listShuttle"/>
+			</ui:include>		
+		</rich:tabPanel>
+	</ui:define>
+</ui:composition>
+</html>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/playlist.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/playlist.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/playlist.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,26 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+	<style>
+	.cent{
+		text-align:center;
+	}
+</style>
+	<rich:orderingList value="#{library.libraryAsList}" var="lib" listHeight="300" listWidth="350">
+		<rich:column  width="180">
+		<f:facet name="header">
+			Song Name
+		</f:facet> 
+			<h:outputText value="#{lib.title}"></h:outputText>
+		</rich:column>
+		<rich:column>
+			<f:facet name="header">
+				Artist Name
+			</f:facet>
+			<h:outputText value="#{lib.album.artist.name}"></h:outputText>
+		</rich:column>
+	</rich:orderingList>
+</ui:composition>
\ No newline at end of file

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/orderingList.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/orderingList.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/orderingList.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+	<ui:composition template="/templates/component-sample.xhtml">
+		<ui:define name="sample">
+			<p>
+				<b>orderingList</b> component allows to reorder items in a list. 
+			</p>
+			<p>
+				Ordering List could contain several columns in list representation. And it
+				also has strong keyboard support out of the box.
+			</p>
+			<p><b>Example.</b>Manage simple playlist represented via Ordering List:</p>
+			<div class="sample-container">
+				<ui:include src="/richfaces/orderingList/example/playlist.xhtml"/>
+				<ui:include src="/templates/include/sourceview.xhtml">
+					<ui:param name="sourcepath" value="/richfaces/orderingList/example/playlist.xhtml"/>
+				</ui:include>		 
+
+			</div>			
+			<p>
+				In this example you may select some songs (using the mouse and Ctrl/Shift keys) and move them 
+				within the list using controls.
+			</p>
+			
+			<p>
+				Content definition for this component is similar to any Iteration component.
+				Thus, all you need is to define collection in Ordering List <b>value</b> attribute 
+				and iterate the collection in nested columns with <b>var</b> attribute.
+			</p>
+			<p>
+				In order to set initially selected rows or to process submitted selection, 
+				use <b>selection</b> attribute.
+			</p>
+		</ui:define>
+
+	</ui:composition>
+</html>

Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList.xhtml	                        (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+	<ui:define name="title">RichFaces - Open Source Rich JSF Components - Ordering List Component</ui:define>
+	<ui:define name="body">
+		<rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class"  inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+			<rich:tab label="Usage">
+				<ui:include src="/richfaces/orderingList/orderingList.xhtml"/>
+			</rich:tab>			
+			<ui:include src="/templates/include/tagInfo.xhtml">
+				<ui:param name="path" value="rich/orderingList"/>
+			</ui:include>		
+		</rich:tabPanel>
+	</ui:define>
+</ui:composition>
+</html>

Modified: trunk/samples/richfaces-demo/src/main/webapp/templates/include/components-navigation.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/templates/include/components-navigation.xhtml	2008-01-14 12:16:46 UTC (rev 5345)
+++ trunk/samples/richfaces-demo/src/main/webapp/templates/include/components-navigation.xhtml	2008-01-14 12:31:08 UTC (rev 5346)
@@ -58,6 +58,11 @@
  			<ui:param name="components" value="#{componentNavigator.richInputs}" />
  		</ui:include>
 	</rich:panelBarItem>
+	<rich:panelBarItem id="richSelect" label="Rich Selects"> 
+		<ui:include src="/templates/include/components-group.xhtml" >
+ 			<ui:param name="components" value="#{componentNavigator.selectComponents}" />
+ 		</ui:include>
+	</rich:panelBarItem> 
 	<rich:panelBarItem id="richMisc" label="Rich Miscellaneous"> 
 		<ui:include src="/templates/include/components-group.xhtml" >
  			<ui:param name="components" value="#{componentNavigator.richMisc}" />




More information about the richfaces-svn-commits mailing list