Source Code Cross Referenced for GetDataGridState.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » tags » databinding » datagrid » 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 » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.tags.databinding.datagrid 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         *
017:         * $Header:$
018:         */
019:        package org.apache.beehive.netui.tags.databinding.datagrid;
020:
021:        import javax.servlet.jsp.JspContext;
022:
023:        import org.apache.beehive.netui.tags.AbstractSimpleTag;
024:        import org.apache.beehive.netui.databinding.datagrid.api.DataGridConfig;
025:        import org.apache.beehive.netui.databinding.datagrid.api.DataGridStateFactory;
026:        import org.apache.beehive.netui.databinding.datagrid.api.DataGridState;
027:
028:        /**
029:         * <p>
030:         * Utility data grid tag that allows the page author to gain access to the {@link DataGridState} object
031:         * outside of the body of a &lt;netui-data:dataGrid&gt; tag.  When building UI for sorting, filtering, or paging,
032:         * this UI does not need to exist inside of the HTML table rendered by the data grid tags.  In order to render
033:         * UI for sorting, filtering, and paging, it is often necessary to gain access to the state exposed to a data
034:         * grid via the {@link DataGridState} object.  For example:
035:         * <pre>
036:         *   &lt;netui-data:getDataGridState gridName="employees" var="employeeGridState"/>
037:         *   &lt;c:if test="${pageScope.employeeGridState.sortModel.sorts} != null}">
038:         *     ... render UI when sorts are present ...
039:         *   &lt;/c:if>
040:         * </pre>
041:         * this will expose the "employees" data grid's list of
042:         * {@link org.apache.beehive.netui.databinding.datagrid.api.sort.SortModel#getSorts()} to the JSP for access by
043:         * the JSP EL.
044:         * </p>
045:         * @jsptagref.tagdescription
046:         * <p>
047:         * Utility data grid tag that allows the page author to gain access to the {@link DataGridState} object
048:         * outside of the body of a &lt;netui-data:dataGrid&gt; tag.  When building UI for sorting, filtering, or paging,
049:         * this UI does not need to exist inside of the HTML table rendered by the data grid tags.  In order to render
050:         * UI for sorting, filtering, and paging, it is often necessary to gain access to the state exposed to a data
051:         * grid via the {@link DataGridState} object.  For example:
052:         * <pre>
053:         *   &lt;netui-data:getDataGridState gridName="employees" var="employeeGridState"/>
054:         *   &lt;c:if test="${pageScope.employeeGridState.sortModel.sorts} != null}">
055:         *     ... render UI when sorts are present ...
056:         *   &lt;/c:if>
057:         * </pre>
058:         * this will expose the "employees" data grid's list of
059:         * {@link org.apache.beehive.netui.databinding.datagrid.api.sort.SortModel#getSorts()} to the JSP for access by
060:         * the JSP EL.
061:         * </p>
062:         *
063:         * @netui:tag name="getDataGridState" body-content="scriptless"
064:         *            description="Get a DataGridState object and add it to the PageContext under a given variable name"
065:         */
066:        public class GetDataGridState extends AbstractSimpleTag {
067:
068:            private String _var = null;
069:            private String _name = null;
070:            private DataGridConfig _config = null;
071:
072:            /**
073:             * The name of this tag; this value is used for error reporting.
074:             * @return the String name of this tag
075:             */
076:            public final String getTagName() {
077:                return "GetDataGridState";
078:            }
079:
080:            /**
081:             * Set the data grid name whose {@link DataGridState} should be placed in the {@link JspContext}.
082:             *
083:             * @param name the name of the data grid
084:             * @jsptagref.attributedescription
085:             * Set the data grid name whose {@link DataGridState} should be placed in the {@link JspContext}.
086:             * @jsptagref.attributesyntaxvalue <i>string_gridName</i>
087:             * @netui:attribute name="name" required="true"
088:             *                  description="Set the name of the data grid whose DataGridState to lookup."
089:             */
090:            public void setGridName(String name) {
091:                _name = name;
092:            }
093:
094:            /**
095:             * Set the name used to store the {@link DataGridState} object as a {@link JspContext} attribute.
096:             * @param var the name used to store the {@link DataGridState}
097:             * @jsptagref.attributedescription
098:             * Set the name used to store the {@link DataGridState} object as a {@link JspContext} attribute.
099:             * @jsptagref.attributesyntaxvalue <i>string_var</i>
100:             * @netui:attribute name="var" required="true"
101:             */
102:            public void setVar(String var) {
103:                _var = var;
104:            }
105:
106:            /**
107:             * Set a {@link DataGridConfig} instance used to create a {@link DataGridState} object.  This attribute is
108:             * optional; when unset, the default {@link DataGridConfig} is used.
109:             * @param config the {@link DataGridConfig} used to create the {@link DataGridState}
110:             * @jsptagref.attributedescription
111:             * Set a {@link DataGridConfig} instance used to create a {@link DataGridState} object.  This attribute is
112:             * optional; when unset, the default {@link DataGridConfig} is used.
113:             * @jsptagref.attributesyntaxvalue <i>string_var</i>
114:             * @netui:attribute name="name" required="false"
115:             *                  description="Set an optional DataGridConfig instance used to create the DataGridState object."
116:             */
117:            public void setDataGridConfig(DataGridConfig config) {
118:                _config = config;
119:            }
120:
121:            /**
122:             * Using a {@link DataGridConfig} object, access the {@link DataGridState} and place
123:             * it in the {@link JspContext} under the attribute key set via {@link #setVar(String)}
124:             */
125:            public void doTag() {
126:                JspContext jspContext = getJspContext();
127:                DataGridStateFactory factory = DataGridStateFactory
128:                        .getInstance(jspContext);
129:                assert factory != null;
130:
131:                DataGridState state = null;
132:                if (_config != null)
133:                    state = factory.getDataGridState(_name, _config);
134:                else
135:                    state = factory.getDataGridState(_name);
136:
137:                jspContext.setAttribute(_var, state);
138:            }
139:        }
w___w_w___.___j___a_va___2___s__._com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.