Source Code Cross Referenced for TriggerField.java in  » Ajax » gwtext-2.01 » com » gwtext » client » widgets » form » 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.form 
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:
009:        package com.gwtext.client.widgets.form;
010:
011:        import com.google.gwt.core.client.JavaScriptObject;
012:        import com.google.gwt.user.client.Element;
013:        import com.gwtext.client.core.EventObject;
014:
015:        //http://extjs.com/forum/showthread.php?t=3613&highlight=triggerfield
016:        /**
017:         * Provides a convenient wrapper for TextFields that adds a clickable trigger button (looks like a combobox by default).
018:         * The trigger has no default action, so you mustimplement the trigger click handler by overriding {@link #onTriggerClick(com.gwtext.client.core.EventObject)}.
019:         * You can create a TriggerField directly, as it renders exactly like a combobox for which you can provide a custom implementation.
020:         *
021:         */
022:        public abstract class TriggerField extends TextField {
023:
024:            /**
025:             * Construct a new TriggerField.
026:             */
027:            public TriggerField() {
028:            }
029:
030:            public TriggerField(JavaScriptObject jsObj) {
031:                super (jsObj);
032:            }
033:
034:            protected void initComponent() {
035:                super .initComponent();
036:                setup(this , getJsObj());
037:            }
038:
039:            protected native Element getElement(JavaScriptObject jsObj) /*-{
040:                   //for trigger fields, we want the text area as well as the trigger button to be treated as the element
041:                   //unit
042:                   var extEl = jsObj.wrap;
043:                   if(extEl == null || extEl === undefined) {
044:                       return null;
045:                   }
046:                   var el = extEl.dom;
047:                   if(el == null || el === undefined) {
048:                       return null;
049:                   } else {
050:                       //There's an inconsistency in Ext where most elements have the property 'el' set to Ext's Element
051:                       //with the exception of Menu->Item, Menu->Separator, Menu->TextItem,  Toolbar.Item and subclasses
052:                       //(Toolbar.Separator, Toolbar.Spacer, Toolbar.TextItem) where the 'el' property is set to
053:                       //the DOM element itself. Therefore retruning 'el' if 'el' is not Ext's Element. See details in issue 39.
054:                        return el.dom || el ;
055:                   }
056:               }-*/;
057:
058:            private native void setup(TriggerField triggerField,
059:                    JavaScriptObject jsObj) /*-{
060:                   jsObj.onTriggerClick = function(event) {
061:                       var e = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(event);
062:                       triggerField.@com.gwtext.client.widgets.form.TriggerField::onTriggerClick(Lcom/gwtext/client/core/EventObject;)(e);
063:                   }
064:               }-*/;
065:
066:            protected native JavaScriptObject create(JavaScriptObject jsObj) /*-{
067:                   return new $wnd.Ext.form.TriggerField(jsObj);
068:               }-*/;
069:
070:            /**
071:             * Abstract method that must be implmented for custom trigger field behavior.
072:             *
073:             * @param event the event object
074:             */
075:            protected abstract void onTriggerClick(EventObject event);
076:
077:            // config properties ---
078:            public String getXType() {
079:                return "trigger";
080:            }
081:
082:            /**
083:             * True to hide the trigger element and display only the base text field (defaults to false).
084:             *
085:             * @param hideTrigger true to hide trigger
086:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
087:             */
088:            public void setHideTrigger(boolean hideTrigger)
089:                    throws IllegalStateException {
090:                setAttribute("hideTrigger", hideTrigger, true);
091:            }
092:
093:            /**
094:             * A CSS class to apply to the trigger.
095:             *
096:             * @param triggerClass the trigger CSS class.
097:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
098:             */
099:            public void setTriggerClass(String triggerClass)
100:                    throws IllegalStateException {
101:                setAttribute("triggerClass", triggerClass, true);
102:            }
103:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.