[richfaces-svn-commits] JBoss Rich Faces SVN: r2197 - in trunk/test-applications/jsp/src/main: webapp/DragAndDrop and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Aug 10 09:52:58 EDT 2007


Author: ayanul
Date: 2007-08-10 09:52:58 -0400 (Fri, 10 Aug 2007)
New Revision: 2197

Removed:
   trunk/test-applications/jsp/src/main/webapp/DragAndDrop/DnD.jsp
Modified:
   trunk/test-applications/jsp/src/main/java/gmap/Gmap.java
   trunk/test-applications/jsp/src/main/webapp/DragAndDrop/DragAndDrop.jsp
   trunk/test-applications/jsp/src/main/webapp/Gmap/Gmap.jsp
   trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Gmap.xml
   trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config.xml
Log:
added new attribute (gmap)
update face-config

Modified: trunk/test-applications/jsp/src/main/java/gmap/Gmap.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/gmap/Gmap.java	2007-08-10 13:18:31 UTC (rev 2196)
+++ trunk/test-applications/jsp/src/main/java/gmap/Gmap.java	2007-08-10 13:52:58 UTC (rev 2197)
@@ -1,22 +1,53 @@
 package gmap;
 
-
 public class Gmap {
 
-	 String zoom;
+	private String zoom;
+	private String continuousZoom;
+	private String doubleClickZoom;
+	private String dragging;
 
-	 public String getZoom() {
-	 	return zoom;
-	 }
+	public Gmap() {
+		continuousZoom = "false";
+		doubleClickZoom = "false";
+		dragging = "false";
+	}
 
-	 public void setZoom(String zoom) {
-	 	this.zoom = zoom;
-	 }
+	public String getZoom() {
+		return zoom;
+	}
 
-	 public String act() {
-	 	zoom = "17";
-	 	System.out.println("zoom="+zoom);
-	 	return null;
-	 }
+	public void setZoom(String zoom) {
+		this.zoom = zoom;
+	}
+
+	public String act() {
+		zoom = "17";
+		System.out.println("zoom=" + zoom);
+		return null;
+	}
+
+	public String getContinuousZoom() {
+		return continuousZoom;
+	}
+
+	public void setContinuousZoom(String continuousZoom) {
+		this.continuousZoom = continuousZoom;
+	}
+
+	public String getDoubleClickZoom() {
+		return doubleClickZoom;
+	}
+
+	public void setDoubleClickZoom(String doubleClickZoom) {
+		this.doubleClickZoom = doubleClickZoom;
+	}
+
+	public String getDragging() {
+		return dragging;
+	}
+
+	public void setDragging(String dragging) {
+		this.dragging = dragging;
+	}
 }
-

