1 22 package org.enhydra.kelp.jbuilder.properties; 23 24 import org.enhydra.tool.common.PathHandle; 26 27 import org.enhydra.kelp.KelpInfo; 29 import org.enhydra.kelp.common.node.OtterProject; 30 import org.enhydra.kelp.common.node.OtterXMLCNode; 31 import org.enhydra.kelp.jbuilder.node.PrimeProject; 32 33 import com.borland.jbuilder.node.JBProject; 35 import com.borland.primetime.ide.Browser; 36 import com.borland.primetime.node.Node; 37 import com.borland.primetime.node.LightweightNode; 38 import com.borland.primetime.node.TextFileNode; 39 import com.borland.primetime.properties.PropertyPageFactory; 40 import com.borland.primetime.properties.PropertyPage; 41 import com.borland.primetime.properties.PropertyManager; 42 import com.borland.primetime.properties.PropertyGroup; 43 import java.util.ResourceBundle ; 44 45 public class XMLCProperties implements PropertyGroup { 47 static ResourceBundle res = 48 ResourceBundle.getBundle("org.enhydra.kelp.jbuilder.Res"); 49 50 public XMLCProperties() {} 51 52 55 public static void initOpenTool(byte majorVersion, byte minorVersion) { 56 if (KelpInfo.isClassPathComplete()) { 57 PropertyManager.registerPropertyGroup(new XMLCProperties()); 58 } 59 } 60 61 67 public PropertyPageFactory getPageFactory(final Object topic) { 68 PropertyPageFactory factory = null; 69 JBProject nativeProject = null; 70 OtterProject otterProject = null; 71 PathHandle path = null; 72 73 if (topic instanceof TextFileNode) { 74 TextFileNode textNode = (TextFileNode) topic; 75 76 nativeProject = (JBProject) textNode.getProject(); 77 if (nativeProject == null) { 78 79 } else { 81 otterProject = new PrimeProject(nativeProject); 82 path = 83 PathHandle.createPathHandle(textNode.getUrl().getFileObject()); 84 if (path.hasExtension(otterProject.getDocTypes())) { 85 86 factory = 88 (new PropertyPageFactory("XML Compiler") { 89 public PropertyPage createPropertyPage() { 90 return new XMLCNodePropertyPage(topic); 91 } 92 93 }); 94 } 95 } 96 } else if (topic instanceof LightweightNode) { 97 98 LightweightNode lightNode = null; 100 101 lightNode = (LightweightNode) topic; 102 nativeProject = (JBProject) lightNode.getProject(); 103 if (nativeProject == null) { 104 105 } else { 107 factory = 108 (new PropertyPageFactory(res.getString("Enhydra_XMLC")) { 109 public PropertyPage createPropertyPage() { 110 return new XMLCPackagePropertyPage(topic); 111 } 112 113 }); 114 } 115 } else if (topic instanceof JBProject) { 116 117 factory = 119 (new PropertyPageFactory(res.getString("Enhydra_XMLC")) { 120 public PropertyPage createPropertyPage() { 121 return new XMLCProjectPropertyPage(topic); 122 } 123 124 }); 125 } 126 return factory; 127 } 128 129 public void initializeProperties() {} 130 131 } 132 | Popular Tags |