Source Code Cross Referenced for OjbMetaRootNode.java in  » Database-ORM » db-ojb » org » apache » ojb » tools » mapping » reversedb2 » ojbmetatreemodel » 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 » Database ORM » db ojb » org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel;
002:
003:        /* Copyright 2002-2005 The Apache Software Foundation
004:         *
005:         * Licensed under the Apache License, Version 2.0 (the "License");
006:         * you may not use this file except in compliance with the License.
007:         * 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:
018:        /**
019:         * This represents the root of the repository.xml tree model. It contains
020:         * the ClassDescriptor objects for this repository and the default JDBC
021:         * connection.
022:         *
023:         * @author <a href="mailto:bfl@florianbruckner.com">Florian Bruckner</a>
024:         * @version $Id: OjbMetaRootNode.java,v 1.1.2.1 2005/12/21 22:32:38 tomdz Exp $
025:         */
026:        public class OjbMetaRootNode extends OjbMetaTreeNode {
027:            private java.util.ArrayList supportedActions = new java.util.ArrayList();
028:
029:            java.util.HashMap cldToNodes = new java.util.HashMap();
030:
031:            /** Creates a new instance of OjbMetaRootNode */
032:            public OjbMetaRootNode(
033:                    org.apache.ojb.broker.metadata.DescriptorRepository pRepository,
034:                    OjbMetaDataTreeModel model) {
035:                super (pRepository, model, null);
036:                supportedActions
037:                        .add(new org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.actions.ActionAddClassDescriptor(
038:                                this ));
039:            }
040:
041:            public boolean getAllowsChildren() {
042:                return true;
043:            }
044:
045:            public Class getPropertyEditorClass() {
046:                return null;
047:            }
048:
049:            public boolean isLeaf() {
050:                return false;
051:            }
052:
053:            /** Get an attribute of this node as Object.
054:             */
055:            public Object getAttribute(String strKey) {
056:                return null;
057:            }
058:
059:            /** Set an attribute of this node as Object.
060:             */
061:            public void setAttribute(String strKey, Object value) {
062:            }
063:
064:            public OjbMetaClassDescriptorNode getClassDescriptorNodeForClassDescriptor(
065:                    org.apache.ojb.broker.metadata.ClassDescriptor cld) {
066:                return (OjbMetaClassDescriptorNode) this .cldToNodes.get(cld);
067:            }
068:
069:            /** Purpose of this method is to fill the children of the node. It should
070:             * replace all children in alChildren (the arraylist containing the children)
071:             * of this node and notify the TreeModel that a change has occurred.
072:             */
073:            protected boolean _load() {
074:                java.util.Iterator it = this .getOjbMetaTreeModel()
075:                        .getRepository().iterator();
076:                java.util.ArrayList newChildren = new java.util.ArrayList();
077:
078:                /* @todo make this work */
079:
080:                //        newChildren.add(new OjbMetaJdbcConnectionDescriptorNode(
081:                //            this.getOjbMetaTreeModel ().getRepository(),
082:                //            this.getOjbMetaTreeModel (),
083:                //            this,
084:                //            this.getOjbMetaTreeModel ().getRepository().getDefaultJdbcConnection()));
085:                while (it.hasNext()) {
086:                    org.apache.ojb.broker.metadata.ClassDescriptor cld = (org.apache.ojb.broker.metadata.ClassDescriptor) it
087:                            .next();
088:                    OjbMetaClassDescriptorNode cldNode = new OjbMetaClassDescriptorNode(
089:                            this .getOjbMetaTreeModel().getRepository(), this 
090:                                    .getOjbMetaTreeModel(), this , cld);
091:                    cldToNodes.put(cld, cldNode);
092:                    newChildren.add(cldNode);
093:                }
094:                java.util.Collections.sort(newChildren);
095:                this .alChildren = newChildren;
096:                this .getOjbMetaTreeModel().nodeStructureChanged(this );
097:                return true;
098:            }
099:
100:            public void addClassDescriptor(
101:                    org.apache.ojb.broker.metadata.ClassDescriptor cld) {
102:                OjbMetaClassDescriptorNode cldNode = new OjbMetaClassDescriptorNode(
103:                        this .getOjbMetaTreeModel().getRepository(), this 
104:                                .getOjbMetaTreeModel(), this , cld);
105:                cldToNodes.put(cld, cldNode);
106:                this .alChildren.add(cldNode);
107:                this .getOjbMetaTreeModel().nodesWereInserted(this ,
108:                        new int[] { this .alChildren.size() - 1 });
109:            }
110:
111:            /**
112:             * @see ActionTarget#getActions()
113:             */
114:            public java.util.Iterator getActions() {
115:                return supportedActions.iterator();
116:            }
117:
118:            /**
119:             * @see ActionTarget#actionListCacheable()
120:             */
121:            public boolean actionListCachable() {
122:                return true;
123:            }
124:
125:            /**
126:             * @see ActionTarget
127:             */
128:            public boolean actionListStatic() {
129:                return false;
130:            }
131:
132:            /**
133:             * Return the descriptor object this node is associated with. E.g. if the
134:             * node displays a class descriptor, the ClassDescriptor describing the class
135:             * should be returned. Used for creating a Transferable. Null in this case
136:             * because the root doesn't have any associated objects.
137:             */
138:            public Object getAssociatedDescriptor() {
139:                return null;
140:            }
141:
142:        }
w___w_w._j___a___va_2_s__.__c_o__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.