Deleted: trunk/test-applications/jsp/src/main/webapp/DragAndDrop/DnD.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DragAndDrop/DnD.jsp	2007-08-10 13:18:31 UTC (rev 2196)
+++ trunk/test-applications/jsp/src/main/webapp/DragAndDrop/DnD.jsp	2007-08-10 13:52:58 UTC (rev 2197)
@@ -1,258 +0,0 @@
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
-<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
-<html>
-<head>
-<title></title>
-<style type="text/css">
-			.dropzoneDecoration {
-				width: 100px; height: 100px; border: 2px dotted navy;
-			}
-			
-			.accept {
-				border: 3px dotted green;
-				padding: 10px;
-			}
-
-			.reject {
-				border: 3px dashed red;
-				padding: 10px;
-			}
-		</style>
-</head>
-<body>
-<f:view>
-	<h:form id="form">
-		
-		<h:panelGroup id="dragValueText">
-			<h:outputText value="#{bean.dragValue}" />
-		</h:panelGroup>
-
-		<h:panelGrid columns="3">
-			<h:dataTable var="type" value="#{bean.types}">
-				<h:column>
-					<h:panelGrid styleClass="dropzoneDecoration" id="drop1">
-						<h:outputText value="#{type} - drop" />
-
-						<rich:dropSupport reRender="dragValueText"
-							action="#{bean.dropAction}" acceptedTypes="#{type}"
-							dropListener="#{bean.processDrop}" dropValue="#{type} - value">
-							<a4j:actionparam value="#{type} - test drop param"
-								assignTo="#{bean.testParam}" />
-						</rich:dropSupport>
-					</h:panelGrid>
-				</h:column>
-			</h:dataTable>
-
-			<h:dataTable var="type" value="#{bean.types}">
-				<h:column>
-					<h:panelGrid styleClass="dropzoneDecoration" id="drag1">
-						<h:outputText value="#{type} - drag" />
-						<rich:dragSupport dragType="#{type}" dragValue="#{type} - value"
-							action="#{bean.dragAction}" dragListener="#{bean.processDrag}">
-							<a4j:actionparam value="#{type} - test drag param"
-								assignTo="#{bean.testParam}" />
-						</rich:dragSupport>
-
-					</h:panelGrid>
-				</h:column>
-			</h:dataTable>
-
-			<h:dataTable var="type" value="#{bean.types}">
-				<h:column>
-					<h:panelGrid styleClass="dropzoneDecoration" id="drop2">
-						<h:outputText value="#{type} - drop" />
-
-						<rich:dropSupport reRender="dragValueText"
-							action="#{bean.dropAction}" acceptedTypes="#{type}"
-							dropListener="#{bean.processDrop}" dropValue="#{type} - value">
-						</rich:dropSupport>
-					</h:panelGrid>
-				</h:column>
-			</h:dataTable>
-		</h:panelGrid>
-
-		<rich:dragIndicator id="indicator" acceptClass="accept"
-			rejectClass="reject">
-			<f:facet name="single">
-				<f:verbatim>
-							{marker} <b>{testDrag}</b> {label}
-						</f:verbatim>
-			</f:facet>
-
-			<rich:dndParam name="accept" value="ACCEPT:" />
-
-			<rich:dndParam name="reject">
-				<f:verbatim>
-					<i style="text-decoration: line-through;">REJECT:</i>
-				</f:verbatim>
-			</rich:dndParam>
-		</rich:dragIndicator>
-
-		<h:panelGrid columns="1" style="position: relative; left: 140px;">
-			<h:panelGrid columns="1"
-				style="position: absolute; top: 30px; left: 300px;">
-				<rich:dragIndicator id="defaultIndicator">
-				</rich:dragIndicator>
-			</h:panelGrid>
-		</h:panelGrid>
-
-		<h:panelGrid columns="4" cellspacing="20">
-			<h:panelGrid styleClass="dropzoneDecoration" id="grid1">
-				<f:verbatim>
-							Accepts file & folder... Customizes
-						</f:verbatim>
-
-				<rich:dropSupport id="zone1"
-					ondrop="var zone = $('form:grid1'); zone.style.borderColor= 'red'; setTimeout( function() { this.style.borderColor= 'navy'; }.bind(zone), 300);"
-					acceptedTypes="file, folder" typeMapping="{file: testDrop}">
-					<rich:dndParam name="testDrop">
-						<h:graphicImage height="16" width="16"
-							value="/pics/file-manager.png" />
-					</rich:dndParam>
-
-				</rich:dropSupport>
-			</h:panelGrid>
-
-
-			<h:panelGrid styleClass="dropzoneDecoration" id="grid2">
-				<f:verbatim>
-							Accepts none
-						</f:verbatim>
-
-				<rich:dropSupport>
-				</rich:dropSupport>
-			</h:panelGrid>
-
-			<h:panelGrid styleClass="dropzoneDecoration" id="grid3">
-				<f:verbatim>
-							Accepts none... Customizes
-						</f:verbatim>
-
-				<rich:dropSupport typeMapping="{file: testDrop}">
-					<rich:dndParam name="testDrop">
-						<h:graphicImage height="16" width="16"
-							value="/pics/file-manager-reject.png" />
-					</rich:dndParam>
-
-				</rich:dropSupport>
-			</h:panelGrid>
-
-			<h:panelGrid styleClass="dropzoneDecoration" id="grid4">
-				<f:verbatim>
-							Accepts file & folder
-						</f:verbatim>
-				<rich:dropSupport acceptedTypes="file, folder">
-					<rich:dndParam name="testDrop" value="testDropValue" />
-
-				</rich:dropSupport>
-			</h:panelGrid>
-
-			<h:panelGrid id="grid5">
-				<rich:dragSupport dragType="file">
-					<rich:dndParam name="label" value="Label" />
-					<rich:dndParam name="testDrag" value="testDragValue" />
-
-				</rich:dragSupport>
-				<f:verbatim>File Draggable - no indicator</f:verbatim>
-			</h:panelGrid>
-
-			<h:panelGrid id="grid6">
-				<rich:dragSupport dragType="file" dragIndicator="indicator">
-					<rich:dndParam name="label" value="Label" />
-					<rich:dndParam name="testDrag" value="testDragValue" />
-
-				</rich:dragSupport>
-				<f:verbatim>File Draggable with indicator</f:verbatim>
-			</h:panelGrid>
-
-			<h:panelGrid id="grid7">
-				<rich:dragSupport dragType="folder" dragIndicator="indicator">
-					<rich:dndParam name="label" value="Label" />
-					<rich:dndParam name="testDrag" value="testDragValue for Folder" />
-
-				</rich:dragSupport>
-				<f:verbatim>Folder Draggable with indicator</f:verbatim>
-			</h:panelGrid>
-
-			<h:outputText />
-
-			<h:panelGrid id="grid8">
-				<rich:dragSupport dragType="folder">
-					<rich:dndParam name="label" value="Label" />
-					<rich:dndParam name="testDrag" value="testDragValue for Folder" />
-
-				</rich:dragSupport>
-				<f:verbatim>Folder Draggable - no indicator</f:verbatim>
-			</h:panelGrid>
-
-			<h:panelGrid id="grid9">
-				<rich:dragSupport dragType="file" dragIndicator="defaultIndicator">
-					<rich:dndParam name="testDrag" type="drop" value="testDragValue" />
-
-					<rich:dndParam name="marker" value="testMarkerValue" />
-					<rich:dndParam name="label" value="testDragValue" />
-
-				</rich:dragSupport>
-				<f:verbatim>File Draggable with defaultIndicator</f:verbatim>
-			</h:panelGrid>
-
-			<h:panelGrid id="grid10">
-				<rich:dragSupport dragType="folder" dragIndicator="defaultIndicator">
-					<rich:dndParam name="label" value="testDragValue for Folder" />
-
-				</rich:dragSupport>
-				<f:verbatim>Folder Draggable with defaultIndicator</f:verbatim>
-			</h:panelGrid>
-
-			<h:outputText />
-
-		</h:panelGrid>
-
-		<h:panelGrid id="renderedId">
-			<rich:dragSupport dragType="file" dragIndicator="defaultIndicator">
-				<rich:dndParam name="marker" value="testMarkerValue" />
-				<rich:dndParam name="label" value="testDragValue" />
-			</rich:dragSupport>
-
-			<h:graphicImage id="dragImage" value="/pics/file-manager.png"
-				width="48" />
-			<f:verbatim>
-						dragSupport
-					</f:verbatim>
-		</h:panelGrid>
-
-		<h:panelGroup id="group">
-			<f:verbatim>
-					PanelGroup					
-					</f:verbatim>
-			<rich:dropSupport acceptedTypes="file"
-				dropListener="#{bean.processDrop}" />
-		</h:panelGroup>
-
-		<h:panelGrid id="renderedIdII" style="border: 1px solid red;">
-			<rich:dropSupport acceptedTypes="file"
-				dropListener="#{bean.processDrop}" />
-			<f:verbatim>
-				<div style="margin: 40px; border: 1px solid green;">
-				dropSupport</div>
-			</f:verbatim>
-		</h:panelGrid>
-
-		<a4j:status startText="...request..." stopText="stop" />
-		<a4j:outputPanel ajaxRendered="true">
-			<h:messages />
-		</a4j:outputPanel>
-
-		<h:outputText>
-			<rich:dropSupport acceptedTypes="file" />
-		</h:outputText>
-
-		<h:outputText>
-			<rich:dragSupport dragType="file" />
-		</h:outputText>
-		<h:commandLink value="Back" action="main"></h:commandLink>	</h:form>
-</f:view>
-</body>
-</html>

