Source Code Cross Referenced for WebTree.java in  » Content-Management-System » openedit » com » openedit » webui » 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 » Content Management System » openedit » com.openedit.webui.tree 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:        Copyright (c) 2003 eInnovation Inc. All rights reserved
003:
004:        This library is free software; you can redistribute it and/or modify it under the terms
005:        of the GNU Lesser General Public License as published by the Free Software Foundation;
006:        either version 2.1 of the License, or (at your option) any later version.
007:
008:        This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
009:        without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
010:        See the GNU Lesser General Public License for more details.
011:         */
012:
013:        package com.openedit.webui.tree;
014:
015:        import java.util.List;
016:
017:        /**
018:         * This class is a Web tree, which can render a <code>{@link WebTreeModel}</code> to an XML
019:         * document.
020:         *
021:         * @author Eric Galluzzo
022:         */
023:        public class WebTree {
024:            protected String fieldName;
025:            protected String fieldId;
026:
027:            protected WebTreeModel fieldModel;
028:            protected TreeRenderer fieldTreeRenderer;
029:
030:            public WebTree() {
031:            }
032:
033:            /**
034:             * Create a new WebTree which listens to the given model.
035:             *
036:             * @param inModel DOCUMENT ME!
037:             */
038:            public WebTree(WebTreeModel inModel) {
039:                setModel(inModel);
040:                //expandNode(getModel().getRoot());
041:            }
042:
043:            public boolean isEmpty() {
044:                if ((getModel() == null)
045:                        || (getModel().getChildCount(getModel().getRoot()) == 0)) {
046:                    return true;
047:                } else {
048:                    return false;
049:                }
050:            }
051:
052:            /**
053:             * Sets the model.
054:             *
055:             * @param model The model to set
056:             */
057:            public void setModel(WebTreeModel model) {
058:                fieldModel = model;
059:                if (fieldModel != null && fieldTreeRenderer != null) {
060:                    getTreeRenderer().expandNode(fieldModel.getRoot());
061:                }
062:            }
063:
064:            /**
065:             * Gets the model.
066:             *
067:             * @return Returns a WebTreeModel
068:             */
069:            public WebTreeModel getModel() {
070:                if (fieldModel == null) {
071:                    fieldModel = new DefaultWebTreeModel();
072:                }
073:
074:                return fieldModel;
075:            }
076:
077:            public Object getChildChildren(int inCount) {
078:                List children = getModel().getChildren(getModel().getRoot());
079:                if (children.size() < inCount) {
080:                    Object parent = children.get(inCount);
081:                    return getModel().getChildren(parent);
082:                }
083:                return null;
084:            }
085:
086:            /**
087:             * DOCUMENT ME!
088:             *
089:             * @param inName
090:             */
091:            public void setName(String inName) {
092:                fieldName = inName;
093:            }
094:
095:            /**
096:             * DOCUMENT ME!
097:             *
098:             * @return
099:             */
100:            public String getName() {
101:                if (fieldName == null) {
102:                    fieldName = "WebTree";
103:                }
104:
105:                return fieldName;
106:            }
107:
108:            /**
109:             * DOCME
110:             *
111:             * @return DOCME
112:             */
113:            public String renderAsJavaScript() {
114:                return render();
115:            }
116:
117:            public String render() {
118:                TreeRenderer renderer = getTreeRenderer();
119:                return renderer.renderAsString();
120:            }
121:
122:            public String render(String inNodeId) {
123:                TreeRenderer renderer = getTreeRenderer();
124:                return renderer.renderAsString(inNodeId);
125:            }
126:
127:            public TreeRenderer getTreeRenderer() {
128:                if (fieldTreeRenderer == null) {
129:                    fieldTreeRenderer = new WebTreeNodeTreeRenderer(this );
130:                }
131:                return fieldTreeRenderer;
132:            }
133:
134:            public void setTreeRenderer(TreeRenderer inTreeRenderer) {
135:                fieldTreeRenderer = inTreeRenderer;
136:                if (fieldModel != null && inTreeRenderer != null) {
137:                    getTreeRenderer().expandNode(getModel().getRoot());
138:                }
139:
140:            }
141:
142:            public String toString() {
143:                return getTreeRenderer().renderAsString();
144:            }
145:
146:            public String getId() {
147:                return fieldId;
148:            }
149:
150:            public void setId(String inId) {
151:                fieldId = inId;
152:            }
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.