Author: dbiatenia
Date: 2007-06-21 12:56:03 -0400 (Thu, 21 Jun 2007)
New Revision: 1265
Added:
trunk/sandbox/tooltip/
trunk/sandbox/tooltip/pom.xml
trunk/sandbox/tooltip/src/
trunk/sandbox/tooltip/src/main/
trunk/sandbox/tooltip/src/main/config/
trunk/sandbox/tooltip/src/main/config/component/
trunk/sandbox/tooltip/src/main/config/component/README
trunk/sandbox/tooltip/src/main/config/component/toolTip.xml
trunk/sandbox/tooltip/src/main/java/
trunk/sandbox/tooltip/src/main/java/META-INF/
trunk/sandbox/tooltip/src/main/java/META-INF/MANIFEST.MF
trunk/sandbox/tooltip/src/main/java/org/
trunk/sandbox/tooltip/src/main/java/org/richfaces/
trunk/sandbox/tooltip/src/main/java/org/richfaces/component/
trunk/sandbox/tooltip/src/main/java/org/richfaces/component/README
trunk/sandbox/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/AbstractToolTipCornerImage.java
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomLeftToolTipCornerImage.java
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomRightToolTipCornerImage.java
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopLeftToolTipCornerImage.java
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopRightToolTipCornerImage.java
trunk/sandbox/tooltip/src/main/resources/
trunk/sandbox/tooltip/src/main/resources/org/
trunk/sandbox/tooltip/src/main/resources/org/richfaces/
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
trunk/sandbox/tooltip/src/main/templates/
trunk/sandbox/tooltip/src/main/templates/README
trunk/sandbox/tooltip/src/main/templates/org/
trunk/sandbox/tooltip/src/main/templates/org/richfaces/
trunk/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
trunk/sandbox/tooltip/src/test/
trunk/sandbox/tooltip/src/test/java/
trunk/sandbox/tooltip/src/test/java/org/
trunk/sandbox/tooltip/src/test/java/org/richfaces/
trunk/sandbox/tooltip/src/test/java/org/richfaces/component/
trunk/sandbox/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
Added: trunk/sandbox/tooltip/pom.xml
===================================================================
--- trunk/sandbox/tooltip/pom.xml (rev 0)
+++ trunk/sandbox/tooltip/pom.xml 2007-06-21 16:56:03 UTC (rev 1265)
@@ -0,0 +1,43 @@
+<?xml version="1.0"?><project>
+ <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.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</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
Property changes on: trunk/sandbox/tooltip/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/sandbox/tooltip/src/main/config/component/README
===================================================================
Added: trunk/sandbox/tooltip/src/main/config/component/toolTip.xml
===================================================================
--- trunk/sandbox/tooltip/src/main/config/component/toolTip.xml
(rev 0)
+++ trunk/sandbox/tooltip/src/main/config/component/toolTip.xml 2007-06-21 16:56:03 UTC
(rev 1265)
@@ -0,0 +1,137 @@
+<?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" >
+<components>
+ <component>
+ <name>org.richfaces.component.ToolTip</name>
+ <family>org.richfaces.component.ToolTip</family>
+ <description>Defines the menu on the page and the set of the child elements
properties in layout.</description>
+ <superclass>org.richfaces.component.UIToolTip</superclass>
+ <classname>org.richfaces.component.html.HtmlToolTip</classname>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.renderkit.html.ToolTipRenderer</name>
+ <template>org/richfaces/htmltooltip.jspx</template>
+ </renderer>
+ <tag>
+ <name>toolTip</name>
+ <classname>org.richfaces.taglib.ToolTipTag</classname>
+ <superclass>org.ajax4jsf.framework.taglib.HtmlComponentTagBase</superclass>
+ </tag>
+
+
+ <property>
+ <name>onactivate</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>ondeactivate</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["onmouseover"]]></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["auto"]]></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>0</defaultvalue>
+ </property>
+ <property>
+ <name>verticalOffset</name>
+ <classname>int</classname>
+ <description>Sets the vertical offset between popup list and mouse
pointer</description>
+ <defaultvalue>0</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>
+</components>
\ No newline at end of file
Property changes on: trunk/sandbox/tooltip/src/main/config/component/toolTip.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/sandbox/tooltip/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/tooltip/src/main/java/META-INF/MANIFEST.MF (rev
0)
+++ trunk/sandbox/tooltip/src/main/java/META-INF/MANIFEST.MF 2007-06-21 16:56:03 UTC (rev
1265)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/sandbox/tooltip/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/sandbox/tooltip/src/main/java/org/richfaces/component/README
===================================================================
Added: trunk/sandbox/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
===================================================================
--- trunk/sandbox/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
(rev 0)
+++ trunk/sandbox/tooltip/src/main/java/org/richfaces/component/UIToolTip.java 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,82 @@
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+public abstract class UIToolTip extends UIComponentBase{
+
+ 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 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 getOnactivate();
+
+ public abstract void setOnactivate(String onactivate);
+
+ public abstract String getOnshow();
+
+ public abstract void setOnshow(String onshow);
+
+ public abstract String getOndeactivate();
+
+ public abstract void setOndeactivate(String ondeactivate);
+
+ 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);
+
+}
Property changes on:
trunk/sandbox/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
(rev 0)
+++
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,162 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.framework.renderer.AjaxComponentRendererBase;
+import org.ajax4jsf.framework.skin.Skin;
+import org.richfaces.component.UIToolTip;
+import org.richfaces.renderkit.html.image.cornerimages.BottomLeftToolTipCornerImage;
+import org.richfaces.renderkit.html.image.cornerimages.BottomRightToolTipCornerImage;
+import org.richfaces.renderkit.html.image.cornerimages.TopLeftToolTipCornerImage;
+import org.richfaces.renderkit.html.image.cornerimages.TopRightToolTipCornerImage;
+
+public class ToolTipRenderer extends AjaxComponentRendererBase{
+
+
+ protected Class getComponentClass() {
+ return org.richfaces.component.UIToolTip.class;
+ }
+
+ public void encodeChildren(FacesContext context, UIComponent component)
+ throws IOException {
+ // TODO Auto-generated method stub
+ super.encodeChildren(context, component);
+ }
+
+ /**
+ *
+ * @param context
+ * @param component 'tl'-top left, 'tr'-top right, 'bl'-bottom
left, 'br'-bottom right
+ * @param position
+ * @throws IOException
+ */
+ public void insertImage(FacesContext context, UIComponent component, Object position)
throws IOException{
+ //if(position == null) throw new IllegalArgumentException("Parameter passed is
invalid, use \"0 - 3\"");
+ String posStr = (String)position;
+ drawImageElement(context, component, posStr);
+ }
+
+
+ /**
+ *
+ * @param writer
+ * @param component
+ * @param position 0-tl, 1-tr, 2-bl, 3-br
+ * @throws IOException
+ */
+ private void drawImageElement(FacesContext context, UIComponent component, String
position) throws IOException{
+ String imageSrc = getImageSrc(context, component, position);
+ ResponseWriter writer = context.getResponseWriter();
+ int h = 15; //width(context);
+ writer.startElement("img", component);
+ writer.writeAttribute("src", imageSrc, null);
+ writer.writeAttribute("alt", "", null);
+ writer.writeAttribute("vspace", "0", null);
+ writer.writeAttribute("hspace", "0", null);
+ writer.writeAttribute("class", "corner", null);
+ writer.writeAttribute("style", "display:block; ", null);
+ writer.writeAttribute("width", String.valueOf(h), null);
+ writer.writeAttribute("height", String.valueOf(h), null);
+ writer.endElement("img");
+ }
+
+
+ protected String getImageSrc(FacesContext context, UIComponent component, String
position){
+ String color = getBgColor(context, component);
+ String imageSource = null;
+ if(position == null || position.equals("tl")) {
+ imageSource = getResource(TopLeftToolTipCornerImage.class.getName()).getUri(context,
color);
+ } else if(position.equals("tr")){
+ imageSource = getResource(TopRightToolTipCornerImage.class.getName()).getUri(context,
color);
+ } else if (position.equals("bl")){
+ imageSource =
getResource(BottomLeftToolTipCornerImage.class.getName()).getUri(context, color);
+ } else if (position.equals("br")){
+ imageSource =
getResource(BottomRightToolTipCornerImage.class.getName()).getUri(context, color);
+ }
+
+ return imageSource;
+ }
+
+ 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());
+ }
+ }
+
+ protected String getTopRightDivStyle(FacesContext context, UIComponent component){
+ String trImgSrc = getImageSrc(context, component, "tr");
+ return "background: url(" + trImgSrc + ") no-repeat top
right;";
+ }
+
+ protected String getBottomRightDivStyle(FacesContext context, UIComponent component){
+ String brImgSrc = getImageSrc(context, component, "br");
+ return "background: url(" + brImgSrc + ") no-repeat top
right;";
+ }
+
+ protected String getMainDivStyle(FacesContext context, UIComponent component){
+ String style = "width: 250px;background-color:" + getBgColor(context,
component) + ";color: " + getColor(context, component) + ";";
+ return style;
+ }
+
+ protected String getTRImageSrc(FacesContext context, UIComponent component){
+ return getImageSrc(context, component, "tr");
+ }
+
+ protected String getBRImageSrc(FacesContext context, UIComponent component){
+ return getImageSrc(context, component, "br");
+ }
+
+ 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();
+ //
+ script.append("var tooltip1 = ").
+
+ append("new ToolTip(").append(quot).append("tooltip" +
toolTip.getClientId(context).toString()).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(");\n");
+ ret.append(script.toString());
+
+ //
+ //ret.append("function toolTipAttach(){tooltip1.attachParentEvents() }\n");
+
+ ret.append("\n</script>");
+
+ ResponseWriter writer = context.getResponseWriter();
+ writer.write(ret.toString());
+
+ }
+
+}
+
Property changes on:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/AbstractToolTipCornerImage.java
===================================================================
---
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/AbstractToolTipCornerImage.java
(rev 0)
+++
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/AbstractToolTipCornerImage.java 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,173 @@
+package org.richfaces.renderkit.html.image;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Arc2D;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.GeneralPath;
+import java.awt.image.AffineTransformOp;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+
+import javax.faces.context.FacesContext;
+import javax.imageio.ImageIO;
+
+import org.ajax4jsf.framework.resource.GifRenderer;
+import org.ajax4jsf.framework.resource.InternetResourceBuilder;
+import org.ajax4jsf.framework.resource.Java2Dresource;
+import org.ajax4jsf.framework.resource.JpegRenderer;
+import org.ajax4jsf.framework.resource.ResourceContext;
+import org.ajax4jsf.framework.skin.Skin;
+import org.ajax4jsf.framework.skin.SkinFactory;
+import org.ajax4jsf.framework.util.HtmlColor;
+import org.ajax4jsf.framework.util.HtmlDimensions;
+
+public abstract class AbstractToolTipCornerImage extends Java2Dresource{
+
+ public AbstractToolTipCornerImage() {
+ setRenderer(new GifRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
+
+ public Dimension getDimensions(FacesContext facesContext, Object data) {
+ return calculateDimensions(getDataToStore(facesContext, data));
+ }
+
+ protected Dimension getDimensions(ResourceContext resourceContext) {
+ return calculateDimensions(restoreData(resourceContext));
+ }
+
+ protected Dimension calculateDimensions(Object data){
+ Object [] stored = (Object []) data;
+ int h = ((Integer) stored[0]).intValue();
+ return new Dimension(h,h);
+ }
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ Object[] stored = new Object[5];
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+
+ stored[0] = new Integer(HtmlDimensions.decode("15px").intValue());
+
+ Color col = null;
+
+ if (data!=null){
+ col = HtmlColor.decode(data.toString());
+ } else {
+ col = HtmlColor.decode(skin.getParameter(context,
"headerBackgroundColor").toString());
+ }
+ stored[1]= col;
+ return stored;
+ }
+
+ public boolean isCacheable() {
+ return true;
+ }
+/*
+ protected void paint(ResourceContext context, Graphics2D graphics2d) {
+
+ BufferedImage bufferedImage = new BufferedImage(128, 128,
BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g2d = bufferedImage.createGraphics();
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
+ g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
+
+ Dimension dimension = getDimensions(context);
+ GeneralPath path = new GeneralPath();
+ g2d.setStroke(new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER));
+ g2d.translate(28,28);
+ Object [] data = (Object[]) restoreData(context);
+ Color col = (Color)data[1];
+
+ g2d.setColor(col);
+
+ path.moveTo(1,1);
+ path.lineTo(17,1);
+ path.lineTo(47,31);
+ path.lineTo(17,61);
+ path.lineTo(1,61);
+ path.lineTo(31,31);
+ path.closePath();
+ g2d.fill(path);
+
+ g2d.translate(24,0);
+
+ g2d.fill(path);
+
+ AffineTransform transform = AffineTransform.getScaleInstance(dimension.getHeight()/128,
dimension.getHeight()/128);
+ AffineTransformOp transformOp = new AffineTransformOp(transform,
AffineTransformOp.TYPE_BILINEAR);
+
+ graphics2d.drawImage(bufferedImage,transformOp, 0, 0);
+
+ g2d.dispose();
+ try {
+ ImageIO.write(bufferedImage, "gif", new
File("yourImage.gif"));
+ } catch(IOException e) {
+ System.out.println("write error: " + e.getMessage());
+ }
+
+ }
+*/
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+
+ // Dimension dimension = getDimensions(context);
+ Object [] data = (Object[]) restoreData(context);
+
+ Color col = (Color)data[1];
+ g2d.setColor(col);
+
+ //Color col = Color.BLUE;
+ //dimension.
+ //int dim = (int) Math.round(15);
+/*
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_DISABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
+*/
+// g2d.setBackground(Color.GREEN);
+
+
+// active
+
+
+
+
+ /*
+ AffineTransform transform = AffineTransform.getScaleInstance(dimension.getHeight()/128,
dimension.getHeight()/128);
+ AffineTransformOp transformOp = new AffineTransformOp(transform,
AffineTransformOp.TYPE_BILINEAR);
+ */
+ drawImage(g2d);
+ }
+
+ protected abstract void drawImage(Graphics2D g2d);
+
+/*
+ public static void main(String[] args){
+ ToolTipCornerImage im = new ToolTipCornerImage();
+ BufferedImage bufferedImage = new BufferedImage(15, 15, BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g2d = bufferedImage.createGraphics();
+ im.paint(null, g2d);
+ try {
+ ImageIO.write(bufferedImage, "gif", new
File("yourImage.jpg"));
+ } catch(IOException e) {
+ System.out.println("write error: " + e.getMessage());
+ }
+ }
+*/
+}
Property changes on:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/AbstractToolTipCornerImage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomLeftToolTipCornerImage.java
===================================================================
---
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomLeftToolTipCornerImage.java
(rev 0)
+++
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomLeftToolTipCornerImage.java 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,39 @@
+package org.richfaces.renderkit.html.image.cornerimages;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Arc2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+import org.richfaces.renderkit.html.image.AbstractToolTipCornerImage;
+
+public class BottomLeftToolTipCornerImage extends AbstractToolTipCornerImage{
+
+ protected void drawImage(Graphics2D g2d) {
+ // TODO Auto-generated method stub
+ //g2d.setBackground(Color.YELLOW);
+ //g2d.setColor(Color.GREEN);
+ Arc2D arc = new Arc2D.Float();
+ arc.setArc(0, -15, 30, 30, 180, 90, Arc2D.PIE );
+ g2d.fill(arc);
+
+ g2d.dispose();
+ }
+
+ public static void main(String[] args){
+ BottomLeftToolTipCornerImage im = new BottomLeftToolTipCornerImage();
+ BufferedImage bufferedImage = new BufferedImage(15, 15, BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g2d = bufferedImage.createGraphics();
+ im.paint(null, g2d);
+ try {
+ ImageIO.write(bufferedImage, "gif", new File("bl.gif"));
+ } catch(IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
Property changes on:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomLeftToolTipCornerImage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomRightToolTipCornerImage.java
===================================================================
---
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomRightToolTipCornerImage.java
(rev 0)
+++
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomRightToolTipCornerImage.java 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,38 @@
+package org.richfaces.renderkit.html.image.cornerimages;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Arc2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+import org.richfaces.renderkit.html.image.AbstractToolTipCornerImage;
+
+public class BottomRightToolTipCornerImage extends AbstractToolTipCornerImage{
+
+ protected void drawImage(Graphics2D g2d) {
+ //g2d.setBackground(Color.YELLOW);
+ //g2d.setColor(Color.GREEN);
+ Arc2D arc = new Arc2D.Float();
+ arc.setArc(-15, -15, 30, 30, 270, 90, Arc2D.PIE );
+ g2d.fill(arc);
+
+ g2d.dispose();
+ }
+
+ public static void main(String[] args){
+ BottomRightToolTipCornerImage im = new BottomRightToolTipCornerImage();
+ BufferedImage bufferedImage = new BufferedImage(15, 15, BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g2d = bufferedImage.createGraphics();
+ im.paint(null, g2d);
+ try {
+ ImageIO.write(bufferedImage, "gif", new File("br.gif"));
+ } catch(IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
Property changes on:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/BottomRightToolTipCornerImage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopLeftToolTipCornerImage.java
===================================================================
---
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopLeftToolTipCornerImage.java
(rev 0)
+++
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopLeftToolTipCornerImage.java 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,40 @@
+package org.richfaces.renderkit.html.image.cornerimages;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Arc2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+import org.richfaces.renderkit.html.image.AbstractToolTipCornerImage;
+
+public class TopLeftToolTipCornerImage extends AbstractToolTipCornerImage{
+
+
+ protected void drawImage(Graphics2D g2d) {
+ // TODO Auto-generated method stub
+ //g2d.setColor(Color.GREEN);
+ Arc2D arc = new Arc2D.Float();
+ arc.setArc(0, 0, 30, 30, 90, 90, Arc2D.PIE );
+ g2d.fill(arc);
+
+ g2d.dispose();
+
+ }
+
+ public static void main(String[] args){
+ TopLeftToolTipCornerImage im = new TopLeftToolTipCornerImage();
+ BufferedImage bufferedImage = new BufferedImage(15, 15, BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g2d = bufferedImage.createGraphics();
+ im.paint(null, g2d);
+ try {
+ ImageIO.write(bufferedImage, "gif", new File("tl.gif"));
+ } catch(IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
Property changes on:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopLeftToolTipCornerImage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopRightToolTipCornerImage.java
===================================================================
---
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopRightToolTipCornerImage.java
(rev 0)
+++
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopRightToolTipCornerImage.java 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,24 @@
+package org.richfaces.renderkit.html.image.cornerimages;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Arc2D;
+
+import org.richfaces.renderkit.html.image.AbstractToolTipCornerImage;
+
+
+public class TopRightToolTipCornerImage extends AbstractToolTipCornerImage{
+
+
+ protected void drawImage(Graphics2D g2d) {
+ // TODO Auto-generated method stub
+ //g2d.setColor(Color.GREEN);
+ Arc2D arc = new Arc2D.Float();
+ arc.setArc(-15, 0, 30, 30, 0, 90, Arc2D.PIE );
+ g2d.fill(arc);
+
+ g2d.dispose();
+
+ }
+
+}
Property changes on:
trunk/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/cornerimages/TopRightToolTipCornerImage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
===================================================================
---
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
(rev 0)
+++
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,16 @@
+<?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">
+
+<f:verbatim>
+img.corner {
+ width: 15px;
+ height: 15px;
+ border: none;
+ display: block !important;
+}
+
+</f:verbatim>
+</f:template>
Added:
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
---
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
(rev 0)
+++
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,171 @@
+// 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;
+
+// If NS -- that is, !IE -- then set up for mouse capture
+if (!IE) document.captureEvents(Event.MOUSEMOVE)
+
+// Temporary variables to hold mouse x-y pos.s
+var cursorX = 0;
+var cursorY = 0;
+
+// Main function to retrieve mouse x-y pos.s
+
+function getMouseXY(e) {
+if (IE) { // grab the x-y pos.s if browser is IE
+cursorX = event.clientX + document.body.scrollLeft;
+cursorY = event.clientY + document.body.scrollTop;
+} else { // grab the x-y pos.s if browser is NS
+cursorX = e.pageX;
+cursorY = e.pageY;
+}
+// catch possible negative values in NS4
+if (cursorX < 0){cursorX = 0;}
+if (cursorY < 0){cursorY = 0;}
+// show the position values in the form named Show
+// in the text fields named MouseX and MouseY
+$('mouseX').value = cursorX;
+$('mouseY').value = cursorY;
+return true;
+}
+
+// Set-up to use getMouseXY function onMouseMove
+document.onmousemove = getMouseXY;
+
+
+ToolTip = Class.create();
+
+ToolTip.prototype = {
+ initialize:function(id, parentId, mode, disabled, direction, followMouse,
horizontalOffset, verticalOffset){
+ 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.toolTip = $(id);
+
+ this.toolTipW = this.toolTip.clientWidth;
+ this.toolTipH = this.toolTip.clientHeight;
+ this.toolTip.style.display = "none";
+ this.parentAttached = false;
+
+ //document.body.attachEvent("load", this.attachOnLoadEvents);
+ //document.body.onload = this.attachOnLoadEvents.bindAsEventListener(this);
+
+ Event.observe(document.getElementsByTagName("body")[0],
"mousemove", this.attachOnLoadEvents.bindAsEventListener(this), true);
+ },
+ attachOnLoadEvents: function(){
+ //alert('onload');
+ if(!this.parentAttached){
+ this.parent = $(this.parentId);
+ if(this.parent != null && !this.disabled){
+ this.attachParentEvents();
+ this.parentAttached = true;
+ }
+ }
+ },
+ attachParentEvents: function(){
+ if(this.followMouse){
+ Event.observe(this.parent, "mousemove",
this.doShow.bindAsEventListener(this), false);
+ } else {
+ Event.observe(this.parent, "mouseover",
this.doShow.bindAsEventListener(this), false);
+ }
+
+ Event.observe(this.parent, "mouseout", this.doHide.bindAsEventListener(this),
false);
+ },
+ doShow: function(){
+
+ this.setToolTipPosition();
+ this.toolTip.style.display = "block";
+
+ },
+
+ doHide: function(){
+ this.toolTip.style.display = "none";
+ },
+
+ doEnable: function(){
+ this.disabled = false;
+ },
+ doDisable: function(){
+ this.disabled = true;
+ },
+
+ setToolTipPosition: function(){
+ var windowDim = this.windowSize();
+
+ if(this.direction == "top-left"){
+ if(cursorY - this.verticalOffset - this.toolTip.clientHeight < 0){
+ 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 == "bottom-left"){
+ 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.toolTopW;
+ }
+ } else if(this.direction == "top-right"){
+ 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
+ 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];
+ }
+
+
+ //
+
+}
\ No newline at end of file
Property changes on:
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/sandbox/tooltip/src/main/templates/README
===================================================================
Added: trunk/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
--- trunk/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
(rev 0)
+++ trunk/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-06-21
16:56:03 UTC (rev 1265)
@@ -0,0 +1,122 @@
+<?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>
+
+<!--
+ <style type="text/css">
+ .roundtop {
+ background: url(#{this:getTRImageSrc(context, component)}) no-repeat top right;
+ }
+
+ .roundbottom {
+ background: url(#{this:getBRImageSrc(context, component)}) no-repeat top right;
+ }
+ </style>
+
+
+
+
+ <div style="#{this:getMainDivStyle(context, component)}">
+ <div class="roundtop">
+ <f:call name="insertImage">
+ <f:parameter value="tl"/>
+ </f:call>
+ </div>
+ <p style="margin: 0 10px;">
+ <f:call name="insertValue"/>
+ <vcp:body>
+ <f:call name="renderChildren"/>
+ </vcp:body>
+ <f:clientid var="clientId"/>
+
+ </p>
+ <div class="roundbottom">
+ <f:call name="insertImage">
+ <f:parameter value="bl"/>
+ </f:call>
+ </div>
+</div>
+
+
+ <hr/>
+-->
+
+ <f:clientid var="clientId"/>
+
+ <div id="tooltip#{clientId}" style="position: absolute; display :
none;">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="15px">
+ <f:call name="insertImage">
+ <f:parameter value="tl"/>
+ </f:call>
+ </td>
+ <td bgcolor="#{this:getBgColor(context, component)}"><f:call
name="insertImage">
+ <f:parameter value="br"/>
+ </f:call></td>
+ <td width="15px">
+ <f:call name="insertImage">
+ <f:parameter value="tr"/>
+ </f:call>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#{this:getBgColor(context, component)}"></td>
+ <td bgcolor="#{this:getBgColor(context, component)}">
+ <jsp:scriptlet>
+ <![CDATA[if(component.getFacet("defaultContent")!=null &&
component.getFacet("defaultContent").isRendered()) {]]>
+ </jsp:scriptlet>
+ <span class="dr-rich-tool-tip rich-tool-tip">
+ <u:insertFacet name="defaultContent" />
+ </span>
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ <span class="dr-rich-tool-tip
rich-tool-tip">#{component.attributes['value']}</span>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+
+ </td>
+ <td bgcolor="#{this:getBgColor(context, component)}"></td>
+ </tr>
+ <tr>
+ <td>
+ <f:call name="insertImage">
+ <f:parameter value="bl"/>
+ </f:call>
+ </td>
+ <td bgcolor="#{this:getBgColor(context, component)}"><f:call
name="insertImage">
+ <f:parameter value="br"/>
+ </f:call></td>
+ <td>
+ <f:call name="insertImage">
+ <f:parameter value="br"/>
+ </f:call>
+ </td>
+ </tr>
+
+ </table>
+ <f:call name="insertScript"/>
+ </div>
+ <!-- f:call name="utils.encodeEndFormIfNessesary"/-->
+</f:root>
Added: trunk/sandbox/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java
(rev 0)
+++
trunk/sandbox/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-06-21
16:56:03 UTC (rev 1265)
@@ -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 );
+ }
+}
Property changes on:
trunk/sandbox/tooltip/src/test/java/org/richfaces/component/JSFComponentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native