1 22 package org.enhydra.kelp.jbuilder.properties; 23 24 import com.borland.primetime.ide.Browser; 26 import com.borland.primetime.node.TextFileNode; 27 import com.borland.primetime.node.Node; 28 import com.borland.primetime.node.Project; 29 import com.borland.primetime.properties.PropertyPageFactory; 30 import com.borland.primetime.properties.PropertyPage; 31 import com.borland.primetime.properties.PropertyManager; 32 import com.borland.primetime.properties.PropertyGroup; 33 34 import org.enhydra.kelp.KelpInfo; 36 import org.enhydra.kelp.common.PathUtil; 37 import org.enhydra.kelp.common.node.OtterProject; 38 import org.enhydra.kelp.common.node.OtterTextFileNode; 39 import org.enhydra.kelp.jbuilder.node.PrimeProject; 40 import org.enhydra.kelp.jbuilder.node.PrimeTextFileNode; 41 42 import java.io.File ; 44 import java.util.ResourceBundle ; 45 public class DodsProperties implements PropertyGroup { 46 static ResourceBundle res = 47 ResourceBundle.getBundle("org.enhydra.kelp.jbuilder.Res"); 49 public DodsProperties() {} 50 51 54 public static void initOpenTool(byte majorVersion, byte minorVersion) { 55 if (KelpInfo.isClassPathComplete()) { 56 PropertyManager.registerPropertyGroup(new DodsProperties()); 57 } 58 } 59 60 64 public PropertyPageFactory getPageFactory(final Object topic) { 65 PropertyPageFactory factory = null; 66 TextFileNode nativeTextNode = null; 67 OtterTextFileNode otterNode = null; 68 69 if (topic instanceof TextFileNode) { 70 nativeTextNode = (TextFileNode) topic; 71 otterNode = new PrimeTextFileNode(nativeTextNode); 72 if (PathUtil.isTemplate(otterNode)) { 73 factory = 74 (new PropertyPageFactory("Input Template") { 75 public PropertyPage createPropertyPage() { 76 return new TemplateNodePropertyPage(topic); 77 } 78 79 }); 80 } 81 } else if (topic instanceof Project) { 82 83 factory = 85 (new PropertyPageFactory("Kelp DODS generator") { 86 public PropertyPage createPropertyPage() { 87 return new DodsProjectPropertyPage(topic); 88 } 89 90 }); 91 } 92 return factory; 93 } 94 95 public void initializeProperties() {} 96 97 } 98 | Popular Tags |