Modified: trunk/test-applications/jsp/src/main/webapp/DragAndDrop/DragAndDrop.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DragAndDrop/DragAndDrop.jsp	2007-08-10 13:18:31 UTC (rev 2196)
+++ trunk/test-applications/jsp/src/main/webapp/DragAndDrop/DragAndDrop.jsp	2007-08-10 13:52:58 UTC (rev 2197)
@@ -183,7 +183,7 @@
 		<a4j:outputPanel ajaxRendered="true">
 			<h:messages />
 		</a4j:outputPanel>
-
+	<h:commandLink value="Back" action="main"></h:commandLink>
 	</h:form>
 </f:view>
 </body>

Modified: trunk/test-applications/jsp/src/main/webapp/Gmap/Gmap.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Gmap/Gmap.jsp	2007-08-10 13:18:31 UTC (rev 2196)
+++ trunk/test-applications/jsp/src/main/webapp/Gmap/Gmap.jsp	2007-08-10 13:52:58 UTC (rev 2197)
@@ -2,95 +2,115 @@
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
 <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
 <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
-<html>
 <f:view>
+	<html>
 	<head>
 	<title></title>
 	</head>
 	<body>
-	<h:panelGrid columns="2">
+	<h:form>
 		<rich:gmap id="gm" lat="37.97" zoom="#{gmap.zoom}" gmapVar="map"
 			gmapKey="ABQIAAAAxU6W9QEhFLMNdc3ATIu-VxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRkrpOGzxH8_ud3inE9pG1845-FCA"
