Source Code Cross Referenced for TreeWidget.java in  » Web-Framework » aranea-mvc-1.1.1 » org » araneaframework » uilib » tree » 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 » Web Framework » aranea mvc 1.1.1 » org.araneaframework.uilib.tree 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright 2006 Webmedia Group Ltd.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *  http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         **/package org.araneaframework.uilib.tree;
016:
017:        import java.io.Writer;
018:        import java.util.List;
019:        import org.araneaframework.Environment;
020:        import org.araneaframework.OutputData;
021:        import org.araneaframework.Widget;
022:        import org.araneaframework.core.Assert;
023:        import org.araneaframework.core.StandardEnvironment;
024:        import org.araneaframework.http.HttpOutputData;
025:
026:        /**
027:         * @author Alar Kvell (alar@araneaframework.org)
028:         * @since 1.0.7
029:         */
030:        public class TreeWidget extends TreeNodeWidget implements  TreeContext {
031:
032:            private static final long serialVersionUID = 1L;
033:
034:            private TreeDataProvider dataProvider;
035:            private boolean removeChildrenOnCollapse = true;
036:            private boolean useActions = false;
037:            private boolean useSynchronizedActions = true;
038:            private TreeRenderer renderer;
039:
040:            //TODO features:
041:            // * not-dispose-children in client side
042:            // * some nodes not collapsable
043:            // * disable concrete tree node toggling client-side when request has been
044:            //   submitted - response not yet arrived and processed
045:            // * make sure that all methods can be called before init
046:
047:            /**
048:             * Creates a new {@link TreeWidget} instance.
049:             */
050:            public TreeWidget() {
051:            }
052:
053:            /**
054:             * Creates a new {@link TreeWidget} instance which will acquire the
055:             * tree data from supplied {@link TreeDataProvider}.
056:             * 
057:             * @param dataProvider
058:             *          tree data provider.
059:             */
060:            public TreeWidget(TreeDataProvider dataProvider) {
061:                Assert.notNullParam(dataProvider, "dataProvider");
062:                this .dataProvider = dataProvider;
063:            }
064:
065:            protected void init() throws Exception {
066:                List children = loadChildren();
067:                if (children != null)
068:                    addAllNodes(children);
069:            }
070:
071:            public Environment getEnvironment() {
072:                return new StandardEnvironment(super .getEnvironment(),
073:                        TreeContext.class, this );
074:            }
075:
076:            public TreeDataProvider getDataProvider() {
077:                return dataProvider;
078:            }
079:
080:            /**
081:             * Set if actions are used instead of events in submit links. See
082:             * {@link TreeContext#useActions()}.
083:             */
084:            public void setUseActions(boolean useActions) {
085:                this .useActions = useActions;
086:            }
087:
088:            public boolean useActions() {
089:                return useActions;
090:            }
091:
092:            /**
093:             * Set if AJAX requests to tree widget are synchronized. See
094:             * {@link TreeContext#useSynchronizedActions()}.
095:             * 
096:             * @since 1.1
097:             */
098:            public void setUseSynchronizedActions(boolean useSynchronizedActions) {
099:                this .useSynchronizedActions = useSynchronizedActions;
100:            }
101:
102:            public boolean useSynchronizedActions() {
103:                return useSynchronizedActions;
104:            }
105:
106:            /**
107:             * Set if child nodes are removed and discarded when a node is closed.
108:             */
109:            public void setRemoveChildrenOnCollapse(
110:                    boolean removeChildrenOnCollapse) {
111:                this .removeChildrenOnCollapse = removeChildrenOnCollapse;
112:            }
113:
114:            public boolean isRemoveChildrenOnCollapse() {
115:                return removeChildrenOnCollapse;
116:            }
117:
118:            /**
119:             * Set tree renderer.
120:             */
121:            public void setRenderer(TreeRenderer renderer) {
122:                Assert.notNullParam(renderer, "renderer");
123:                this .renderer = renderer;
124:            }
125:
126:            public TreeRenderer getRenderer() {
127:                return renderer;
128:            }
129:
130:            protected void render(OutputData output) throws Exception {
131:                super .render(output);
132:                Writer out = ((HttpOutputData) output).getWriter();
133:                out.flush();
134:            }
135:
136:            // The following methods do nothing, because the root node of the tree has no
137:            // display widget and therefore is always expanded.
138:
139:            public Widget getDisplayWidget() {
140:                return null;
141:            }
142:
143:            public void setCollapsed(boolean collapsed) {
144:            }
145:
146:            public void toggleCollapsed() {
147:            }
148:
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.