1 22 package org.enhydra.kelp.jbuilder.build; 23 24 import org.enhydra.tool.common.PathHandle; 26 27 import com.borland.jbuilder.node.JBProject; 29 import com.borland.primetime.ide.Browser; 30 import com.borland.primetime.node.Node; 31 import com.borland.primetime.node.TextFileNode; 32 import com.borland.primetime.build.Builder; 33 import com.borland.primetime.build.BuildProcess; 34 import com.borland.primetime.build.BuilderManager; 35 36 import org.enhydra.kelp.KelpInfo; 38 import org.enhydra.kelp.common.node.OtterDocumentNode; 39 import org.enhydra.kelp.common.node.OtterProject; 40 import org.enhydra.kelp.common.node.OtterXMLCNode; 41 import org.enhydra.kelp.jbuilder.node.PrimeDocumentNode; 42 import org.enhydra.kelp.jbuilder.node.PrimeProject; 43 44 import java.util.List ; 46 47 48 53 public class XMLCBuilder implements Builder { 54 55 public XMLCBuilder() {} 56 57 61 public static void initOpenTool(byte majorVersion, byte minorVersion) { 62 try { 63 KelpInfo.verifyIDEClassPath(); 64 BuilderManager.registerBuilder(new XMLCBuilder()); 65 } catch (Exception e) { 66 System.err.println(e.getMessage()); 67 } 68 } 69 70 73 public void updateBuildProcess(BuildProcess buildProcess, 74 Node nativeNode) { 75 76 OtterDocumentNode docNode = null; 77 OtterProject otterProject = null; 78 TextFileNode textNode = null; 79 OtterXMLCNode xmlcNode = null; 80 PathHandle path = null; 81 XMLCBuildTask task = null; 82 83 task = (XMLCBuildTask) buildProcess.getTask(XMLCBuildTask.SHARED_KEY); 84 if (task == null) { 85 task = new XMLCBuildTask(); 86 87 buildProcess.putTask(XMLCBuildTask.SHARED_KEY, task); 89 90 List list = buildProcess.getBuildTaskList(); 94 95 list.add(0, task); 96 } 97 task.increment(); 98 if (nativeNode instanceof TextFileNode) { 100 textNode = (TextFileNode) nativeNode; 101 otterProject = 102 new PrimeProject((JBProject) textNode.getProject()); 103 path = 104 PathHandle.createPathHandle(textNode.getUrl().getFileObject()); 105 if (path.hasExtension(otterProject.getDocTypes())) { 106 docNode = new PrimeDocumentNode(textNode); 107 108 if (docNode.isSelected()) { 110 xmlcNode = new OtterXMLCNode(docNode); 111 task.addNode(xmlcNode); 112 } 113 } 114 } 115 } 116 117 } 118 | Popular Tags |