Source Code Cross Referenced for ToolTip.java in  » Ajax » gwtext-2.01 » com » gwtext » client » widgets » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » gwtext 2.01 » com.gwtext.client.widgets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * GWT-Ext Widget Library
003:         * Copyright(c) 2007-2008, GWT-Ext.
004:         * licensing@gwt-ext.com
005:         * 
006:         * http://www.gwt-ext.com/license
007:         */
008:        package com.gwtext.client.widgets;
009:
010:        import com.google.gwt.core.client.JavaScriptObject;
011:        import com.google.gwt.user.client.Element;
012:        import com.gwtext.client.core.Function;
013:
014:        /**
015:         * A standard tooltip implementation for providing additional information when hovering over a target element.
016:         */
017:        public class ToolTip extends Tip {
018:
019:            public ToolTip() {
020:            }
021:
022:            public ToolTip(String html) {
023:                super (html);
024:            }
025:
026:            public ToolTip(JavaScriptObject jsObj) {
027:                super (jsObj);
028:            }
029:
030:            protected native JavaScriptObject create(JavaScriptObject config) /*-{
031:            	return new $wnd.Ext.ToolTip(config);
032:               }-*/;
033:
034:            /**
035:             * True to automatically hide the tooltip after the mouse exits the target element or after the dismissDelay has
036:             * expired if set (defaults to true). If closable = true a close tool button will be rendered into the tooltip header.
037:             *
038:             * @param autoHide true to auto hide
039:             */
040:            public void setAutoHide(boolean autoHide) {
041:                setAttribute("autoHide", autoHide, true, true);
042:            }
043:
044:            /**
045:             * Delay in milliseconds before the tooltip automatically hides (defaults to 5000). To disable automatic hiding,
046:             * set dismissDelay = 0.
047:             *
048:             * @param dismissDelay the dismiss delay
049:             */
050:            public void setDismissDelay(int dismissDelay) {
051:                setAttribute("dismissDelay", dismissDelay, true, true);
052:            }
053:
054:            /**
055:             * Delay in milliseconds after the mouse exits the target element but before the tooltip actually hides (defaults to 200).
056:             * Set to 0 for the tooltip to hide immediately.
057:             *
058:             * @param hideDelay the hide delay
059:             */
060:            public void setHideDelay(int hideDelay) {
061:                setAttribute("hideDelay", hideDelay, true, true);
062:            }
063:
064:            /**
065:             * An XY offset from the mouse position where the tooltip should be shown.
066:             *
067:             * @param x the X offset
068:             * @param y the Y offset
069:             */
070:            public void setMouseOffset(int x, int y) {
071:                int[] mouseOffset = new int[] { x, y };
072:                setAttribute("mouseOffset", mouseOffset, true, true);
073:            }
074:
075:            /**
076:             * Delay in milliseconds before the tooltip displays after the mouse enters the target element (defaults to 500).
077:             *
078:             * @param showDelay the show delay
079:             */
080:            public void setShowDelay(int showDelay) {
081:                setAttribute("showDelay", showDelay, true, true);
082:            }
083:
084:            /**
085:             * True to have the tooltip follow the mouse as it moves over the target element (defaults to false).
086:             *
087:             * @param trackMouse true to track mouse
088:             */
089:            public void setTrackMouse(boolean trackMouse) {
090:                setAttribute("trackMouse", trackMouse, true, true);
091:            }
092:
093:            /**
094:             * Hides this tooltip if visible.
095:             */
096:            public native void hide() /*-{
097:                   var tooltip  = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
098:                   tooltip.hide();
099:               }-*/;
100:
101:            /**
102:             * Shows this tooltip at the current event target XY position.
103:             */
104:            public native void show() /*-{
105:                   var tooltip  = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
106:                   tooltip.show();
107:               }-*/;
108:
109:            /**
110:             * Applies the tooltip to the specified target.
111:             *
112:             * @param target the target element
113:             */
114:            public void applyTo(Element target) {
115:                setAttribute("target", target, true);
116:                getOrCreateJsObj();
117:            }
118:
119:            /**
120:             * Applies the tooltip to the specified target. Note that the element with the specified ID must be
121:             * rendered to the DOM before this call is made.
122:             *
123:             * @param elementID the target element ID
124:             */
125:            public void applyTo(String elementID) {
126:                setAttribute("target", elementID, true);
127:                getOrCreateJsObj();
128:            }
129:
130:            /**
131:             * Applies the tooltip to the specified target.
132:             *
133:             * @param component the component to apply the tooltip to
134:             */
135:            public void applyTo(final Component component) {
136:                if (component.isRendered()) {
137:                    setAttribute("target", component.getElement(), true);
138:                    create(config);
139:                } else {
140:                    component.addListener("render", new Function() {
141:                        public void execute() {
142:                            applyTo(component);
143:                        }
144:                    });
145:                }
146:            }
147:
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.