You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2006/10/13 00:10:35 UTC
svn commit: r463520 - in /incubator/xap/trunk:
WebContent/examples/widgets/index.html
WebContent/examples/widgets/tooltip.html
WebContent/examples/widgets/tooltip.xal
src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js
Author: jmargaris
Date: Thu Oct 12 17:10:33 2006
New Revision: 463520
URL: http://svn.apache.org/viewvc?view=rev&rev=463520
Log:
tooltips yay
Added:
incubator/xap/trunk/WebContent/examples/widgets/tooltip.html (with props)
incubator/xap/trunk/WebContent/examples/widgets/tooltip.xal (with props)
Modified:
incubator/xap/trunk/WebContent/examples/widgets/index.html
incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js
Modified: incubator/xap/trunk/WebContent/examples/widgets/index.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/index.html?view=diff&rev=463520&r1=463519&r2=463520
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/index.html (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/index.html Thu Oct 12 17:10:33 2006
@@ -19,6 +19,7 @@
<li><a href="table.html"><table></a></li>
<li><a href="menu.html"><menu></a></li>
<li><a href="popupMenu.html"><popupMenu></a></li>
+<li><a href="tooltip.html"><tooltip></a></li>
</ul>
<br>
Added: incubator/xap/trunk/WebContent/examples/widgets/tooltip.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/tooltip.html?view=auto&rev=463520
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/tooltip.html (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/tooltip.html Thu Oct 12 17:10:33 2006
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Button</title>
+
+ <style type="text/css">
+ <!--
+ @import url(../../css/xapDefault.css);
+ -->
+ </style>
+
+ <!-- Keep dojo from trying to scan this whole page for dojoType'd tags: -->
+ <script type="text/javascript">
+ djConfig = {
+ parseWidgets: false
+ };
+ </script>
+
+ <script language="JavaScript" type="text/javascript" src="../../xapcore.js"></script>
+ <script language="JavaScript" type="text/javascript" src="AttributeTester.js"></script>
+
+ </head>
+
+ <body onload="Xap.createAllPredefinedSessions();">
+ <div xapId="ButtonExample" xapSrc="tooltip.xal" xapToolkit="dojo" xapContext="../../"></div>
+</body>
+</html>
Propchange: incubator/xap/trunk/WebContent/examples/widgets/tooltip.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/xap/trunk/WebContent/examples/widgets/tooltip.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/tooltip.xal?view=auto&rev=463520
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/tooltip.xal (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/tooltip.xal Thu Oct 12 17:10:33 2006
@@ -0,0 +1,26 @@
+<xal xmlns="http://www.openxal.org/xal" xmlns:xal="http://www.openxal.org/xal">
+
+
+ <mco:mco
+ xmlns:mco="http://www.openxal.org/mco"
+ id="attributeSetter"
+ src="AttributeTester"
+ />
+
+
+
+ <xm:modifications xmlns:xm="http://www.openxal.org/xmodify">
+ <xm:append select="/xal">
+ <xal:verticalPanel>
+ <xal:button text="I have a tooltip" tooltip="A button"/>
+ <xal:checkBox text="So do I" tooltip="Yes/No?"/>
+
+ <!-- TODO if you have a tooltip on the container and
+ child they both show up -->
+ <xal:verticalPanel tooltip="A weird error case" width="300px" height="300px" backgroundColor="red">
+ <xal:button text="I have a tooltip" tooltip="A button"/>
+ </xal:verticalPanel>
+ </xal:verticalPanel>
+ </xm:append>
+ </xm:modifications>
+</xal>
Propchange: incubator/xap/trunk/WebContent/examples/widgets/tooltip.xal
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js?view=diff&rev=463520&r1=463519&r2=463520
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js Thu Oct 12 17:10:33 2006
@@ -21,6 +21,7 @@
Xap.require("xap.util.Exception");
Xap.require("xap.util.LogFactory") ;
Xap.require("xap.taghandling.AbstractTagImpl") ;
+Xap.require("dojo.widget.Tooltip") ;
/**
* @fileoverview
@@ -387,7 +388,7 @@
"borderWidth","borderColor","borderStyle","margin",
"padding","color","textDecoration","fontFamily",
"fontStyle","fontWeight", "fontSize", "textAlign",
- "popup"];
+ "popup","tooltip"];
}
xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.getAllowedAttributes = function(){
@@ -558,7 +559,7 @@
}
xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.setPopupAttribute = function(popupId){
- //TODO fire event
+ //TODO fire onContextMenu event and let them consume it?
//TODO if they have OLD popup need to unregister it!!!
popupId = popupId.substring(1);
var popupElement = this.getUiDocument().getElementById(popupId);
@@ -569,5 +570,23 @@
if (handler && handler instanceof xap.bridges.dojo.MenuBridge){
handler.bindDomNode(this.getRootDomNode());
}
+}
+
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.setTooltipAttribute = function( text ){
+ //TODO should this accept a popup reference like #myTip ?
+ //TODO if they have OLD tooltip need to unregister it!!!
+
+ //for some reason you have to do this sort of thing for it to appear properly,
+ //not sure why, but same as dojo widget bridge...
+ var tmp = document.createElement('div');
+ var tmp2 = document.createElement('div');
+ tmp2.appendChild(tmp);
+ var tooltip = dojo.widget.createWidget('tooltip',{caption:text},tmp);
+
+ //we have to set this connection up ourselves because it was not available
+ //in postCreate()
+ tooltip.connectNode = this.getRootDomNode();
+ dojo.event.connect(tooltip.connectNode, "onmouseover", tooltip, "onMouseOver");
}