[richfaces-svn-commits] JBoss Rich Faces SVN: r4724 - in branches/3.1.x/samples/richfaces-demo/src/main: webapp/images and 4 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Dec 11 11:51:27 EST 2007


Author: ilya_shaikovsky
Date: 2007-12-11 11:51:26 -0500 (Tue, 11 Dec 2007)
New Revision: 4724

Added:
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/copy.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/create_doc.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/create_folder.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/cut.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/delete.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/edit.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/filter.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/find.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/open.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/paste.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/redo.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/reload.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/repeat.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save_all.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save_as.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/undo.gif
   branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/verify.gif
Modified:
   branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/Converter.java
   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/componentControl/examples/cmenuusage.xhtml
   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
Log:


Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/Converter.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/Converter.java	2007-12-11 16:42:26 UTC (rev 4723)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/Converter.java	2007-12-11 16:51:26 UTC (rev 4724)
@@ -17,7 +17,7 @@
 			Object value) {
 
 		ToolBarItem optionItem = (ToolBarItem) value;
-		return optionItem.getLabel() + ":" + optionItem.getType();
+		return optionItem.getLabel() + ":" + optionItem.getIcon();
 	}
 
 }
\ No newline at end of file

Modified: 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	2007-12-11 16:42:26 UTC (rev 4723)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java	2007-12-11 16:51:26 UTC (rev 4724)
@@ -8,25 +8,33 @@
 	private List<ToolBarItem> freeItems = new ArrayList<ToolBarItem>();
 	public ToolBar() {
 		ToolBarItem item = new ToolBarItem();
-		item.setType("label");
-		item.setLabel("New");
+		item.setIcon("create_folder");
+		item.setLabel("Create Folder");
 		items.add(item);
 		item = new ToolBarItem();
-		item.setType("label");
-		item.setLabel("Save");
+		item.setIcon("create_doc");
+		item.setLabel("Create Doc");
 		items.add(item);
 		item = new ToolBarItem();
-		item.setType("label");
-		item.setLabel("Close");
+		item.setIcon("find");
+		item.setLabel("Find");
 		items.add(item);
 		item = new ToolBarItem();
-		item.setType("label");
-		item.setLabel("Import");
+		item.setIcon("open");
+		item.setLabel("Open");
 		freeItems.add(item);
 		item = new ToolBarItem();
-		item.setType("label");
-		item.setLabel("Export");
+		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() {

Modified: 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	2007-12-11 16:42:26 UTC (rev 4723)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBarItem.java	2007-12-11 16:51:26 UTC (rev 4724)
@@ -1,24 +1,18 @@
 package org.richfaces.demo.listShuttle;
 
 public class ToolBarItem {
-private String type;
+private String icon;
 private String label;
-
+private String iconURI;
 public ToolBarItem() {
 	// TODO Auto-generated constructor stub
 }
 
-public ToolBarItem(String label, String type) {
+public ToolBarItem(String label, String icon) {
 	setLabel(label);
-	setType(type);
+	setIcon(icon);
 }
 
-public String getType() {
-	return type;
-}
-public void setType(String type) {
-	this.type = type;
-}
 public String getLabel() {
 	return label;
 }
@@ -26,11 +20,21 @@
 	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());
-	result = prime * result + ((type == null) ? 0 : type.hashCode());
 	return result;
 }
 
@@ -42,18 +46,22 @@
 	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;
-	if (type == null) {
-		if (other.type != null)
-			return false;
-	} else if (!type.equals(other.type))
-		return false;
 	return true;
 }
 
+public String getIconURI() {
+	return "/images/icons/"+icon+".gif";
+}
 
+
 }

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/copy.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/copy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/create_doc.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/create_doc.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/create_folder.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/create_folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/cut.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/cut.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/delete.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/edit.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/filter.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/filter.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/find.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/open.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/open.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/paste.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/paste.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/redo.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/redo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/reload.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/reload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/repeat.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/repeat.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save_all.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save_all.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save_as.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/save_as.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/undo.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/undo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/verify.gif
===================================================================
(Binary files differ)


Property changes on: branches/3.1.x/samples/richfaces-demo/src/main/webapp/images/icons/verify.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/cmenuusage.xhtml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/cmenuusage.xhtml	2007-12-11 16:42:26 UTC (rev 4723)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/componentControl/examples/cmenuusage.xhtml	2007-12-11 16:51:26 UTC (rev 4724)
@@ -11,21 +11,28 @@
 	</style>
 	<h:form id="form">
 		
-		<rich:contextMenu attached="false" id="menu" submitMode="none">
-			<rich:menuItem>
+		<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>
+				<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"/>
-				<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">
@@ -48,11 +55,19 @@
 					<h:outputText value="#{car.price}" />
 			</rich:column>
 
-			<rich:componentControl event="onRowClick" for=":subview:form:menu" operation="show">
+			<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>		
+		</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

Modified: 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	2007-12-11 16:42:26 UTC (rev 4723)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/examples/toolBarCustomization.xhtml	2007-12-11 16:51:26 UTC (rev 4724)
@@ -5,12 +5,26 @@
 	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">
+		<rich:toolBar id="toolBar" itemSeparator="line" height="40px"> 
 			<c:forEach items="#{toolBar.items}" var="item">
-				<h:outputLink value="#">
-					<h:outputText value="#{item.label}"></h:outputText>
-				</h:outputLink>
+				<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>
@@ -29,6 +43,5 @@
 		<rich:spacer height="20"></rich:spacer>
 
 		<h:commandButton value="Update Toolbar" reRender="toolBar" />
-		<rich:messages></rich:messages>
 	</h:form>
 </ui:composition>

Modified: 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	2007-12-11 16:42:26 UTC (rev 4723)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/richfaces/listShuttle/listShuttle.xhtml	2007-12-11 16:51:26 UTC (rev 4724)
@@ -14,7 +14,12 @@
 				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>
+			<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">
@@ -22,9 +27,6 @@
 				</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.




More information about the richfaces-svn-commits mailing list