Source Code Cross Referenced for TreeRootElement.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » tags » 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 » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.tags.tree 
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.tree;
020:
021:        import javax.servlet.ServletRequest;
022:
023:        /**
024:         * This is a concrete implementation of <code>ITreeRootElement</code>.  It is a subclass of the
025:         * <code>TreeElement</code> and is created for the root element when a tree is defined
026:         * through JSP tags.
027:         */
028:        public class TreeRootElement extends TreeElement implements 
029:                ITreeRootElement {
030:            private TreeElement _selectedNode; // The currently selected node
031:            private TreeRenderState _trs; // The tree render state used by TreeRenderer
032:            private InheritableState _state; // The tree's root inheritableState
033:            private String _name = null; // The name of the tree
034:            private String _rootNodeExpandedImage; // The image used when the root is expanded.
035:            private String _rootNodeCollapsedImage; // The image used when the root is collapsed
036:
037:            /**
038:             * Default constructor for creating a simple tree.
039:             */
040:            public TreeRootElement() {
041:                super ();
042:            }
043:
044:            /**
045:             * Construct a new TreeElement with the specified parameters.
046:             * @param expanded Should this node be expanded?
047:             */
048:            public TreeRootElement(String label, boolean expanded) {
049:                super (label, expanded);
050:            }
051:
052:            /**
053:             * Change the node that is selected.  This is an optimization were the
054:             * root node can track which node is currently selected so it can unselect
055:             * that node instead of searching the whole tree to find the selected node.
056:             * @param selectNode
057:             */
058:            public void changeSelected(String selectNode, ServletRequest request) {
059:                _selectedNode = TreeHelpers.changeSelected(this , _selectedNode,
060:                        selectNode, request);
061:            }
062:
063:            /**
064:             * Return the currently selected <code>TreeElement</code>.  This method
065:             * will return null if no element is currently selected.
066:             *
067:             * <p>Implementation Note: The method that changes the selected node based on the request,
068:             * {@link TreeHelpers#processTreeRequest(String, TreeElement, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)},
069:             * gets called during the processing of the {@link Tree} tag within a JSP. If the
070:             * <code>getSelectedNode</code> method is called from an Action in a Page Flow Controller,
071:             * the value of the selected node will have not yet been updated.</p>
072:             *
073:             * @return the currently selected node.
074:             */
075:            public TreeElement getSelectedNode() {
076:                return _selectedNode;
077:            }
078:
079:            /**
080:             * return the TreeRenderState for this tree.
081:             * @return the <code>TreeRenderState</code>
082:             */
083:            public TreeRenderState getTreeRenderState() {
084:                return _trs;
085:            }
086:
087:            /**
088:             * Set the TreeRenderState
089:             * @param trs
090:             */
091:            public void setTreeRenderState(TreeRenderState trs) {
092:                _trs = trs;
093:            }
094:
095:            /**
096:             * Property that returns the InheritableState that was set on the Tree.
097:             * @return InheritableState
098:             */
099:            public InheritableState getInheritableState() {
100:                return _state;
101:            }
102:
103:            /**
104:             * Property that sets the InheritableState that is set on the Tree tag.
105:             * @param state
106:             */
107:            public void setInheritableState(InheritableState state) {
108:                _state = state;
109:            }
110:
111:            /**
112:             * Returns the expanded image for the root node.
113:             * @return the expanded image for the root.
114:             */
115:            public String getRootNodeExpandedImage() {
116:                return _rootNodeExpandedImage;
117:            }
118:
119:            /**
120:             * Sets the expanded image for the root node.
121:             * @param rootNodeExpandedImage the name of the image to display.  This will be searched
122:             *                              for below the image root.
123:             */
124:            public void setRootNodeExpandedImage(String rootNodeExpandedImage) {
125:                _rootNodeExpandedImage = rootNodeExpandedImage;
126:            }
127:
128:            /**
129:             * Returns the collapsed image for the root node.
130:             * @return the name of the collapsed image for the root.
131:             */
132:            public String getRootNodeCollapsedImage() {
133:                return _rootNodeCollapsedImage;
134:            }
135:
136:            /**
137:             * Sets the name of the collapsed image for the root node.
138:             * @param rootNodeCollapsedImage the name of the collapsed image to display.  This will be searched
139:             *                               for below the image root.
140:             */
141:            public void setRootNodeCollapsedImage(String rootNodeCollapsedImage) {
142:                _rootNodeCollapsedImage = rootNodeCollapsedImage;
143:            }
144:
145:            /**
146:             * Set the ObjectName of the INameable object.  This should only
147:             * be set once.  If it is called a second time an IllegalStateException
148:             * should be thrown
149:             * @param name the Object's name.
150:             * @throws IllegalStateException if this method is called more than once for an object
151:             */
152:            public void setObjectName(String name) {
153:                if (_name != null) {
154:                    throw new IllegalStateException(
155:                            "Attempt to set the ObjectName twice");
156:                }
157:                _name = name;
158:            }
159:
160:            /**
161:             * Returns the ObjectName of the INameable object.
162:             * @return the ObjectName.
163:             */
164:            public String getObjectName() {
165:                return _name;
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.