-			style="width:500px;height:400px" />
+			style="width:500px;height:400px"
+			enableContinuousZoom="#{gmap.continuousZoom}"
+			enableDoubleClickZoom="#{gmap.doubleClickZoom}"
+			enableDragging="#{gmap.dragging}" />
 
-
-		<!-- client side solution -->
 		<h:panelGroup>
-		Controls:<br />
-			<a href="javascript:void(0);"
-				onclick="map.hideControls();return false;">Remove</a>
-			<a href="javascript:void(0);"
-				onclick="map.showControls();return false;">Show</a>
-			<br />
-			<br />
-		Type:<br />
-			<a href="javascript:void(0);"
-				onclick="map.setMapType(G_NORMAL_MAP);return false;">Normal</a>
-			<a href="javascript:void(0);"
-				onclick="map.setMapType(G_SATELLITE_MAP);return false;">Satellite</a>
-			<a href="javascript:void(0);"
-				onclick="map.setMapType(G_HYBRID_MAP);return false;">Hybrid</a>
-			<br />
-			<br />
-		Zoom:<br />
-			<a href="javascript:void(0);" onclick="map.zoomIn();return false;">In</a>
-			<a href="javascript:void(0);" onclick="map.zoomOut();return false;">Out</a>
-			<br />
-			<br />
-			<a href="javascript:void(0);" onclick="showExadel();return false;">Show
-			Exadel Office</a>
-
+			<f:verbatim>
+				Controls:
+				<br />
+				<a href="javascript:void(0);"
+					onclick="map.hideControls();return false;">Remove</a>
+				<a href="javascript:void(0);"
+					onclick="map.showControls();return false;">Show</a>
+				<br />
+				<br />
+				Type:
+				<br />
+				<a href="javascript:void(0);"
+					onclick="map.setMapType(G_NORMAL_MAP);return false;">Normal</a>
+				<a href="javascript:void(0);"
+					onclick="map.setMapType(G_SATELLITE_MAP);return false;">Satellite</a>
+				<a href="javascript:void(0);"
+					onclick="map.setMapType(G_HYBRID_MAP);return false;">Hybrid</a>
+				<br />
+				<br />
+				Zoom:
+				<br />
+				<a href="javascript:void(0);" onclick="map.zoomIn();return false;">In</a>
+				<a href="javascript:void(0);" onclick="map.zoomOut();return false;">Out</a>
+				<br />
+				<br />
+				<a href="javascript:void(0);" onclick="showExadel();return false;">Show
+				Exadel Office</a>
+				<br />
+				<a href="javascript:void(0);"
+					onclick="showExadelInMinsk();return false;">Show Exadel in
+				Belarus</a>
+			</f:verbatim>
 		</h:panelGroup>
 
+		<rich:panel>
+			<h:panelGrid columns="2">
+				<h:outputText value="Dragging:" />
+				<h:selectBooleanCheckbox value="#{gmap.dragging}" />
 
-		<!-- client side solution -->
-		<h:form>
+				<h:outputText value="Continuous Zoom:" />
+				<h:selectBooleanCheckbox value="#{gmap.continuousZoom}" />
 
-		</h:form>
+				<h:outputText value="Double Click Zoom:" />
+				<h:selectBooleanCheckbox value="#{gmap.doubleClickZoom}" />
 
-	</h:panelGrid>
+				<h:commandLink value="submit" action="submit();"></h:commandLink>
+			</h:panelGrid>
+		</rich:panel>
 
