Author: lfryc(a)redhat.com
Date: 2010-11-04 09:14:03 -0400 (Thu, 04 Nov 2010)
New Revision: 19929
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/targetting.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
rich:tooltip - added two samples: with default targetting to parent component and with
custom target (RF-9589)
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-04
12:38:24 UTC (rev 19928)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-04
13:14:03 UTC (rev 19929)
@@ -141,6 +141,7 @@
components.put("richToggleControl", "Rich Toggle Control");
components.put("richTogglePanel", "Rich Toggle Panel");
components.put("richTogglePanelItem", "Rich Toggle Panel
Item");
+ components.put("richTooltip", "Rich Tooltip");
components.put("richTree", "Rich Tree");
}
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java 2010-11-04
13:14:03 UTC (rev 19929)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITooltip;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:list.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTooltipBean")
+@ViewScoped
+public class RichTooltipBean implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private static Logger logger;
+ private Attributes attributes;
+
+ private int counter = 0;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UITooltip.class, getClass(),
false);
+
+
+ // set defaults
+ attributes.setAttribute("attached", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("followMouse", true);
+ attributes.setAttribute("disabled", false);
+ attributes.setAttribute("layout", "inline");
+ attributes.setAttribute("direction", "bottomRight");
+ attributes.setAttribute("mode", "client");
+ attributes.setAttribute("showEvent", "mouseenter");
+ attributes.setAttribute("hideEvent", "mouseleave");
+ attributes.setAttribute("target", "form:panel");
+
+ // intentionally hidden attributes
+ attributes.remove("bypassUpdates");
+ attributes.remove("converter");
+ attributes.remove("data");
+ attributes.remove("execute");
+ attributes.remove("limitToList");
+ attributes.remove("localValue");
+ attributes.remove("render");
+ attributes.remove("value");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public int getCounter() {
+ return counter++;
+ }
+
+ public Date getTooltipDate() {
+ return new Date();
+ }
+}
Added:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties
===================================================================
---
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties 2010-11-04
13:14:03 UTC (rev 19929)
@@ -0,0 +1,9 @@
+attr.layout.inline=inline
+attr.layout.block=block
+attr.direction.topRight=topRight
+attr.direction.topLeft=topLeft
+attr.direction.bottomRight=bottomRight
+attr.direction.bottomLeft=bottomLeft
+attr.direction.auto=auto
+attr.mode.client=client
+attr.mode.ajax=ajax
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/list.xhtml 2010-11-04
13:14:03 UTC (rev 19929)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Tooltip</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ The sample of <b>rich:tooltip</b> by default targeted to its
parent (rich:panel).
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="targetting"
outcome="targetting" value="Targetting">
+ The sample of <b>rich:tooltip</b> with ability to change
target.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml 2010-11-04
13:14:03 UTC (rev 19929)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+
+ <h:outputStylesheet>
+ .sample-panel {
+ border: 1px solid black;
+ background: solid white;
+ }
+ </h:outputStylesheet>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:panel id="panel" style="width: 200px">
+
+ Panel's content 8
+
+ <rich:tooltip id="tooltip"
+ attached="#{richTooltipBean.attributes['attached'].value}"
+ direction="#{richTooltipBean.attributes['direction'].value}"
+ disabled="#{richTooltipBean.attributes['disabled'].value}"
+ followMouse="#{richTooltipBean.attributes['followMouse'].value}"
+ hideDelay="#{richTooltipBean.attributes['hideDelay'].value}"
+ hideEvent="#{richTooltipBean.attributes['hideEvent'].value}"
+ horizontalOffset="#{richTooltipBean.attributes['horizontalOffset'].value}"
+ layout="#{richTooltipBean.attributes['layout'].value}"
+ mode="#{richTooltipBean.attributes['mode'].value}"
+ rendered="#{richTooltipBean.attributes['rendered'].value}"
+ showDelay="#{richTooltipBean.attributes['showDelay'].value}"
+ showEvent="#{richTooltipBean.attributes['showEvent'].value}"
+ >
+
+ <!--
+
+
+
+
+
+
+
+
+ -->
+
+
+ Tooltip content (counter: #{richTooltipBean.counter})
+
+ </rich:tooltip>
+
+ <!--
+
+
+
+ verticalOffset="#{richTooltipBean.attributes['verticalOffset'].value}"
+ -->
+ </rich:panel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richTooltipBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/targetting.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/targetting.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/targetting.xhtml 2010-11-04
13:14:03 UTC (rev 19929)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+
+ <h:outputStylesheet>
+ .sample-panel {
+ border: 1px solid black;
+ background: solid white;
+ }
+ </h:outputStylesheet>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <div id="regular-div" class="sample-panel">Div with
clientId="regular-div"</div>
+
+ <a4j:outputPanel styleClass="sample-panel" id="jsf-div"
layout="block">
+ Div with id="jsf-div",
clientId="#{rich:clientId('jsf-div')}"
+ </a4j:outputPanel>
+
+ <rich:panel id="panel" style="width: 200px">
+
+ Panel's content 3 (id="panel",
clientId="#{rich:clientId('panel')}")
+
+ <rich:tooltip id="tooltip"
+ attached="#{richTooltipBean.attributes['attached'].value}"
+ direction="#{richTooltipBean.attributes['direction'].value}"
+ disabled="#{richTooltipBean.attributes['disabled'].value}"
+ followMouse="#{richTooltipBean.attributes['followMouse'].value}"
+ hideDelay="#{richTooltipBean.attributes['hideDelay'].value}"
+ hideEvent="#{richTooltipBean.attributes['hideEvent'].value}"
+ horizontalOffset="#{richTooltipBean.attributes['horizontalOffset'].value}"
+ layout="#{richTooltipBean.attributes['layout'].value}"
+ mode="#{richTooltipBean.attributes['mode'].value}"
+ rendered="#{richTooltipBean.attributes['rendered'].value}"
+ target="#{richTooltipBean.attributes['target'].value}"
+ showDelay="#{richTooltipBean.attributes['showDelay'].value}"
+ showEvent="#{richTooltipBean.attributes['showEvent'].value}">
+
+
+ Tooltip content
+
+ </rich:tooltip>
+
+ <!--
+
+
+
+ verticalOffset="#{richTooltipBean.attributes['verticalOffset'].value}"
+ -->
+ </rich:panel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richTooltipBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file