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