Source Code Cross Referenced for AnnotateDataBinderInit.java in  » Ajax » zk » org » zkoss » zkplus » databind » 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 » zk » org.zkoss.zkplus.databind 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /* AnnotateDataBinderInit.java
02:
03:        {{IS_NOTE
04:        	Purpose:
05:        		
06:        	Description:
07:        		
08:        	History:
09:        		Thu Nov 30 17:41:15     2006, Created by Henri Chen
10:        }}IS_NOTE
11:
12:        Copyright (C) 2006 Potix Corporation. All Rights Reserved.
13:
14:        {{IS_RIGHT
15:        }}IS_RIGHT
16:         */
17:        package org.zkoss.zkplus.databind;
18:
19:        import org.zkoss.zk.ui.Page;
20:        import org.zkoss.zk.ui.Path;
21:        import org.zkoss.zk.ui.Component;
22:        import org.zkoss.zk.ui.util.Initiator;
23:
24:        /**
25:         * <p>This initiator class do following things:</p>
26:         * <ol>
27:         * <li>new an {@link AnnotateDataBinder} instance.</li>
28:         * <li>set the AnnotateDataBinder instance as a variable "binder" in the ID Space of the root 
29:         *  component as specified in arg0 "component-path".(if arg0 is not specified, use Page instead.)</li>
30:         * <li>call {@link AnnotateDataBinder#loadAll()} to initiate all UI components from the associated data bean.</li>
31:         * </ol>
32:         * <p>Put the init PI as follows:</p>
33:         * <pre>
34:         * &lt;?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" [arg0="component|component-path"] [arg1="true|false"]?>
35:         * </pre>
36:         * <p>Where the arg0 is the component itself (via EL expression) or the component path that specifies the component the AnnotateDataBinder covers. If the 
37:         * arg0 is not specified or set to string "page", the AnnotateDataBinder will default to cover the whole page.</p>
38:         * <p>Where the arg1 is used to decide whether to load default binding configuration defined in lang-addon.xml. 
39:         * If the arg1 is not specified it is default to true. Note that you have to specify arg0 if you want to specify arg1.</p>
40:         *
41:         * @author Henri Chen
42:         * @see AnnotateDataBinder
43:         */
44:        public class AnnotateDataBinderInit implements  Initiator {
45:            private Component _comp;
46:            private String _compPath;
47:            private String _defaultConfig;
48:
49:            /** The AnnotateDataBinder created in doAfterCompose() */
50:            protected AnnotateDataBinder _binder;
51:
52:            //-- Initator --//
53:            public void doAfterCompose(Page page) {
54:                boolean b = _defaultConfig != null ? Boolean.valueOf(
55:                        _defaultConfig).booleanValue() : true;
56:                if (_comp instanceof  Component) {
57:                    _binder = new AnnotateDataBinder(_comp, b);
58:                    _comp.setVariable("binder", _binder, true);
59:                } else if (_compPath == null || "page".equals(_compPath)) {
60:                    _binder = new AnnotateDataBinder(page, b);
61:                    page.setVariable("binder", _binder);
62:                } else if (_compPath.startsWith("/")) {
63:                    final Component comp = Path.getComponent(_compPath);
64:                    _binder = new AnnotateDataBinder(comp, b);
65:                    comp.setVariable("binder", _binder, true);
66:                } else {
67:                    final Component comp = page.getFellow(_compPath);
68:                    _binder = new AnnotateDataBinder(comp, b);
69:                    comp.setVariable("binder", _binder, true);
70:                }
71:                _binder.loadAll(); //load data bean properties into UI components
72:            }
73:
74:            public boolean doCatch(java.lang.Throwable ex) {
75:                return false; // do nothing
76:            }
77:
78:            public void doFinally() {
79:                // do nothing
80:            }
81:
82:            public void doInit(Page page, java.lang.Object[] args) {
83:                if (args.length > 0) {
84:                    Object arg0 = args[0];
85:                    if (arg0 instanceof  String) {
86:                        _compPath = (String) arg0;
87:                    } else if (arg0 instanceof  Component) {
88:                        _comp = (Component) arg0;
89:                    }
90:                }
91:
92:                if (args.length > 1) {
93:                    _defaultConfig = (String) args[1];
94:                }
95:            }
96:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.