Source Code Cross Referenced for OjbMetaObjectReferenceDescriptorNode.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:        import org.apache.ojb.broker.metadata.ClassDescriptor;
004:        import org.apache.ojb.broker.metadata.DescriptorRepository;
005:        import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
006:
007:        public class OjbMetaObjectReferenceDescriptorNode extends
008:                OjbMetaTreeNode {
009:
010:            private static java.util.ArrayList supportedActions = new java.util.ArrayList();
011:
012:            private ObjectReferenceDescriptor objRefDescriptor;
013:
014:            /* Copyright 2002-2005 The Apache Software Foundation
015:             *
016:             * Licensed under the Apache License, Version 2.0 (the "License");
017:             * you may not use this file except in compliance with the License.
018:             * You may obtain a copy of the License at
019:             *
020:             *     http://www.apache.org/licenses/LICENSE-2.0
021:             *
022:             * Unless required by applicable law or agreed to in writing, software
023:             * distributed under the License is distributed on an "AS IS" BASIS,
024:             * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
025:             * See the License for the specific language governing permissions and
026:             * limitations under the License.
027:             */
028:            public OjbMetaObjectReferenceDescriptorNode(
029:                    DescriptorRepository pRepository,
030:                    OjbMetaDataTreeModel pTreeModel, OjbMetaTreeNode pparent,
031:                    ObjectReferenceDescriptor pObjRefDescriptor) {
032:                super (pRepository, pTreeModel, pparent);
033:                this .objRefDescriptor = pObjRefDescriptor;
034:            }
035:
036:            /**
037:             * @see OjbMetaTreeNode#_load()
038:             */
039:            protected boolean _load() {
040:                java.util.ArrayList newChildren = new java.util.ArrayList();
041:                ClassDescriptor itemClass = this .getRepository()
042:                        .getDescriptorFor(
043:                                this .objRefDescriptor.getItemClassName());
044:                newChildren.add(getOjbMetaTreeModel()
045:                        .getClassDescriptorNodeForClassDescriptor(itemClass));
046:                this .alChildren = newChildren;
047:
048:                java.util.Iterator it;
049:
050:                // FK field indices are the the indices of the attributes in the class containing the reference descriptor.
051:                try {
052:
053:                    it = objRefDescriptor.getForeignKeyFields().iterator();
054:                    while (it.hasNext())
055:                        newChildren
056:                                .add(new javax.swing.tree.DefaultMutableTreeNode(
057:                                        "FkFields: " + it.next().toString()));
058:                } catch (NullPointerException npe) {
059:                    npe.printStackTrace();
060:                }
061:
062:                this .getOjbMetaTreeModel().nodeStructureChanged(this );
063:                return true;
064:            }
065:
066:            /**
067:             * Override load() of superClass to prevent recursive loading which would lead to an endless recursion
068:             * because of OjbClassDescriptorNodes being children of this node
069:             */
070:            public boolean load() {
071:                return _load();
072:            }
073:
074:            /**
075:             * @see OjbMetaTreeNode#isLeaf()
076:             */
077:            public boolean isLeaf() {
078:                return false;
079:            }
080:
081:            /**
082:             * @see OjbMetaTreeNode#getAllowsChildren()
083:             */
084:            public boolean getAllowsChildren() {
085:                return false;
086:            }
087:
088:            /**
089:             * @see OjbMetaTreeNode#setAttribute(String, Object)
090:             */
091:            public void setAttribute(String strKey, Object value) {
092:            }
093:
094:            /**
095:             * @see OjbMetaTreeNode#getAttribute(String)
096:             */
097:            public Object getAttribute(String strKey) {
098:                return null;
099:            }
100:
101:            /**
102:             * @see PropertyEditorTarget#getPropertyEditorClass()
103:             */
104:            public Class getPropertyEditorClass() {
105:                return null;
106:            }
107:
108:            public String toString() {
109:                if (objRefDescriptor.getItemClassName() != null)
110:                    return "ObjectReferenceDescriptor: "
111:                            + objRefDescriptor.getItemClassName();
112:                else
113:                    return "ObjectReference: .getItemClass() == null";
114:            }
115:
116:            /**
117:             * @see ActionTarget#getActions()
118:             */
119:            public java.util.Iterator getActions() {
120:                return supportedActions.iterator();
121:            }
122:
123:            /**
124:             * @see ActionTarget#actionListCacheable()
125:             */
126:            public boolean actionListCachable() {
127:                return true;
128:            }
129:
130:            public boolean actionListStatic() {
131:                return true;
132:            }
133:
134:            /**
135:             * Return the descriptor object this node is associated with. E.g. if the 
136:             * node displays a class descriptor, the ClassDescriptor describing the class
137:             * should be returned. Used for creating a Transferable.
138:             */
139:            public Object getAssociatedDescriptor() {
140:                return objRefDescriptor;
141:            }
142:
143:        }
w__w___w___.j_av___a2s.___c__o___m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.