JBoss Rich Faces SVN: r1755 - in trunk/sandbox/ui/scrollable-grid: src/main/config/component and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-20 13:46:02 -0400 (Fri, 20 Jul 2007)
New Revision: 1755
Added:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ContextualColumnVisitor.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridHeaderRendererBase.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SortIconRenderer.java
trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-itself.jspx
Modified:
trunk/sandbox/ui/scrollable-grid/pom.xml
trunk/sandbox/ui/scrollable-grid/src/main/config/component/scrollable-grid.xml
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/AjaxFunctionBuilder.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridRendererState.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/utils/TemplateLoader.java
trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridTagTest.java
Log:
updated POM
Modified: trunk/sandbox/ui/scrollable-grid/pom.xml
===================================================================
--- trunk/sandbox/ui/scrollable-grid/pom.xml 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/pom.xml 2007-07-20 17:46:02 UTC (rev 1755)
@@ -65,5 +65,10 @@
<artifactId>richfaces-impl</artifactId>
<version>3.1.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-core</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: trunk/sandbox/ui/scrollable-grid/src/main/config/component/scrollable-grid.xml
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/config/component/scrollable-grid.xml 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/config/component/scrollable-grid.xml 2007-07-20 17:46:02 UTC (rev 1755)
@@ -26,7 +26,7 @@
<name>scrollable-grid</name>
<classname>org.richfaces.taglib.ScrollableGridTag</classname>
<superclass>
- org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
</superclass>
<!--
<test>
@@ -134,7 +134,7 @@
<name>column</name>
<classname>org.richfaces.taglib.ScrollableGridColumnTag</classname>
<superclass>
- org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
</superclass>
<!--
<test>
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -16,14 +16,14 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import org.ajax4jsf.ajax.repeat.DataComponentState;
-import org.ajax4jsf.ajax.repeat.DataVisitor;
-import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
-import org.ajax4jsf.ajax.repeat.Range;
-import org.ajax4jsf.ajax.repeat.UIDataAdaptor;
-import org.ajax4jsf.framework.ajax.AjaxComponent;
-import org.ajax4jsf.framework.ajax.AjaxContext;
-import org.ajax4jsf.framework.ajax.AjaxEvent;
+import org.ajax4jsf.component.AjaxComponent;
+import org.ajax4jsf.component.UIDataAdaptor;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.event.AjaxEvent;
+import org.ajax4jsf.model.DataComponentState;
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
import org.apache.commons.collections.iterators.IteratorChain;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -5,6 +5,7 @@
import java.util.Iterator;
+import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import org.richfaces.event.sort.SortListener;
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -11,9 +11,9 @@
import javax.faces.context.FacesContext;
import javax.faces.model.DataModelListener;
-import org.ajax4jsf.ajax.repeat.DataVisitor;
-import org.ajax4jsf.ajax.repeat.Range;
-import org.ajax4jsf.ajax.repeat.SerializableDataModel;
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SerializableDataModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -11,9 +11,9 @@
import javax.faces.context.FacesContext;
-import org.ajax4jsf.ajax.repeat.DataVisitor;
-import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
-import org.ajax4jsf.ajax.repeat.Range;
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -12,7 +12,7 @@
import java.io.Serializable;
-import org.ajax4jsf.ajax.repeat.Range;
+import org.ajax4jsf.model.Range;
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/AjaxFunctionBuilder.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/AjaxFunctionBuilder.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/AjaxFunctionBuilder.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -5,10 +5,10 @@
import javax.faces.context.FacesContext;
-import org.ajax4jsf.framework.renderer.RendererBase;
-import org.ajax4jsf.framework.util.javascript.JSFunction;
-import org.ajax4jsf.framework.util.javascript.JSFunctionDefinition;
-import org.ajax4jsf.framework.util.javascript.JSReference;
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.renderkit.RendererBase;
import org.richfaces.component.UIScrollableGrid;
Added: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ContextualColumnVisitor.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ContextualColumnVisitor.java (rev 0)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ContextualColumnVisitor.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -0,0 +1,17 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface ContextualColumnVisitor extends ColumnVisitor {
+ public void setUp(FacesContext context, GridRendererState state) throws IOException;
+ public void tearDown(FacesContext context, GridRendererState state) throws IOException;
+}
Added: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridHeaderRendererBase.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridHeaderRendererBase.java (rev 0)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridHeaderRendererBase.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -0,0 +1,16 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html;
+
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class GridHeaderRendererBase extends HeaderResourcesRendererBase {
+
+
+
+}
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridRendererState.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridRendererState.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridRendererState.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -7,15 +7,14 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
import javax.faces.FacesException;
import javax.faces.component.NamingContainer;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.framework.ajax.AjaxContext;
-import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.component.UIScrollableGrid;
/**
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -6,21 +6,20 @@
import java.util.Map;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.ajax.repeat.DataVisitor;
-import org.ajax4jsf.framework.ajax.AjaxContext;
-import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
-import org.ajax4jsf.framework.renderer.ComponentVariables;
-import org.ajax4jsf.framework.renderer.ComponentsVariableResolver;
-import org.ajax4jsf.framework.renderer.RendererBase;
-import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
-import org.ajax4jsf.framework.util.javascript.JSFunction;
-import org.ajax4jsf.framework.util.javascript.JSFunctionDefinition;
-import org.ajax4jsf.framework.util.javascript.JSReference;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.ComponentsVariableResolver;
+import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.richfaces.component.UIScrollableGrid;
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -14,9 +14,9 @@
import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
-import org.ajax4jsf.ajax.repeat.DataVisitor;
-import org.ajax4jsf.framework.ajax.AjaxContext;
-import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIScrollableGrid;
import org.richfaces.model.selection.ClientSelection;
import org.richfaces.model.selection.Selection;
Added: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SortIconRenderer.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SortIconRenderer.java (rev 0)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SortIconRenderer.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SortIconRenderer {
+
+}
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/utils/TemplateLoader.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/utils/TemplateLoader.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/utils/TemplateLoader.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -3,7 +3,7 @@
*/
package org.richfaces.utils;
-import org.ajax4jsf.framework.renderer.RendererBase;
+import org.ajax4jsf.renderkit.RendererBase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Added: trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-itself.jspx
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-itself.jspx (rev 0)
+++ trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-itself.jspx 2007-07-20 17:46:02 UTC (rev 1755)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:h=" http://ajax4jsf.org/cdk/headers"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+
+ class="org.richfaces.renderkit.html.ScrollableGridHeaderItselfRenderer"
+ component="javax.faces.component.UIComponent"
+ >
+
+<div id="#{client_id}:hcb_#{cell_index}" class="ClientUI_Grid_HCBody">
+ <vcp:body/>
+ <c:if test="#{sortAscending}">
+ <div align="right" id="#{client_id}:hsorta_#{cell_index}" class="sort-asc" />
+ </c:if>
+ <c:if test="#{sortDescending}">
+ <div align="right" id="#{client_id}:hsortd_#{cell_index}" class="sort-desc" />
+ </c:if>
+</div>
+
+</f:root>
\ No newline at end of file
Modified: trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-07-20 17:46:02 UTC (rev 1755)
@@ -17,8 +17,8 @@
</h:styles>
<h:scripts>
- new org.ajax4jsf.framework.resource.PrototypeScript(),
- new org.ajax4jsf.framework.ajax.AjaxScript(),
+ new org.ajax4jsf.javascript.PrototypeScript(),
+ new org.ajax4jsf.javascript.AjaxScript(),
/org/richfaces/renderkit/html/scripts/scrollable-grid.js
</h:scripts>
Modified: trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/component/html/HtmlScrollableGridColumnComponentTest.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -5,17 +5,8 @@
package org.richfaces.component.html;
-import java.lang.String ;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase ;
-
-import com.gargoylesoftware.htmlunit.Page;
import javax.faces.component.UIForm;
import javax.faces.component.html.HtmlForm;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-import javax.faces.component.UIViewRoot;
import org.ajax4jsf.tests.MockValueBinding;
@@ -55,7 +46,7 @@
component.setHeaderClass("headerClass" );
component.setFooterClass("footerClass" );
component.setStyleClass("styleClass" );
- component.setBreakBefore(true );
+ //component.setBreakBefore(true );
component.setStyle("style" );
component.setSortable(true );
@@ -122,9 +113,9 @@
component.setStyleClass("styleClass_styleClass" );
assertEquals("styleClass_styleClass", component.getStyleClass());
component.setValueBinding("breakBefore", new MockValueBinding(new Boolean(true), java.lang.Boolean.class));
- assertEquals(true, component.isBreakBefore());
- component.setBreakBefore(false );
- assertEquals(false, component.isBreakBefore());
+ //assertEquals(true, component.isBreakBefore());
+ //component.setBreakBefore(false );
+ //assertEquals(false, component.isBreakBefore());
component.setValueBinding("style", new MockValueBinding("style", java.lang.String.class));
assertEquals("style", component.getStyle());
component.setStyle("style_style" );
@@ -145,7 +136,7 @@
assertEquals(component.getHeaderClass(), restoredComponent.getHeaderClass());
assertEquals(component.getFooterClass(), restoredComponent.getFooterClass());
assertEquals(component.getStyleClass(), restoredComponent.getStyleClass());
- assertEquals(component.isBreakBefore(), restoredComponent.isBreakBefore());
+ //assertEquals(component.isBreakBefore(), restoredComponent.isBreakBefore());
assertEquals(component.getStyle(), restoredComponent.getStyle());
assertEquals(component.isSortable(), restoredComponent.isSortable());
Modified: trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridTagTest.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridTagTest.java 2007-07-20 17:13:33 UTC (rev 1754)
+++ trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/taglib/ScrollableGridTagTest.java 2007-07-20 17:46:02 UTC (rev 1755)
@@ -4,38 +4,16 @@
*/
package org.richfaces.taglib;
-import java.lang.String ;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase ;
-import java.util.Collection ;
-import java.lang.Object ;
-import java.util.List ;
-import org.ajax4jsf.ajax.repeat.DataComponentState ;
-import java.util.Set ;
-import javax.faces.component.UIComponent ;
-import javax.faces.component.UIComponent;
-import javax.faces.webapp.UIComponentTag;
-import org.richfaces.component.html.HtmlScrollableGrid;
import javax.faces.application.Application;
import javax.faces.el.ValueBinding;
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpSession;
+import javax.faces.webapp.UIComponentTag;
import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspWriter;
-import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.el.ExpressionEvaluator;
-import javax.servlet.jsp.el.VariableResolver;
import javax.servlet.jsp.tagext.Tag;
-import java.io.IOException;
-import java.util.Enumeration;
+import org.richfaces.component.html.HtmlScrollableGrid;
+
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.2 $ $Date: 2007/01/03 21:05:14 $
17 years, 5 months
JBoss Rich Faces SVN: r1754 - trunk/sandbox/samples.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-20 13:13:33 -0400 (Fri, 20 Jul 2007)
New Revision: 1754
Modified:
trunk/sandbox/samples/pom.xml
Log:
tooltip-sample added to modules section
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-07-20 17:12:24 UTC (rev 1753)
+++ trunk/sandbox/samples/pom.xml 2007-07-20 17:13:33 UTC (rev 1754)
@@ -18,7 +18,7 @@
<module>panel2-sample</module>
<module>simpleTogglePanel2-sample</module>
<module>panelmenu-sample</module>
-
+ <module>tooltip-sample</module>
<module>rich-message-demo </module>
</modules>
</project>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1753 - in trunk/sandbox/samples: tooltip-sample and 13 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-20 13:12:24 -0400 (Fri, 20 Jul 2007)
New Revision: 1753
Added:
trunk/sandbox/samples/tooltip-sample/
trunk/sandbox/samples/tooltip-sample/pom.xml
trunk/sandbox/samples/tooltip-sample/src/
trunk/sandbox/samples/tooltip-sample/src/main/
trunk/sandbox/samples/tooltip-sample/src/main/java/
trunk/sandbox/samples/tooltip-sample/src/main/java/org/
trunk/sandbox/samples/tooltip-sample/src/main/java/org/richfaces/
trunk/sandbox/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/tooltip-sample/src/main/resources/
trunk/sandbox/samples/tooltip-sample/src/main/webapp/
trunk/sandbox/samples/tooltip-sample/src/main/webapp/META-INF/
trunk/sandbox/samples/tooltip-sample/src/main/webapp/META-INF/MANIFEST.MF
trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/
trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/tooltip-sample/src/main/webapp/index.jsp
trunk/sandbox/samples/tooltip-sample/src/main/webapp/pages/
trunk/sandbox/samples/tooltip-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/tooltip-sample/src/test/
trunk/sandbox/samples/tooltip-sample/src/test/java/
trunk/sandbox/samples/tooltip-sample/src/test/java/org/
trunk/sandbox/samples/tooltip-sample/src/test/java/org/richfaces/
trunk/sandbox/samples/tooltip-sample/src/test/java/org/richfaces/BeanTest.java
Log:
Added: trunk/sandbox/samples/tooltip-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/tooltip-sample/pom.xml (rev 0)
+++ trunk/sandbox/samples/tooltip-sample/pom.xml 2007-07-20 17:12:24 UTC (rev 1753)
@@ -0,0 +1,33 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>richfaces-samples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>tooltip-sample</artifactId>
+ <packaging>war</packaging>
+ <name>tooltip-sample Maven Webapp</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>tooltip</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>skins</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>tooltip-sample</finalName>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/sandbox/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java (rev 0)
+++ trunk/sandbox/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java 2007-07-20 17:12:24 UTC (rev 1753)
@@ -0,0 +1,87 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import java.util.Date;
+
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+ String text;
+
+ String toolTipContent = "ToolTip content";
+
+ String text1 = "ToolTip content1";
+ String text2 = "ToolTip content2";
+ String text3 = "ToolTip content3";
+
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getToolTipContent() {
+// toolTipContent += "12";
+// System.out.println("start - " + new Date(System.currentTimeMillis()));
+// for(int i=0;i<100000;i++){
+// double a = Math.cos(i+(Math.asin(1.334)));
+// }
+// System.out.println("end - " + new Date(System.currentTimeMillis()));
+ return toolTipContent;
+ }
+
+ public void setToolTipContent(String toolTipContent) {
+ this.toolTipContent = toolTipContent;
+ }
+
+ public String getText1() {
+ return text1;
+ }
+
+ public void setText1(String text1) {
+ this.text1 = text1;
+ }
+
+ public String getText2() {
+ return text2;
+ }
+
+ public void setText2(String text2) {
+ this.text2 = text2;
+ }
+
+ public String getText3() {
+ return text3;
+ }
+
+ public void setText3(String text3) {
+ this.text3 = text3;
+ }
+
+}
\ No newline at end of file
Added: trunk/sandbox/samples/tooltip-sample/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/samples/tooltip-sample/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ trunk/sandbox/samples/tooltip-sample/src/main/webapp/META-INF/MANIFEST.MF 2007-07-20 17:12:24 UTC (rev 1753)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Added: trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/faces-config.xml 2007-07-20 17:12:24 UTC (rev 1753)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.richfaces.Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>skinBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.SkinBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
Added: trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/sandbox/samples/tooltip-sample/src/main/webapp/WEB-INF/web.xml 2007-07-20 17:12:24 UTC (rev 1753)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+<context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+<!--context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>blueSky</param-value>
+ </context-param-->
+
+ <!--
+ -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>forceparser</param-name>
+ <param-value>true</param-value>
+ </init-param>
+
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/sandbox/samples/tooltip-sample/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/tooltip-sample/src/main/webapp/index.jsp (rev 0)
+++ trunk/sandbox/samples/tooltip-sample/src/main/webapp/index.jsp 2007-07-20 17:12:24 UTC (rev 1753)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/tooltip-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/tooltip-sample/src/main/webapp/pages/index.jsp (rev 0)
+++ trunk/sandbox/samples/tooltip-sample/src/main/webapp/pages/index.jsp 2007-07-20 17:12:24 UTC (rev 1753)
@@ -0,0 +1,40 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.ajax4jsf.org/tooltip" prefix="tt"%>
+<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+ <f:verbatim>
+ <br/><br/>
+ <div style="position:relative;top:100px;left:100px;background-color:aqua">
+ </f:verbatim>
+
+ <h:commandButton value="Tooltip with followMouse mode" id="btn">
+ <tt:toolTip id="tt" followMouse="true" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="5" verticalOffset="5" blockLayout="true">
+ <f:facet name="defaultContent"><f:verbatim>DEFAULT CONTENT</f:verbatim>
+ </f:facet>
+ <h:outputText id="ot" value="#{bean.toolTipContent}"></h:outputText>
+ <h:commandLink value="Click here to close window..."></h:commandLink>
+ </tt:toolTip>
+ </h:commandButton>
+ <f:verbatim>
+ </div>
+ </f:verbatim>
+ <%-- h:commandButton value="Tooltip with followMouse mode" id="btn">
+ <tt:toolTip value="Tooltip text" followMouse="false" onclick="alert('onlcick');" direction="bottom-left"></tt:toolTip>
+ </h:commandButton--%>
+
+ <%--a4j:log popup="false" level="ALL"></a4j:log--%>
+ </h:form>
+
+ </f:view>
+ </body>
+</html>
+
Added: trunk/sandbox/samples/tooltip-sample/src/test/java/org/richfaces/BeanTest.java
===================================================================
--- trunk/sandbox/samples/tooltip-sample/src/test/java/org/richfaces/BeanTest.java (rev 0)
+++ trunk/sandbox/samples/tooltip-sample/src/test/java/org/richfaces/BeanTest.java 2007-07-20 17:12:24 UTC (rev 1753)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+*/
+public class BeanTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public BeanTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void testStub() throws Exception {
+
+ }
+}
17 years, 5 months
JBoss Rich Faces SVN: r1752 - trunk/sandbox/ui.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-20 13:00:04 -0400 (Fri, 20 Jul 2007)
New Revision: 1752
Modified:
trunk/sandbox/ui/pom.xml
Log:
tooltip added to modules section
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-07-20 16:59:22 UTC (rev 1751)
+++ trunk/sandbox/ui/pom.xml 2007-07-20 17:00:04 UTC (rev 1752)
@@ -18,5 +18,6 @@
<!--module>scrollable-grid</module-->
<module>simpleTogglePanel2</module>
<module>message</module>
+ <module>tooltip</module>
</modules>
</project>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1751 - in trunk/sandbox/ui: tooltip and 31 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-20 12:59:22 -0400 (Fri, 20 Jul 2007)
New Revision: 1751
Added:
trunk/sandbox/ui/tooltip/
trunk/sandbox/ui/tooltip/design/
trunk/sandbox/ui/tooltip/design/funcspec/
trunk/sandbox/ui/tooltip/design/funcspec/FuncSpec - RF Tool Tip Component.doc
trunk/sandbox/ui/tooltip/design/tooltip/
trunk/sandbox/ui/tooltip/design/tooltip/tooltip.html
trunk/sandbox/ui/tooltip/pom.xml
trunk/sandbox/ui/tooltip/src/
trunk/sandbox/ui/tooltip/src/main/
trunk/sandbox/ui/tooltip/src/main/config/
trunk/sandbox/ui/tooltip/src/main/config/component/
trunk/sandbox/ui/tooltip/src/main/config/component/README
trunk/sandbox/ui/tooltip/src/main/config/component/toolTip.xml
trunk/sandbox/ui/tooltip/src/main/java/
trunk/sandbox/ui/tooltip/src/main/java/META-INF/
trunk/sandbox/ui/tooltip/src/main/java/META-INF/MANIFEST.MF
trunk/sandbox/ui/tooltip/src/main/java/org/
trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/
trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/component/
trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/component/README
trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/renderkit/
trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/renderkit/html/
trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
trunk/sandbox/ui/tooltip/src/main/resources/
trunk/sandbox/ui/tooltip/src/main/resources/org/
trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/
trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/
trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/
trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/
trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/
trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
trunk/sandbox/ui/tooltip/src/main/templates/
trunk/sandbox/ui/tooltip/src/main/templates/README
trunk/sandbox/ui/tooltip/src/main/templates/org/
trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/
trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx
trunk/sandbox/ui/tooltip/src/test/
trunk/sandbox/ui/tooltip/src/test/java/
trunk/sandbox/ui/tooltip/src/test/java/org/
trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/
trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/component/
trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java
trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/renderkit/
trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/renderkit/html/
trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java
Log:
Added: trunk/sandbox/ui/tooltip/design/funcspec/FuncSpec - RF Tool Tip Component.doc
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/ui/tooltip/design/funcspec/FuncSpec - RF Tool Tip Component.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/ui/tooltip/design/tooltip/tooltip.html
===================================================================
--- trunk/sandbox/ui/tooltip/design/tooltip/tooltip.html (rev 0)
+++ trunk/sandbox/ui/tooltip/design/tooltip/tooltip.html 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<title>Hint</title>
+<style>
+.hint{
+ background-color : #FFFAC6; /*tipBackgroundColor*/
+ padding : 7px;
+ border: 1px solid #C77A00; /*TipBorderColor*/
+ font-size : 11px; /*generalSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ color : #000000; /*generalFontColor*/
+ float : left;
+}
+
+.hint_param{
+ width : 300px;
+ position : absolute;
+ top : 200px;
+ left : 200px;
+}
+
+</style>
+</head>
+
+<body>
+<div class="hint_param">
+<div class="hint">
+ Hint content
+</div>
+</div>
+
+</body>
+</html>
Added: trunk/sandbox/ui/tooltip/pom.xml
===================================================================
--- trunk/sandbox/ui/tooltip/pom.xml (rev 0)
+++ trunk/sandbox/ui/tooltip/pom.xml 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>richfaces-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>tooltip</artifactId>
+ <name>tooltip</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.ajax4jsf.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>1.1.2-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>generate-tests</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>tooltip</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>common</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/ui/tooltip/src/main/config/component/README
===================================================================
Added: trunk/sandbox/ui/tooltip/src/main/config/component/toolTip.xml
===================================================================
--- trunk/sandbox/ui/tooltip/src/main/config/component/toolTip.xml (rev 0)
+++ trunk/sandbox/ui/tooltip/src/main/config/component/toolTip.xml 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<!--
+<!DOCTYPE components PUBLIC "-//EXADEL//Generator config/EN" "http://exadel.com/dtds/component-config.dtd" >
+ -->
+
+
+
+<components>
+ <component>
+ <name>org.richfaces.component.ToolTip</name>
+ <family>org.richfaces.component.ToolTip</family>
+ <classname>org.richfaces.component.html.HtmlToolTip</classname>
+ <superclass>org.richfaces.component.UIToolTip</superclass>
+ <description><![CDATA[Defines tooltip for parent component.]]></description>
+ <test>
+ <classname>org.richfaces.component.html.HtmlToolTipTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+
+ <!--renderer generate="true" override="true">
+ <name>org.richfaces.renderkit.html.ToolTipRenderer</name>
+ <template>org/richfaces/htmltooltip.jspx</template>
+ </renderer-->
+ <renderer override="true">
+ <name>org.richfaces.renderkit.html.ToolTipRenderer</name>
+ <classname>org.richfaces.renderkit.html.ToolTipRenderer</classname>
+ </renderer>
+
+ <tag>
+ <name>toolTip</name>
+ <classname>org.richfaces.taglib.HtmlToolTipTag</classname>
+ <superclass>org.ajax4jsf.framework.taglib.HtmlComponentTagBase</superclass>
+ <test>
+ <classname>org.richfaces.taglib.HtmlToolTipTagTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+ </tag>
+
+ <property>
+ <name>blockLayout</name>
+ <classname>boolean</classname>
+ <description>block/inline mode flag. Tooltip will contain div/span elements accordingly. False is default.</description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+
+ <property>
+ <name>oncomplete</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onshow</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onhide</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+
+
+
+ <property>
+ <name>value</name>
+ <classname>java.lang.String</classname>
+ <description>Label on the tooltip</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>event</name>
+ <classname>java.lang.String</classname>
+ <description>event that triggers the tooltip appearance (default = onmouseover)</description>
+ <defaultvalue><![CDATA["mouseover"]]></defaultvalue>
+ </property>
+ <property>
+ <name>mode</name>
+ <classname>java.lang.String</classname>
+ <description>controls the way of data loading to tooltip and should have following values “client” (default), “ajax”</description>
+ <defaultvalue><![CDATA["client"]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>If false the components is rendered on the client but Js for calling – disabled.</description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <property>
+ <name>direction</name>
+ <classname>java.lang.String</classname>
+ <description>Defines direction of the popup list to appear (top-right, top-left bottom-right, bottom-left, auto(default))</description>
+ <defaultvalue><![CDATA["bottom-right"]]></defaultvalue>
+ </property>
+ <property>
+ <name>followmouse</name>
+ <classname>boolean</classname>
+ <description>If true – tooltip should follow the mouse while it moves over the parent element</description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <property>
+ <name>horizontalOffset</name>
+ <classname>int</classname>
+ <description>Sets the horizontal offset between popup list and mouse pointer</description>
+ <defaultvalue>10</defaultvalue>
+ </property>
+ <property>
+ <name>verticalOffset</name>
+ <classname>int</classname>
+ <description>Sets the vertical offset between popup list and mouse pointer</description>
+ <defaultvalue>10</defaultvalue>
+ </property>
+ <property>
+ <name>style</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+
+ &ui_component_attributes;
+ &html_events;
+
+ <property>
+ <name>onclick</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>ondblclick</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmouseout</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmousemove</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmouseover</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ </component>
+ <renderer generate="true">
+ <template>org/richfaces/htmltooltipblock.jspx</template>
+ </renderer>
+ <!--renderer generate="true" override="true">
+ <name>org.richfaces.renderkit.html.ToolTipRenderer</name>
+ <template>org/richfaces/htmltooltip.jspx</template>
+ </renderer-->
+ <renderer generate="true">
+ <template>org/richfaces/htmltooltip.jspx</template>
+ </renderer>
+</components>
\ No newline at end of file
Added: trunk/sandbox/ui/tooltip/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/ui/tooltip/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ trunk/sandbox/ui/tooltip/src/main/java/META-INF/MANIFEST.MF 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/component/README
===================================================================
Added: trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
===================================================================
--- trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java (rev 0)
+++ trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,130 @@
+package org.richfaces.component;
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+
+import org.ajax4jsf.framework.ajax.AjaxChildrenEncoder;
+import org.ajax4jsf.framework.ajax.AjaxContext;
+import org.ajax4jsf.framework.ajax.AjaxEvent;
+import org.richfaces.renderkit.html.ToolTipRenderer;
+
+public abstract class UIToolTip extends UIComponentBase implements AjaxChildrenEncoder{
+
+ public static final String COMPONENT_TYPE = "org.richfaces.toolTip";
+ public static final String CONTENT_FACET_NAME = "defaultContent";
+
+ public abstract String getValue();
+
+ public abstract void setValue(String value);
+
+ public abstract boolean isBlockLayout();
+
+ public abstract void setBlockLayout(boolean value);
+
+ public abstract String getEvent();
+
+ public abstract void setEvent(String event);
+
+ public abstract String getMode();
+
+ public abstract void setMode(String mode);
+
+ public abstract boolean isDisabled();
+
+ public abstract void setDisabled(boolean disabled);
+
+ public abstract String getDirection();
+
+ public abstract void setDirection(String direction);
+
+ public abstract boolean isFollowMouse();
+
+ public abstract void setFollowMouse(boolean followMouse);
+
+ public abstract int getHorizontalOffset();
+
+ public abstract void setHorizontalOffset(int horizontalOffset);
+
+ public abstract int getVerticalOffset();
+
+ public abstract void setVerticalOffset(int verticalOffset);
+
+ public abstract String getStyle();
+
+ public abstract void setStyle(String style);
+
+ public abstract String getStyleClass();
+
+ public abstract void setStyleClass(String styleClass);
+
+ public abstract String getOncomplete();
+
+ public abstract void setOncomplete(String oncomplete);
+
+ public abstract String getOnshow();
+
+ public abstract void setOnshow(String onshow);
+
+ public abstract String getOnhide();
+
+ public abstract void setOnhide(String onhide);
+
+ public abstract String getOnclick();
+
+ public abstract void setOnclick(String onclick);
+
+ public abstract String getOndblclick();
+
+ public abstract void setOndblclick(String ondblclick);
+
+ public abstract String getOnmouseout();
+
+ public abstract void setOnmouseout(String onmouseout);
+
+ public abstract String getOnmousemove();
+
+ public abstract void setOnmousemove(String onmousemove);
+
+ public abstract String getOnmouseover();
+
+ public abstract void setOnmouseover(String onmouseover);
+
+ public String getUsedElementType(){
+ return isBlockLayout() ? "div" : "span";
+ }
+
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+
+ super.broadcast(event);
+
+ if (event instanceof AjaxEvent) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
+ ajaxContext.getAjaxAreasToRender().add(this.getClientId(facesContext) + "content");
+ ajaxContext.addRegionsFromComponent(this);
+ }
+ }
+
+ public void encodeAjaxChild(FacesContext context, String path, Set ids,
+ Set renderedAreas) throws IOException {
+
+ if(ids.contains(this.getClientId(context) + "content")){
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ ToolTipRenderer r = (ToolTipRenderer)getRenderer(context);
+ r.encodeTooltipText(context, this);
+ ajaxContext.getAjaxRenderedAreas().add(this.getClientId(context) + "content");
+ } else {
+ // todo
+// AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+// ajaxContext.e
+
+ }
+
+ }
+
+}
Added: trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java (rev 0)
+++ trunk/sandbox/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,341 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.framework.ajax.AjaxEvent;
+import org.ajax4jsf.framework.renderer.AjaxComponentRendererBase;
+import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
+import org.ajax4jsf.framework.resource.InternetResource;
+import org.ajax4jsf.framework.skin.Skin;
+import org.ajax4jsf.framework.util.javascript.JSFunction;
+import org.ajax4jsf.framework.util.javascript.JSFunctionDefinition;
+import org.ajax4jsf.framework.util.javascript.JSReference;
+import org.richfaces.component.UIToolTip;
+
+public class ToolTipRenderer extends AjaxComponentRendererBase{
+
+ //
+ // Declarations
+ //
+ private final InternetResource[] styles = {
+ getResource("/org/richfaces/renderkit/html/css/tooltip.xcss")
+ };
+
+private InternetResource[] stylesAll = null;
+
+protected InternetResource[] getStyles() {
+ synchronized (this) {
+ if (stylesAll == null) {
+ InternetResource[] rsrcs = super.getStyles();
+ boolean ignoreSuper = rsrcs == null || rsrcs.length == 0;
+ boolean ignoreThis = styles == null || styles.length == 0;
+
+ if (ignoreSuper) {
+ if (ignoreThis) {
+ stylesAll = new InternetResource[0];
+ } else {
+ stylesAll = styles;
+ }
+ } else {
+ if (ignoreThis) {
+ stylesAll = rsrcs;
+ } else {
+ java.util.Set rsrcsSet = new java.util.LinkedHashSet();
+
+ for (int i = 0; i < rsrcs.length; i++ ) {
+ rsrcsSet.add(rsrcs[i]);
+ }
+
+ for (int i = 0; i < styles.length; i++ ) {
+ rsrcsSet.add(styles[i]);
+ }
+
+ stylesAll = (InternetResource[]) rsrcsSet.toArray(new InternetResource[rsrcsSet.size()]);
+ }
+ }
+ }
+ }
+
+ return stylesAll;
+}
+ private final InternetResource[] scripts = {
+ new org.ajax4jsf.framework.resource.PrototypeScript()
+ ,
+ new org.ajax4jsf.framework.ajax.AjaxScript()
+ ,
+ getResource("/org/richfaces/renderkit/html/scripts/utils.js")
+ ,
+ getResource("/org/richfaces/renderkit/html/scripts/tooltip.js")
+ };
+
+private InternetResource[] scriptsAll = null;
+
+protected InternetResource[] getScripts() {
+ synchronized (this) {
+ if (scriptsAll == null) {
+ InternetResource[] rsrcs = super.getScripts();
+ boolean ignoreSuper = rsrcs == null || rsrcs.length == 0;
+ boolean ignoreThis = scripts == null || scripts.length == 0;
+
+ if (ignoreSuper) {
+ if (ignoreThis) {
+ scriptsAll = new InternetResource[0];
+ } else {
+ scriptsAll = scripts;
+ }
+ } else {
+ if (ignoreThis) {
+ scriptsAll = rsrcs;
+ } else {
+ java.util.Set rsrcsSet = new java.util.LinkedHashSet();
+
+ for (int i = 0; i < rsrcs.length; i++ ) {
+ rsrcsSet.add(rsrcs[i]);
+ }
+
+ for (int i = 0; i < scripts.length; i++ ) {
+ rsrcsSet.add(scripts[i]);
+ }
+
+ scriptsAll = (InternetResource[]) rsrcsSet.toArray(new InternetResource[rsrcsSet.size()]);
+ }
+ }
+ }
+ }
+
+ return scriptsAll;
+}
+ //
+ //
+ //
+
+
+ private String convertToString(Object obj ) {
+ return ( obj == null ? "" : obj.toString() );
+ }
+ private String convertToString(boolean b ) {
+ return String.valueOf(b);
+ }
+ private String convertToString(int b ) {
+ return b!=Integer.MIN_VALUE?String.valueOf(b):"";
+ }
+ private String convertToString(long b ) {
+ return b!=Long.MIN_VALUE?String.valueOf(b):"";
+ }
+
+
+
+ protected Class getComponentClass() {
+ return org.richfaces.component.UIToolTip.class;
+ }
+
+ public String getBgColor(FacesContext context, UIComponent component){
+ Skin skin = getSkin(context);
+ String color = (String) skin.getParameter(context,"headerBackgroundColor");
+ return color;
+ }
+
+ public String getColor(FacesContext context, UIComponent component){
+ Skin skin = getSkin(context);
+ String color = (String) skin.getParameter(context,"headerTextColor");
+ return color;
+ }
+
+
+
+ public void insertValue(FacesContext context, UIComponent component) throws IOException {
+ Object value = component.getAttributes().get("value");
+ if (value!=null){
+ context.getResponseWriter().write(value.toString());
+ }
+ }
+
+
+ public String insertAjaxFunction(FacesContext context, UIComponent component){
+ JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context);
+ component.getClientId(context);
+
+ Map eventOptions = AjaxRendererUtils.buildEventOptions(context, component);
+
+ //after element is subsituted in DOM tree, we have to re-create
+ //it's JS-reference, cause old one is already invalid
+ String refreshTooltipInDOM = ";" + getJsVarName(context, component) + ".toolTip = $('" + component.getClientId(context) + "');" +
+ ";" + getJsVarName(context, component) + ".toolTipContent = $('" + component.getClientId(context) + "content');";
+
+ String showNewToolTip = ";" + getJsVarName(context, component) + ".displayDiv();";
+
+ //enable ajaxSingle mode, i.e. we do not need to submit all form controls to get tooltip content
+ eventOptions.put("control", JSReference.THIS);
+
+ if(eventOptions.containsKey("oncomplete")){
+ JSFunctionDefinition onComplete = (JSFunctionDefinition)eventOptions.get("oncomplete");
+ onComplete.addToBody(refreshTooltipInDOM + showNewToolTip);
+ eventOptions.put("oncomplete", onComplete);
+ } else {
+ JSFunctionDefinition onComplete = new JSFunctionDefinition();
+ onComplete.addParameter("request");
+ onComplete.addParameter("event");
+ onComplete.addParameter("data");
+ onComplete.addToBody(refreshTooltipInDOM + showNewToolTip);
+ eventOptions.put("oncomplete", onComplete);
+ }
+
+ function.addParameter(eventOptions);
+
+ return function.toScript();
+ }
+
+
+ public void insertScript(FacesContext context, UIComponent component) throws IOException{
+
+ UIToolTip toolTip = (UIToolTip)component;
+ String parentClientId = toolTip.getParent().getClientId(context);
+ StringBuffer ret = new StringBuffer();
+ ret.append("<script ");
+ ret.append("type=\"text/javascript\" ");
+ ret.append("id =\"script" + component.getClientId(context)+"\">\n");
+ String comma = ",";
+ String quot = "\"";
+ StringBuffer script = new StringBuffer();
+ //
+ String event = toolTip.getEvent();
+ if(event.startsWith("on")){
+ event = event.substring(2);
+ }
+ String events = "{event:\"" + event + "\",onshow:\"" + toolTip.getOnshow() +
+ "\",oncomplete:\"" + toolTip.getOncomplete() + "\",onhide:\"" + toolTip.getOnhide() +
+ "\"}";
+ //script.append("var tooltip1 = ").
+
+ script.append(getJsVarName(context, toolTip) + " = ").
+ append("new ToolTip(" + events).append(comma).append(quot).append( toolTip.getClientId(context)).append(quot).append(comma).
+ append(quot).append(parentClientId).append(quot).append(comma).
+ append(quot).append(toolTip.getMode()).append(quot).append(comma).
+ append(toolTip.isDisabled()).append(comma).
+ append(quot).append(toolTip.getDirection()).append(quot).append(comma).
+ append(toolTip.isFollowMouse()).append(comma).
+ append(toolTip.getHorizontalOffset()).append(comma).
+ append(toolTip.getVerticalOffset()).append(comma).
+ append("\"").append(insertAjaxFunction(context, component)).append("\");\n");
+ ret.append(script.toString());
+
+ //
+ //ret.append("function toolTipAttach(){tooltip1.attachParentEvents() }\n");
+
+ ret.append("\n</script>");
+ ResponseWriter writer = context.getResponseWriter();
+ writer.write(ret.toString());
+
+ }
+
+
+ private String getJsVarName(FacesContext context, UIComponent component){
+ return "window.tooltip" + component.getClientId(context).replaceAll("[^A-Za-z0-9_]", "_");
+ }
+
+ protected void doDecode(FacesContext context, UIComponent component) {
+
+ UIToolTip tooltip = (UIToolTip)component;
+
+ String clientId = tooltip.getClientId(context);
+
+ if(context.getExternalContext().getRequestParameterMap().containsKey(clientId)){
+ if("ajax".equals(tooltip.getMode())){
+ new AjaxEvent(component).queue();
+ }
+ }
+ }
+
+ public void encodeTooltipText(FacesContext context, UIToolTip component) throws IOException {
+ ResponseWriter responseWriter = context.getResponseWriter();
+ responseWriter.startElement(component.getUsedElementType(), component);
+ responseWriter.writeAttribute("id", component.getClientId(context) + "content", null);
+ responseWriter.write(component.getValue() != null ? component.getValue() : "");
+ super.renderChildren(context, component);
+ responseWriter.endElement(component.getUsedElementType());
+ }
+
+
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context,
+ UIComponent component) throws IOException {
+ // TODO Auto-generated method stub
+ //super.doEncodeBegin(writer, context, component);
+ UIToolTip toolTip = (UIToolTip)component;
+ Class rendererClass = null;
+ try{
+ if(toolTip.isBlockLayout()){
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRendererBlock");
+ } else {
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRenderer");
+ }
+ ToolTipRenderer renderer = (ToolTipRenderer)rendererClass.newInstance();
+ renderer.doEncodeBegin(writer, context, component);
+
+ } catch(Exception e){
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+
+ protected void doEncodeChildren(ResponseWriter writer,
+ FacesContext context, UIComponent component) throws IOException {
+ // TODO Auto-generated method stub
+ //super.doEncodeChildren(writer, context, component);
+ UIToolTip toolTip = (UIToolTip)component;
+ Class rendererClass = null;
+ try{
+ if(toolTip.isBlockLayout()){
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRendererBlock");
+ } else {
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRenderer");
+ }
+
+ ToolTipRenderer renderer = null;
+
+ renderer = (ToolTipRenderer)rendererClass.newInstance();
+
+ renderer.doEncodeChildren(writer, context, component);
+ } catch(Exception e){
+ throw new FacesException(e.getMessage(), e);
+ }
+
+
+ }
+
+
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context,
+ UIComponent component) throws IOException {
+ // TODO Auto-generated method stub
+ //super.doEncodeEnd(writer, context, component);
+ UIToolTip toolTip = (UIToolTip)component;
+ Class rendererClass = null;
+ try{
+ if(toolTip.isBlockLayout()){
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRendererBlock");
+ } else {
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRenderer");
+ }
+ ToolTipRenderer renderer = (ToolTipRenderer)rendererClass.newInstance();
+ renderer.doEncodeEnd(writer, context, component);
+ } catch (Exception e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see javax.faces.render.Renderer#getRendersChildren()
+ */
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+
+}
+
Added: trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
===================================================================
--- trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss (rev 0)
+++ trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:template
+ xmlns:f="http://jsf.exadel.com/template"
+ xmlns:u="http://jsf.exadel.com/template/util"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+
+ <u:selector name=".dr-rich-tool-tip">
+ <u:style name="background-color" skin="tipBackgroundColor"/>
+ <u:style name="padding" value="7px"/>
+ <u:style name="border" value="1px solid"/>
+ <u:style name="border-color" skin="tipBorderColor"/>
+ <u:style name="font-size" skin="generalSizeFont"/>
+ <u:style name="font-family" skin="generalFamilyFont"/>
+ <u:style name="color" skin="generalFontColor"/>
+ <u:style name="float" value="left"/>
+ </u:selector>
+
+</f:template>
Added: trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
--- trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js (rev 0)
+++ trunk/sandbox/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,267 @@
+// Detect if the browser is IE or not.
+// If it is not IE, we assume that the browser is NS.
+var IE = document.all?true:false;
+
+ToolTip = Class.create();
+
+ToolTip.prototype = {
+ initialize:function(events, id, parentId, mode, disabled, direction, followMouse, horizontalOffset, verticalOffset, ajaxFunction){
+ this.event = events.event;
+ this.onshow = events.onshow;
+ this.oncomplete = events.oncomplete;
+ this.onhide = events.onhide;
+
+ this.id = id;
+ this.parentId = parentId;
+ this.mode = mode;
+ this.direction = direction;
+ this.disabled = disabled;
+ this.followMouse = followMouse;
+ this.horizontalOffset = horizontalOffset;
+ this.verticalOffset = verticalOffset;
+ this.ajaxExecuteString = ajaxFunction;
+ this.toolTip = $(id);
+
+ this.toolTipContent = $(id + 'content');
+ this.toolTipDefaultContent = $(id + 'defaultContent');
+
+ this.toolTip.style.visibility='hidden';
+ this.toolTip.style.display='block';
+
+ this.toolTipOffsetW = this.toolTip.offsetWidth;
+ this.toolTipOffsetH = this.toolTip.offsetHeight;
+
+ this.toolTipW = this.toolTip.getWidth();
+ this.toolTipH = this.toolTip.getHeight();
+
+ this.toolTipBorderHeight = (this.toolTipOffsetH - this.toolTipH) / 2;
+ this.toolTipBorderWidth = (this.toolTipOffsetW - this.toolTipW) / 2;
+ this.toolTip.style.visibility = 'visible';
+ this.toolTip.style.display = "none";
+ this.parentAttached = false;
+ this.hintParentElement = null;
+
+ // mouse could be overed while ajax request is still in process,
+ // so, after DOM-element replaced, we should not display it
+ this.isMouseOvered = false;
+
+ if(IE){
+ var toolTipZindex = parseInt(this.toolTip.style.zIndex);
+ new Insertion.Before(this.toolTip,
+ "<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.id + "iframe\"" +
+ "style=\"position: absolute; width: " + this.toolTipOffsetW + "px; height: " + this.toolTipOffsetH + "px; display: none;background-color:black; z-index: " +
+ + (toolTipZindex-1) + ";\">" + "</iframe>");
+ this.iframe = $(this.id + 'iframe');
+ }
+
+ if(!this.disabled) Event.observe(document.getElementsByTagName("body")[0], "mousemove", this.attachOnLoadEvents.bindAsEventListener(this), true);
+ },
+ attachOnLoadEvents: function(){
+ if(!this.parentAttached){
+ this.parent = $(this.parentId);
+ if(this.parent != null && !this.disabled){
+ this.attachParentEvents();
+ this.parentAttached = true;
+ }
+ Event.stopObserving(document.getElementsByTagName("body")[0], "mousemove", this.attachOnLoadEvents.bindAsEventListener(this), false);
+ }
+ },
+ attachParentEvents: function(){
+ if(this.followMouse){
+ Event.observe(this.parent, 'mousemove', this.setToolTipPosition.bindAsEventListener(this), false);
+ }
+ Event.observe(this.parent, this.event, this.doShow.bindAsEventListener(this), false);
+ Event.observe(this.parent, "mouseout", this.doHide.bindAsEventListener(this), false);
+
+ Event.observe(this.toolTip, 'mouseout', this.leaveToolTip.bindAsEventListener(this), false)
+ },
+
+ detectAncestorNode: function(leaf, element) {
+ // Return true if "element" is "leaf" or one of its parents
+ var node = leaf;
+ while (node != null && node != element)
+ node = node.parentNode;
+ return (node != null);
+ },
+
+
+ leaveToolTip: function(e) {
+
+ var hintNotLeft = false;
+
+ // detect mouse move from hint to owner
+ // if mouse entered the just the owner hintNotLeft is set true
+ hintNotLeft = this.detectAncestorNode(e.toElement,this.hintParentElement);
+ hintNotLeft = hintNotLeft || this.detectAncestorNode(e.relatedTarget,this.hintParentElement);
+
+ if (!hintNotLeft){
+ this.doHide(e);
+ this.isMouseOvered = false;
+ }
+ },
+
+
+
+
+ doShow: function(e){
+ this.isMouseOvered = true;
+ if (e.target)
+ this.hintParentElement = e.target;
+ if (e.srcElement)
+ this.hintParentElement = e.srcElement;
+
+
+ this.setToolTipPosition(e);
+ if(this.mode == 'ajax'){
+ if(this.toolTipDefaultContent){
+ this.toolTipContent.innerHTML = this.toolTipDefaultContent.innerHTML;
+ }
+ var event = e;
+ eval(this.ajaxExecuteString);
+ }
+ this.displayDiv(e);
+ },
+
+ doHide: function(e){
+ var fakeEvent = false;
+ fakeEvent = this.detectAncestorNode(e.toElement,this.toolTip);
+ fakeEvent = fakeEvent || this.detectAncestorNode(e.relatedTarget,this.toolTip);
+
+
+ if (!fakeEvent) {
+ this.isMouseOvered = false;
+ this.toolTip.style.display = "none";
+ if(this.iframe){
+ this.iframe.style.display = "none";
+ }
+ this.hintParentElement = null;
+ this.isMouseOvered = false;
+ }
+
+ },
+
+ doEnable: function(){
+ this.disabled = false;
+ },
+ doDisable: function(){
+ this.disabled = true;
+ },
+
+ setToolTipPosition: function(e){
+
+ var windowDim = this.windowSize();
+ var cursorX = e.clientX + document.body.scrollLeft;
+ var cursorY = e.clientY + document.body.scrollTop;
+
+ if(this.toolTip.style.display != 'none'){
+ this.toolTipH = this.toolTip.getHeight();
+ this.toolTipW = this.toolTip.getWidth();
+ }
+
+ var offsets = Position.cumulativeOffset(this.parent);
+
+ cursorX -= offsets[0];
+ cursorY -= offsets[1];
+
+ cursorX += this.parent.offsetLeft;
+ cursorY += this.parent.offsetTop;
+
+ this.toolTip.style.top = cursorY;
+ this.toolTip.style.left = cursorX;
+
+
+
+ if(this.direction == "top-left"){
+ this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ /*
+ if(cursorY - this.verticalOffset - this.toolTipH < 0){
+ this.toolTip.style.top = cursorY + this.verticalOffset - this.toolTipH;
+ } else {
+ this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ }
+ if(cursorX - this.horizontalOffset - this.toolTipW < 0){
+ this.toolTip.style.left = cursorX + this.horizontalOffset;
+ } else {
+ this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ }
+ */
+ } else if(this.direction == "bottom-left"){
+ this.toolTip.style.top = cursorY + this.verticalOffset;
+ this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ /*
+ if(cursorY + this.verticalOffset + this.toolTipH > windowDim[1]){
+ this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ } else {
+ this.toolTip.style.top = cursorY + this.verticalOffset;
+ }
+ if(cursorX - this.horizontalOffset - this.toolTipW < 0){
+ this.toolTip.style.left = cursorX + this.horizontalOffset ;
+ } else {
+ this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ }
+ */
+ } else if(this.direction == "top-right"){
+ this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ this.toolTip.style.left = cursorX + this.horizontalOffset;
+ /*
+ if(cursorY - this.verticalOffset - this.toolTipH < 0){
+ this.toolTip.style.top = cursorY + this.verticalOffset;
+ } else {
+ this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ }
+ if(cursorX + this.horizontalOffset + this.toolTipW > windowDim[0]){
+ this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ } else {
+ this.toolTip.style.left = cursorX + this.horizontalOffset;
+ }
+ */
+ } else {
+ // bottom-right is default
+ this.toolTip.style.top = cursorY + this.verticalOffset;
+ this.toolTip.style.left = cursorX + this.horizontalOffset;
+ /*
+ if(cursorY + this.verticalOffset - this.toolTip.clientHeight > windowDim[1]){
+ this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ } else {
+ this.toolTip.style.top = cursorY + this.verticalOffset;
+ }
+ if(cursorX + this.horizontalOffset + this.toolTip.clientWidth > windowDim[0]){
+ this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ } else {
+ this.toolTip.style.left = cursorX + this.horizontalOffset;
+ }
+ */
+ }
+
+ },
+
+ windowSize: function() {
+ var wWidth = 0, wHeight = 0;
+ if( typeof( window.innerWidth ) == 'number' ) {
+ //Non-IE
+ wWidth = window.innerWidth;
+ wHeight = window.innerHeight;
+ } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
+ //IE 6+ in 'standards compliant mode'
+ wWidth = document.documentElement.clientWidth;
+ wHeight = document.documentElement.clientHeight;
+ } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
+ //IE 4 compatible
+ wWidth = document.body.clientWidth;
+ wHeight = document.body.clientHeight;
+ }
+ return [wWidth,wHeight];
+ },
+
+ displayDiv: function(e){
+ if(this.isMouseOvered){
+ this.toolTip.style.display = "block";
+ if(this.iframe){
+ this.iframe.style.top = parseInt(this.toolTip.style.top) - this.toolTipBorderHeight;
+ this.iframe.style.left = parseInt(this.toolTip.style.left) - this.toolTipBorderWidth;
+ this.iframe.style.display = "block";
+ }
+ }
+ }
+}
\ No newline at end of file
Added: trunk/sandbox/ui/tooltip/src/main/templates/README
===================================================================
Added: trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
--- trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx (rev 0)
+++ trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http:/jsf.exadel.com/template"
+ xmlns:h=" http://ajax4jsf.org/cdk/headers"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.HtmlToolTipRenderer"
+ baseclass="org.richfaces.renderkit.html.ToolTipRenderer"
+ component="org.richfaces.component.UIToolTip" >
+
+ <!-- h:styles>
+ /org/richfaces/renderkit/html/css/tooltip.xcss
+ </h:styles>
+ <h:scripts>
+ new org.ajax4jsf.framework.resource.PrototypeScript(),
+ new org.ajax4jsf.framework.ajax.AjaxScript(),
+ /org/richfaces/renderkit/html/scripts/utils.js,
+ /org/richfaces/renderkit/html/scripts/tooltip.js
+ </h:scripts-->
+
+ <f:clientid var="clientId"/>
+ <span id="#{clientId}" style="position: absolute; display : none;z-index:99; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
+ <f:call name="utils.encodePassThru" />
+ <span id="#{clientId}defaultContent" style="display:none">
+ <u:insertFacet name="defaultContent" />
+ </span>
+ <vcp:body>
+ <f:call name="encodeTooltipText"/>
+ </vcp:body>
+ <f:clientid var="clientId"/>
+ <span id="#{clientId}script" style="display:none">
+ <f:call name="insertScript"/>
+ </span>
+ </span>
+
+
+
+
+ <!-- f:call name="utils.encodeEndFormIfNessesary"/-->
+</f:root>
Added: trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx
===================================================================
--- trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx (rev 0)
+++ trunk/sandbox/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http:/jsf.exadel.com/template"
+ xmlns:h=" http://ajax4jsf.org/cdk/headers"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.HtmlToolTipRendererBlock"
+ baseclass="org.richfaces.renderkit.html.ToolTipRenderer"
+ component="org.richfaces.component.UIToolTip" >
+
+ <!-- h:styles>
+ /org/richfaces/renderkit/html/css/tooltip.xcss
+ </h:styles>
+ <h:scripts>
+ new org.ajax4jsf.framework.resource.PrototypeScript(),
+ new org.ajax4jsf.framework.ajax.AjaxScript(),
+ /org/richfaces/renderkit/html/scripts/utils.js,
+ /org/richfaces/renderkit/html/scripts/tooltip.js
+ </h:scripts-->
+
+ <f:clientid var="clientId"/>
+ <div id="#{clientId}" style="position: absolute; display : none;z-index:99; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
+ <f:call name="utils.encodePassThru" />
+ <div id="#{clientId}defaultContent" style="display:none">
+ <u:insertFacet name="defaultContent" />
+ </div>
+ <vcp:body>
+ <f:call name="encodeTooltipText"/>
+ </vcp:body>
+ <f:clientid var="clientId"/>
+ <span id="#{clientId}script" style="display:none">
+ <f:call name="insertScript"/>
+ </span>
+ </div>
+ <!-- f:call name="utils.encodeEndFormIfNessesary"/-->
+</f:root>
Added: trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java (rev 0)
+++ trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import javax.faces.component.UIComponent;
+
+/**
+ * Unit test for simple Component.
+ */
+public class JSFComponentTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}
Added: trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java
===================================================================
--- trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java (rev 0)
+++ trunk/sandbox/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java 2007-07-20 16:59:22 UTC (rev 1751)
@@ -0,0 +1,40 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+public class ToolTipRendererTest extends AbstractAjax4JsfTestCase{
+
+ public ToolTipRendererTest(String name) {
+ super(name);
+ // TODO Auto-generated constructor stub
+ }
+
+
+ public void setUp() throws Exception {
+ // TODO Auto-generated method stub
+
+ super.setUp();
+ }
+
+
+ protected void setupResponseWriter() throws IOException {
+ // TODO Auto-generated method stub
+ super.setupResponseWriter();
+ }
+
+
+ protected void setupWebClient() {
+ // TODO Auto-generated method stub
+ super.setupWebClient();
+ }
+
+
+ public void tearDown() throws Exception {
+ // TODO Auto-generated method stub
+ super.tearDown();
+ }
+
+
+}
17 years, 5 months
JBoss Rich Faces SVN: r1750 - trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-20 12:14:08 -0400 (Fri, 20 Jul 2007)
New Revision: 1750
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java
Log:
fixed a typo
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java 2007-07-20 16:08:25 UTC (rev 1749)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java 2007-07-20 16:14:08 UTC (rev 1750)
@@ -57,7 +57,7 @@
final private static Pattern patternComponent = Pattern.compile(
regexComponent, Pattern.UNIX_LINES + Pattern.DOTALL);
- private final static String DEFAULT_BASE_CLASS = "org.ajax4jsf.renderkit.ase";
+ private final static String DEFAULT_BASE_CLASS = "org.ajax4jsf.renderkit.RendererBase";
private String packageName;
17 years, 5 months
JBoss Rich Faces SVN: r1749 - trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-20 12:08:25 -0400 (Fri, 20 Jul 2007)
New Revision: 1749
Modified:
trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
macrodefinitions improvements
Modified: trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-20 15:41:04 UTC (rev 1748)
+++ trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-20 16:08:25 UTC (rev 1749)
@@ -123,6 +123,10 @@
// dayListMarkup - day cell markup
// weekNumberMarkup - week number cell markup
// weekDayMarkup - week day cell markup
+ // headerMarkup
+ // footerMarkup
+ // headerOptionalMarkup - user defined header (optional)
+ // footerOptionalMarkup - user defined footer (optional)
// currentDate - date to show month (day not used) (mm/yyyy)
// selectedDate - selected date (mm/dd/yyyy)
@@ -132,9 +136,6 @@
// showWeekDaysBar - show WeekDays Bar [default value is true]
// showWeeksBar - show Weeks numbers bar [default value is true]
- // headerOptionalMarkup - user defined header (optional)
- // footerOptionalMarkup - user defined footer (optional)
-
// direction - [top-left, top-right, bottom-left, bottom-right, auto]
// jointPoint
// popup - true
@@ -147,8 +148,15 @@
if (!this.params.showWeekDaysBar) this.params.showWeekDaysBar = true;
if (!this.params.showWeeksBar) this.params.showWeeksBar = true;
if (this.params.monthLabels) this.params.monthLabels.push(this.params.monthLabels[0]);
- if (!this.params.datePattern) this.params.datePattern = "MMM d, y"
+ if (!this.params.datePattern) this.params.datePattern = "MMM d, y";
+ // markups initialization
+ if (!this.params.dayListMarkup) this.params.dayListMarkup = CalendarView.dayList;
+ if (!this.params.weekNumberMarkup) this.params.weekNumberMarkup = CalendarView.weekNumber;
+ if (!this.params.weekDayMarkup) this.params.weekDayMarkup = CalendarView.weekDay;
+ if (!this.params.headerMarkup) this.params.headerMarkup = CalendarView.header;
+ if (!this.params.footerMarkup) this.params.footerMarkup = CalendarView.footer;
+
this.currentDate = this.params.currentDate ? this.params.currentDate : new Date();
this.selectedDate = this.params.selectedDate;
@@ -174,8 +182,8 @@
var colspan = (this.params.showWeeksBar ? "8" : "7");
var htmlHeaderOptional = (this.params.headerOptionalMarkup) ? '<tr><td class="calendar_header" colspan="'+colspan+'" id="'+this.id+'HeaderOptional"></td></tr>' : '';
var htmlFooterOptional = (this.params.footerOptionalMarkup) ? '<tr><td class="calendar_footer" colspan="'+colspan+'" id="'+this.id+'FooterOptional"></td></tr>' : '';
- var htmlControlsHeader = (Calendar.header) ? '<tr><td colspan="'+colspan+'" id="'+this.id+'Header"></td></tr>' : '';
- var htmlControlsFooter = (Calendar.footer) ? '<tr><td colspan="'+colspan+'" id="'+this.id+'Footer"></td></tr>' : '';
+ var htmlControlsHeader = '<tr><td colspan="'+colspan+'" id="'+this.id+'Header"></td></tr>';
+ var htmlControlsFooter = '<tr><td colspan="'+colspan+'" id="'+this.id+'Footer"></td></tr>';
var htmlTextFooter = '</tbody></table>\n';
// days bar creation
@@ -551,12 +559,12 @@
},
renderHeader: function()
{
- this.renderMarkup(Calendar.header, this.id+"Header", this.calendarContext);
+ this.renderMarkup(this.params.headerMarkup, this.id+"Header", this.calendarContext);
},
renderFooter: function()
{
- this.renderMarkup(Calendar.footer, this.id+"Footer", this.calendarContext);
+ this.renderMarkup(this.params.footerMarkup, this.id+"Footer", this.calendarContext);
},
renderHeaderOptional: function()
@@ -640,64 +648,26 @@
});
-Calendar.getDayView = function(context) {
- return Richfaces.evalSimpleMacro("day", context);
-};
+CalendarView = {};
-Calendar.getWeekNumberView = function(context) {
- return Richfaces.evalSimpleMacro("weekNumber", context);
-};
-
-Calendar.getWeekDayView = function(context) {
- return Richfaces.evalSimpleMacro("weekDayLabel", context);
-};
-
-Calendar.getControl = function(context, attributes, text, functionName) {
+CalendarView.getControl = function(text, functionName) {
var attr = {
onclick: (functionName ? "Richfaces.invokeOnComponent('richfaces:calendar',this,'"+functionName+"');" : "")+"return false;",
- width: "100%"
};
- if (attributes) {
- Object.extend(attr, attributes);
- }
- return new E('div',attr,[new T(text)]);
+ return new E('span',attr,[new T(text)]);
};
-Calendar.nextYearControl = function(context) {
- //return Calendar.getControl(context, null, ">> "+context.calendar.getNextYear(), "nextYear");
- return Calendar.getControl(context, null, "��", "nextYear");
-};
-Calendar.previousYearControl = function(context) {
- //return Calendar.getControl(context, null, context.calendar.getPrevYear()+" <<", "prevYear");
- return Calendar.getControl(context, null, "��", "prevYear");
-};
-Calendar.nextMonthControl = function(context) {
- //return Calendar.getControl(context, null, "> "+context.calendar.getNextMonth(true), "nextMonth");
- return Calendar.getControl(context, null, "�", "nextMonth");
-};
-Calendar.previousMonthControl = function(context) {
- //return Calendar.getControl(context, null, context.calendar.getPrevMonth(true)+" <", "prevMonth");
- return Calendar.getControl(context, null, "�", "prevMonth");
-};
-Calendar.currentMonthControl = function(context) {
- var value =context.calendar.getCurrentDate().format("MMMM, y", context.monthLabels, context.monthLabelsShort);
- return value;
-};
-Calendar.todayControl = function(context) {
- return Calendar.getControl(context, null, "Today", "today");
-};
-Calendar.selectedDateControl = function(context) {
- var value = Calendar.getControl(context, null, context.calendar.getSelectedDateString(context.calendar.params.datePattern), "prevMonth");
- return value;
-};
-Calendar.helpControl = function(context)
-{
- return Calendar.getControl(context, null, "Help", "help");
-};
+CalendarView.nextYearControl = CalendarView.getControl(">>", "nextYear");
+CalendarView.previousYearControl = CalendarView.getControl("<<", "prevYear");
+CalendarView.nextMonthControl = CalendarView.getControl(">", "nextMonth");
+CalendarView.previousMonthControl = CalendarView.getControl("<", "prevMonth");
+CalendarView.currentMonthControl = function (context) { return context.calendar.getCurrentDate().format("MMMM, y", context.monthLabels, context.monthLabelsShort);};
+CalendarView.todayControl = CalendarView.getControl("Today", "today");
+CalendarView.selectedDateControl = function (context) { return CalendarView.getControl(context.calendar.getSelectedDateString(context.calendar.params.datePattern), "prevMonth");};
+CalendarView.helpControl = CalendarView.getControl("Help", "help");
-
-Calendar.header = [
+CalendarView.header = [
new E('table',{'border': '0', 'cellpadding': '0', 'cellspacing': '0', 'width': '100%'},
[
new E('tbody',{},
@@ -729,7 +699,7 @@
]
)];
-Calendar.footer = [
+CalendarView.footer = [
new E('table',{'border': '0', 'cellpadding': '0', 'cellspacing': '0', 'width': '100%'},
[
new E('tbody',{},
@@ -738,22 +708,25 @@
[
new E('td',{'class': 'calendar_toolfooter', 'style': 'white-space:nowrap'},
[
- new ET(function (context) { return Richfaces.evalMacro("Calendar.selectedDateControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("selectedDateControl", context)})
]),
new E('td',{'class': 'calendar_toolfooter calendar_btn', 'width': '100%'},
[
- new ET(function (context) { return Richfaces.evalMacro("Calendar.helpControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("helpControl", context)})
]),
new E('td',{'class': 'calendar_toolfooter calendar_btn', 'align': 'right'},
[
- new ET(function (context) { return Richfaces.evalMacro("Calendar.todayControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("todayControl", context)})
])
])
])
]
)];
-
+CalendarView.dayList = [new ET(function (context) { return context.day})];
+CalendarView.weekNumber = [new ET(function (context) { return context.weekNumber})];
+CalendarView.weekDay = [new ET(function (context) { return context.weekDayLabel})];
+
CalendarContext = Class.create();
Object.extend(CalendarContext.prototype, {
initialize: function(calendar) {
@@ -762,12 +735,12 @@
this.monthLabelsShort=calendar.params.monthLabelsShort;
},
- nextYearControl: Calendar.nextYearControl,
- previousYearControl: Calendar.previousYearControl,
- nextMonthControl: Calendar.nextMonthControl,
- previousMonthControl: Calendar.previousMonthControl,
- currentMonthControl: Calendar.currentMonthControl,
- todayControl: Calendar.todayControl,
- selectedDateControl: Calendar.selectedDateControl,
- helpControl: Calendar.helpControl,
+ nextYearControl: CalendarView.nextYearControl,
+ previousYearControl: CalendarView.previousYearControl,
+ nextMonthControl: CalendarView.nextMonthControl,
+ previousMonthControl: CalendarView.previousMonthControl,
+ currentMonthControl: CalendarView.currentMonthControl,
+ todayControl: CalendarView.todayControl,
+ selectedDateControl: CalendarView.selectedDateControl,
+ helpControl: CalendarView.helpControl
});
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1748 - trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-20 11:41:04 -0400 (Fri, 20 Jul 2007)
New Revision: 1748
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
Log:
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-20 15:31:45 UTC (rev 1747)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-20 15:41:04 UTC (rev 1748)
@@ -205,8 +205,6 @@
variables.setVariable("tableClass", tableClass);
variables.setVariable("tableStyle", tableStyle);
-
-
if(markerLocation.equals(uiMsg.MARKER_LOCATION_LEFT)){
renderMarkerFacet(uiMsg,markerFacet,context, writer, markerClass, markerStyle);
renderLabel(uiMsg, facesMsg, context, writer, labelClass,
17 years, 5 months
JBoss Rich Faces SVN: r1747 - trunk/sandbox/samples/rich-message-demo/src/main/webapp/css.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-20 11:31:45 -0400 (Fri, 20 Jul 2007)
New Revision: 1747
Modified:
trunk/sandbox/samples/rich-message-demo/src/main/webapp/css/app.css
Log:
Modified: trunk/sandbox/samples/rich-message-demo/src/main/webapp/css/app.css
===================================================================
--- trunk/sandbox/samples/rich-message-demo/src/main/webapp/css/app.css 2007-07-20 15:31:34 UTC (rev 1746)
+++ trunk/sandbox/samples/rich-message-demo/src/main/webapp/css/app.css 2007-07-20 15:31:45 UTC (rev 1747)
@@ -3,9 +3,23 @@
}
.rich-message-marker{
-
}
.rich-message{
+}
-}
\ No newline at end of file
+.errorLabel{
+ color: #FF0000;
+}
+
+.warnLabel{
+ color: #0000FF;
+}
+
+.infoLabel{
+ color: #00FF00;
+}
+
+.fatalLabel{
+ color: #FF1493;
+}
17 years, 5 months
JBoss Rich Faces SVN: r1746 - trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-20 11:31:34 -0400 (Fri, 20 Jul 2007)
New Revision: 1746
Modified:
trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml
Log:
Modified: trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml
===================================================================
--- trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml 2007-07-20 15:10:54 UTC (rev 1745)
+++ trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml 2007-07-20 15:31:34 UTC (rev 1746)
@@ -22,7 +22,19 @@
</h:selectOneMenu>
<h:commandButton value="submit"></h:commandButton>
- <r:message for="select" tooltip="true" showDetail="false" showSummary="true" markerLocation="right" passedLabel="No Error">
+ <r:message for="select"
+ tooltip="true"
+ showDetail="false"
+ showSummary="true"
+ markerLocation="left"
+ passedLabel="No Error"
+ errorLabelClass="errorLabel"
+ fatalLabelClass="warnLabel"
+ infoLabelClass="infoLabel"
+ warnLabelClass="fatalLabel"
+ >
+
+
<f:facet name="errorMarker">
<h:graphicImage url="/image/error.gif"/>
</f:facet>
17 years, 5 months