-	<a4j:outputPanel id="zoomer">
-		<script>
+		<a4j:outputPanel id="zoomer">
+			<script>
 		  function zoomIt() {
 		   map.setZoom(#{gmap.zoom});
 		  }
 		</script>
-	</a4j:outputPanel>
+		</a4j:outputPanel>
 
-	<a4j:outputPanel>
-		<script>
-	   
-      function createMarker(point,html) {
-        var marker = new GMarker(point);
-        GEvent.addListener(marker, "click", function() {
-          marker.openInfoWindowHtml(html);
-        });
-        return marker;
-      }
-
-	   
-	   
-	   function showExadel() {
-
-	    var point = new  GLatLng(37.9721046, -122.0424842834);
-	    map.setCenter(point);
-      	var marker = createMarker(point,'Go to the <a target="_blank" href="http://www.exadel.com">Exadle Web Site</a>');
-		map.setZoom(16);
-		map.addOverlay(marker);
-	   
-	   }
-	   
-	    function setCenter(lag, lat, zoom) {
-
-	       map.setCenter(new GLatLng(lag, lat), zoom);
-	       var ulp = new GPoint(lag,lat);
-      var ul = G_NORMAL_MAP.getProjection().fromPixelToLatLng(ulp,zoom); 
-	       
-	    }
-	   </script>
-	</a4j:outputPanel>
-
+		<a4j:outputPanel>
+			<script>
+		      function createMarker(point,html) {
+		        var marker = new GMarker(point);
+		        GEvent.addListener(marker, "click", function() {
+		          marker.openInfoWindowHtml(html);
+		        });
+		        return marker;
+		      }
+		
+			  function showExadelInMinsk() {
+			   var point = new  GLatLng(53.92316,27.510737, 53.92316,27.510737);
+			   map.setCenter(point);
+		       var marker = createMarker(point,'Go to the <a target="_blank" href="http://www.exadel.com">Exadle Web Site</a>');
+			   map.setZoom(16);
+			   map.addOverlay(marker);
+			  }
+			   
+			  function showExadel() {
+			   	var point = new  GLatLng(37.9721046, -122.0424842834);
+			   	map.setCenter(point);
+		       	var marker = createMarker(point,'Go to the <a target="_blank" href="http://www.exadel.com">Exadle Web Site</a>');
+			   	map.setZoom(16);
+			   	map.addOverlay(marker);
+			   }
+			   
+			   function setCenter(lag, lat, zoom) {
+			    map.setCenter(new GLatLng(lag, lat), zoom);
+			    var ulp = new GPoint(lag,lat);
+		      	var ul = G_NORMAL_MAP.getProjection().fromPixelToLatLng(ulp,zoom);
+			   }
+		   </script>
+		</a4j:outputPanel>
+	</h:form>
+	<h:form>
+		<h:commandLink value="Back" action="main"></h:commandLink>
+	</h:form>
 	</body>
-</f:view>
-</html>
+	</html>
+</f:view>
\ No newline at end of file

Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Gmap.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Gmap.xml	2007-08-10 13:18:31 UTC (rev 2196)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Gmap.xml	2007-08-10 13:52:58 UTC (rev 2197)
@@ -2,14 +2,14 @@
 <!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>
-	<managed-bean>
-		<managed-bean-name>gmap</managed-bean-name>
-		<managed-bean-class>gmap.Gmap</managed-bean-class>
-		<managed-bean-scope>request</managed-bean-scope>
-		<managed-property>
-			<property-name>zoom</property-name>
-			<property-class>java.lang.String</property-class>
-			<value>10</value>
-		</managed-property>
-	</managed-bean>
+ <managed-bean>
+  <managed-bean-name>gmap</managed-bean-name>
+  <managed-bean-class>gmap.Gmap</managed-bean-class>
+  <managed-bean-scope>session</managed-bean-scope>
+  <managed-property>
+   <property-name>zoom</property-name>
+   <property-class>java.lang.String</property-class>
+   <value>10</value>
+  </managed-property>
+ </managed-bean>
 </faces-config>

Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config.xml	2007-08-10 13:18:31 UTC (rev 2196)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config.xml	2007-08-10 13:52:58 UTC (rev 2197)
@@ -25,10 +25,6 @@
    <to-view-id>/PanelBar/PanelBar.jsp</to-view-id>
   </navigation-case>
   <navigation-case>
-   <from-outcome>Gmap</from-outcome>
-   <to-view-id>/Gmap/Gmap.jsp</to-view-id>
-  </navigation-case>
-  <navigation-case>
    <from-outcome>Separator</from-outcome>
    <to-view-id>/Separator/Separator.jsp</to-view-id>
   </navigation-case>
@@ -96,6 +92,10 @@
    <from-outcome>Calendar</from-outcome>
    <to-view-id>/Calendar/Calendar.jsp</to-view-id>
   </navigation-case>
+  <navigation-case>
+   <from-outcome>Gmap</from-outcome>
+   <to-view-id>/Gmap/Gmap.jsp</to-view-id>
+  </navigation-case>
  </navigation-rule>
  <navigation-rule>
   <from-view-id>*</from-view-id>




More information about the richfaces-svn-commits mailing list