001: package org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel;
002:
003: import org.apache.ojb.broker.metadata.DescriptorRepository;
004: import org.apache.ojb.broker.metadata.FieldDescriptor;
005:
006: public class OjbMetaFieldDescriptorNode extends OjbMetaTreeNode {
007:
008: private static java.util.ArrayList supportedActions = new java.util.ArrayList();
009:
010: private FieldDescriptor fieldDescriptor;
011:
012: /* Copyright 2002-2005 The Apache Software Foundation
013: *
014: * Licensed under the Apache License, Version 2.0 (the "License");
015: * you may not use this file except in compliance with the License.
016: * You may obtain a copy of the License at
017: *
018: * http://www.apache.org/licenses/LICENSE-2.0
019: *
020: * Unless required by applicable law or agreed to in writing, software
021: * distributed under the License is distributed on an "AS IS" BASIS,
022: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
023: * See the License for the specific language governing permissions and
024: * limitations under the License.
025: */
026: public OjbMetaFieldDescriptorNode(DescriptorRepository pRepository,
027: OjbMetaDataTreeModel pTreeModel, OjbMetaTreeNode pparent,
028: FieldDescriptor pFieldDescriptor) {
029: super (pRepository, pTreeModel, pparent);
030: this .fieldDescriptor = pFieldDescriptor;
031: }
032:
033: /**
034: * @see OjbMetaTreeNode#_load()
035: */
036: protected boolean _load() {
037: return true;
038: }
039:
040: /**
041: * @see OjbMetaTreeNode#isLeaf()
042: */
043: public boolean isLeaf() {
044: return false;
045: }
046:
047: /**
048: * @see OjbMetaTreeNode#getAllowsChildren()
049: */
050: public boolean getAllowsChildren() {
051: return false;
052: }
053:
054: /**
055: * @see OjbMetaTreeNode#setAttribute(String, Object)
056: */
057: public void setAttribute(String strKey, Object value) {
058: }
059:
060: /**
061: * @see OjbMetaTreeNode#getAttribute(String)
062: */
063: public Object getAttribute(String strKey) {
064: return null;
065: }
066:
067: /**
068: * @see PropertyEditorTarget#getPropertyEditorClass()
069: */
070: public Class getPropertyEditorClass() {
071: return null;
072: }
073:
074: public String toString() {
075: return "FieldDescriptor: " + fieldDescriptor.getAttributeName();
076: }
077:
078: /**
079: * @see ActionTarget#getActions()
080: */
081: public java.util.Iterator getActions() {
082: return supportedActions.iterator();
083: }
084:
085: /**
086: * @see ActionTarget#actionListCacheable()
087: */
088: public boolean actionListCachable() {
089: return true;
090: }
091:
092: public boolean actionListStatic() {
093: return true;
094: }
095:
096: /**
097: * Return the descriptor object this node is associated with. E.g. if the
098: * node displays a class descriptor, the ClassDescriptor describing the class
099: * should be returned. Used for creating a Transferable.
100: */
101: public Object getAssociatedDescriptor() {
102: return fieldDescriptor;
103: }
104:
105: }
|