Source Code Cross Referenced for Node.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » channels » jsp » 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 » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal.channels.jsp.tree 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Dec 15, 2005
003:         *
004:         * TODO To change the template for this generated file go to
005:         * Window - Preferences - Java - Code Style - Code Templates
006:         */
007:        package org.jasig.portal.channels.jsp.tree;
008:
009:        import java.util.ArrayList;
010:        import java.util.List;
011:
012:        /**
013:         * @author Mark Boyd
014:         *
015:         * TODO To change the template for this generated type comment go to
016:         * Window - Preferences - Java - Code Style - Code Templates
017:         */
018:        public class Node {
019:            private static final Node[] TREE_NODE_ARRAY = new Node[] {};
020:
021:            private String id = null;
022:            private boolean isAspect = false;
023:            private boolean hasNextSibling = false;
024:            private ISurrogate surrogate = null;
025:            private Object domainObject = null;
026:            private boolean isExpanded = false;
027:            private boolean isShowingAspects = false;
028:            private Node[] children = null;
029:            private Model model = null;
030:            private boolean isUnresolveable = false;
031:
032:            private Node[] aspects;
033:
034:            private Node() {
035:            }
036:
037:            Node(Model model, String id, Object domainObject) {
038:                this (model, id, domainObject, null);
039:                this .isUnresolveable = true;
040:            }
041:
042:            Node(Model model, String id, Object domainObject, ISurrogate s) {
043:                this .model = model;
044:                this .id = id;
045:                this .domainObject = domainObject;
046:                this .surrogate = s;
047:            }
048:
049:            Object getLabelData() {
050:                if (surrogate == null)
051:                    return null;
052:                return surrogate.getLabelData(domainObject);
053:            }
054:
055:            /**
056:             * Returns the domain object represented by this node.
057:             * @return
058:             */
059:            Object getDomainObject() {
060:                return domainObject;
061:            }
062:
063:            public boolean isUnresolveable() {
064:                return isUnresolveable;
065:            }
066:
067:            public String getId() {
068:                return id;
069:            }
070:
071:            public boolean getIsAspect() {
072:                return isAspect;
073:            }
074:
075:            void setIsAspect(boolean b) {
076:                this .isAspect = b;
077:            }
078:
079:            /**
080:             * Set by the tree renderer JSP during rendering.
081:             * @param b
082:             */
083:            public void setHasNextSibling(boolean b) {
084:                this .hasNextSibling = b;
085:            }
086:
087:            /**
088:             * Used by the tree renderer JSP during rendering.
089:             * @param b
090:             */
091:            public boolean getHasNextSibling() {
092:                return this .hasNextSibling;
093:            }
094:
095:            public boolean getCanContainChildren() {
096:                if (isAspect)
097:                    return false;
098:                return this .surrogate.canContainChildren(this .domainObject);
099:            }
100:
101:            public boolean getHasChildren() {
102:                if (isAspect)
103:                    return false;
104:                if (children != null && children.length > 0)
105:                    return true;
106:                return this .surrogate.hasChildren(this .domainObject);
107:            }
108:
109:            public boolean getIsExpanded() {
110:                return this .isExpanded;
111:            }
112:
113:            public void setIsExpanded(boolean b) {
114:                this .isExpanded = b;
115:                if (isExpanded && children == null)
116:                    loadChildren();
117:            }
118:
119:            public boolean getHasAspects() {
120:                if (this .isAspect)
121:                    return false;
122:                return this .surrogate.hasAspects(this .domainObject);
123:            }
124:
125:            public boolean getIsShowingAspects() {
126:                return this .isShowingAspects;
127:            }
128:
129:            public void setIsShowingAspects(boolean b) {
130:                this .isShowingAspects = b;
131:                if (isShowingAspects && aspects == null)
132:                    loadAspects();
133:            }
134:
135:            public Node[] getChildren() {
136:                return this .children;
137:            }
138:
139:            void loadChildren() {
140:                Object[] domainObjects = null;
141:                domainObjects = this .surrogate.getChildren(this .domainObject);
142:                List nodes = new ArrayList();
143:
144:                if (domainObjects != null && domainObjects.length > 0) {
145:                    for (int i = 0; i < domainObjects.length; i++) {
146:                        Node node = this .model.resolveChild(domainObjects[i]);
147:                        if (node != null)
148:                            nodes.add(node);
149:                    }
150:                }
151:                this .children = (Node[]) nodes.toArray(TREE_NODE_ARRAY);
152:            }
153:
154:            void loadAspects() {
155:                Object[] domainObjects = null;
156:                domainObjects = this .surrogate.getAspects(this .domainObject);
157:                List nodes = new ArrayList();
158:
159:                if (domainObjects != null && domainObjects.length > 0) {
160:                    for (int i = 0; i < domainObjects.length; i++) {
161:                        Node node = this .model.resolveAspect(domainObjects[i]);
162:                        if (node != null)
163:                            nodes.add(node);
164:                    }
165:                }
166:                this .aspects = (Node[]) nodes.toArray(TREE_NODE_ARRAY);
167:            }
168:
169:            public Node[] getAspects() {
170:                return this.aspects;
171:            }
172:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.