1 22 23 package org.enhydra.kelp.jbuilder.node; 24 25 import com.borland.jbuilder.node.JBProject; 27 import com.borland.primetime.node.Node; 28 import com.borland.primetime.node.FolderNode; 29 import com.borland.primetime.node.LightweightNode; 30 31 import org.enhydra.kelp.common.node.OtterFolderNode; 33 import org.enhydra.kelp.common.node.OtterNode; 34 35 41 public class PrimeFolderNode extends PrimeNode implements OtterFolderNode { 42 43 public PrimeFolderNode(FolderNode nativeNode) { 44 super(nativeNode); 45 } 46 47 48 55 public PrimeFolderNode(OtterNode otterNode, 56 String name) { 57 58 JBProject nativeProject = null; 59 Node containerNode = null; 60 61 if (otterNode.getProject().getNativeProject() instanceof JBProject) { 62 nativeProject = 63 (JBProject) otterNode.getProject().getNativeProject(); 64 } 65 if (otterNode.getNativeNode() instanceof Node) { 66 containerNode = (Node) otterNode.getNativeNode(); 67 } 68 if (nativeProject != null && containerNode != null) { 69 LightweightNode[] found = new LightweightNode[0]; 70 71 found = nativeProject.findNodes(name); 72 if (found == null || found.length == 0) { 73 FolderNode newNode = null; 74 newNode = new FolderNode(nativeProject, containerNode, name); 75 setNativeNode(newNode); 76 } else { 77 setNativeNode(found[0]); 78 } 79 } 80 } 81 82 } 83 | Popular Tags |