[richfaces-svn-commits] JBoss Rich Faces SVN: r2600 - in trunk/samples/tooltip-sample/src/main: webapp/pages and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Aug 29 22:22:37 EDT 2007


Author: nbelaevski
Date: 2007-08-29 22:22:37 -0400 (Wed, 29 Aug 2007)
New Revision: 2600

Added:
   trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp
Modified:
   trunk/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java
   trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp
Log:
richfaces-demo tooltip demo recreated in tooltip-sample

Modified: trunk/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java	2007-08-30 02:15:28 UTC (rev 2599)
+++ trunk/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java	2007-08-30 02:22:37 UTC (rev 2600)
@@ -21,7 +21,6 @@
 
 package org.richfaces;
 
-import java.util.Date;
 
 /**
  * @author $Autor$
@@ -37,6 +36,7 @@
 	String text2 = "ToolTip content2";
 	String text3 = "ToolTip content3";
 	
+	private int counter;
 	
 	public String getText() {
 		return text;
@@ -84,4 +84,7 @@
 		this.text3 = text3;
 	}
 	
+	public int getCounter() {
+		return counter++;
+	}
 }
\ No newline at end of file

Added: trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp
===================================================================
--- trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp	                        (rev 0)
+++ trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp	2007-08-30 02:22:37 UTC (rev 2600)
@@ -0,0 +1,103 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%--@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"--%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/tooltip" prefix="rich"%>
+
+<html>
+	<head>
+		<title></title>
+	</head>
+	<body>
+		<f:view>
+			<h:outputLink value="pages/index.jsf">index.jsf</h:outputLink>
+	<h:panelGrid columns="2">
+		<a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+			<f:verbatim>
+				<p>
+					Here you can see <b>default client-side</b> tool-tip
+				</p>
+			</f:verbatim>
+		
+		<rich:toolTip>
+			<f:verbatim>
+				<span style="white-space:nowrap">
+					This tool-tip content was <strong>pre-rendered</strong> to the page.<br/>
+					The look of this tool-tip is 100% defined by skin.
+				</span>
+			</f:verbatim>
+		</rich:toolTip>
+		</a4j:outputPanel>
+		
+		<a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+			<f:verbatim>
+				<p>
+					This tool-tip will <b>follow mouse</b>. Also this tool-tip has a <b>delay 0.5 sec</b>, so be patient!
+				</p>
+			</f:verbatim>
+		
+		<rich:toolTip followMouse="true" direction="top-right" delay="500" styleClass="tooltip" style="width:250px">
+			<f:verbatim>
+				<span>
+					This tool-tip content also <strong>pre-rendered</strong> to the page.
+					However, the look of this tool-tip is customized by styleClass attribute.
+				</span>
+			</f:verbatim>
+		</rich:toolTip>
+		</a4j:outputPanel>
+	<h:form>
+		<a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+			<f:verbatim>
+				<p>
+					This tool-tip rendered on server <b>in separate request</b>.
+				</p>
+			</f:verbatim>
+		
+		<rich:toolTip direction="top-right" mode="ajax" styleClass="tooltip" layout="block">
+			<f:facet name="defaultContent">
+				<f:verbatim>
+					<strong>Wait...</strong>
+				</f:verbatim>
+			</f:facet>
+			<f:verbatim>
+				<span >This tool-tip content was <strong>rendered on server</strong> </span>
+			</f:verbatim>
+			<h:panelGrid columns="2">
+				<h:outputText value="tooltips requested:" />
+				<h:outputText value="#{bean.counter}" styleClass="tooltipData" />
+			</h:panelGrid>
+		</rich:toolTip>
+		</a4j:outputPanel>
+	</h:form>
+	<h:form>
+		<a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+			<f:verbatim>
+				<p>
+					This tool-tip will be <b>activated on mouse click</b>. It also has a <b>bottom-left</b> position.
+				</p>
+			</f:verbatim>
+		
+		<rich:toolTip event="onclick" direction="bottom-left" mode="ajax" styleClass="tooltip" layout="block">
+			<f:facet name="defaultContent">
+				<f:verbatim>
+					<strong>Wait...</strong>
+				</f:verbatim>
+			</f:facet>
+			<f:verbatim>
+				<span >This tool-tip content was <strong>rendered on server</strong> </span>
+			</f:verbatim>
+			<h:panelGrid columns="2">
+				<h:outputText value="tooltips requested:" />
+				<h:outputText value="#{bean.counter}" styleClass="tooltipData" />
+			</h:panelGrid>
+		</rich:toolTip>
+		</a4j:outputPanel>
+	</h:form>
+</h:panelGrid>
+			
+			
+			
+		</f:view>
+	</body>	
+</html>  
+

Modified: trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp	2007-08-30 02:15:28 UTC (rev 2599)
+++ trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp	2007-08-30 02:22:37 UTC (rev 2600)
@@ -10,6 +10,7 @@
 	</head>
 	<body>
 		<f:view>
+			<h:outputLink value="pages/demo.jsf">demo.jsf</h:outputLink>
 			<h:form>
 				<h:selectOneRadio binding="#{skinBean.component}" />
 				<h:commandLink action="#{skinBean.change}" value="set skin" />




More information about the richfaces-svn-commits mailing list