[richfaces-svn-commits] JBoss Rich Faces SVN: r4650 - in branches/3.1.x/samples/richfaces-demo/src/main: java/org/richfaces/demo/listShuttle and 5 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Dec 10 09:21:32 EST 2007


Author: ilya_shaikovsky
Date: 2007-12-10 09:21:32 -0500 (Mon, 10 Dec 2007)
New Revision: 4650

Added:
   branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/
   branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java
   branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle.xhtml
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml
Modified:
   branches/3.1.x/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
List Shuttle sample added.

Added: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java	                        (rev 0)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java	2007-12-10 14:21:32 UTC (rev 4650)
@@ -0,0 +1,38 @@
+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.setType("label");
+		item.setLabel("New");
+		items.add(item);
+		item = new ToolBarItem();
+		item.setType("label");
+		item.setLabel("Save");
+		items.add(item);
+		item = new ToolBarItem();
+		item.setType("label");
+		item.setLabel("Close");
+		items.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: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java	                        (rev 0)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java	2007-12-10 14:21:32 UTC (rev 4650)
@@ -0,0 +1,25 @@
+package org.richfaces.demo.listShuttle;
+
+public class ToolBarItem {
+private String type;
+private String label;
+private String icon;
+public String getType() {
+	return type;
+}
+public void setType(String type) {
+	this.type = type;
+}
+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;
+}
+}

Modified: branches/3.1.x/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties	2007-12-10 13:30:12 UTC (rev 4649)
+++ branches/3.1.x/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties	2007-12-10 14:21:32 UTC (rev 4650)
@@ -70,4 +70,5 @@
 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
\ No newline at end of file
+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: branches/3.1.x/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml	2007-12-10 13:30:12 UTC (rev 4649)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml	2007-12-10 14:21:32 UTC (rev 4650)
@@ -158,18 +158,18 @@
    <property-class>java.lang.String</property-class>
    <value>Paint 2D</value>
   </managed-property>
- </managed-bean>
- <managed-bean>
-  <managed-bean-name>treeDemoStateAdvisor</managed-bean-name>
-  <managed-bean-class>org.richfaces.treemodeladaptor.TreeDemoStateAdvisor</managed-bean-class>
-  <managed-bean-scope>application</managed-bean-scope>
- </managed-bean>
- <managed-bean>
-  <managed-bean-name>fileSystemBean</managed-bean-name>
-  <managed-bean-class>org.richfaces.treemodeladaptor.FileSystemBean</managed-bean-class>
-  <managed-bean-scope>application</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
  <managed-bean>
+  <managed-bean-name>treeDemoStateAdvisor</managed-bean-name>
+  <managed-bean-class>org.richfaces.treemodeladaptor.TreeDemoStateAdvisor</managed-bean-class>
+  <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+  <managed-bean-name>fileSystemBean</managed-bean-name>
+  <managed-bean-class>org.richfaces.treemodeladaptor.FileSystemBean</managed-bean-class>
+  <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
   <managed-bean-name>simpleTreeBean</managed-bean-name>
   <managed-bean-class>org.richfaces.demo.tree.SimpleTreeBean</managed-bean-class>
   <managed-bean-scope>session</managed-bean-scope>
@@ -259,6 +259,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>
@@ -283,8 +288,8 @@
    <from-outcome>previous</from-outcome>
    <to-view-id>/richfaces/include/examples/wstep2.xhtml</to-view-id>
   </navigation-case>
- </navigation-rule>
-	<lifecycle>
-		<phase-listener>org.richfaces.treemodeladaptor.PostbackPhaseListener</phase-listener>
-	</lifecycle>
+ </navigation-rule>
+ <lifecycle>
+  <phase-listener>org.richfaces.treemodeladaptor.PostbackPhaseListener</phase-listener>
+ </lifecycle>
 </faces-config>

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml	2007-12-10 14:21:32 UTC (rev 4650)
@@ -0,0 +1,30 @@
+<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">
+	<h:form>
+		<rich:toolBar id="toolBar">
+			<c:forEach items="#{toolBar.items}" var="item">
+				<h:outputLink value="#">
+					<h:outputText value="#{item.label}"></h:outputText>
+				</h:outputLink>
+			</c:forEach>
+		</rich:toolBar>
+		
+		<rich:spacer height="20"></rich:spacer>
+		
+		<rich:listShuttle sourceValue="#{toolBar.freeItems}" targetValue="#{toolBar.items}" var="items" listHeight="300px">
+			<rich:column>
+				<h:outputText value="#{items.label}"></h:outputText>
+			</rich:column>
+		</rich:listShuttle>
+
+		<rich:spacer height="20"></rich:spacer>
+
+		<h:commandButton value="Update Toolbar" reRender="toolBar"/>
+		
+	</h:form> 
+</ui:composition> 
\ No newline at end of file

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml	2007-12-10 14:21:32 UTC (rev 4650)
@@ -0,0 +1,44 @@
+<!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 </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>
+				In this example you may select items and their order within the toolBar
+			</p>
+			
+			<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: branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle.xhtml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle.xhtml	2007-12-10 14:21:32 UTC (rev 4650)
@@ -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>




More information about the richfaces-svn-commits mailing list