1 23 24 package org.enhydra.kelp.forte.services; 25 26 import java.io.File ; 27 import java.io.IOException ; 28 import java.util.Map ; 29 30 import org.openide.compiler.ExternalCompilerType; 31 import org.openide.compiler.CompilerType; 32 import org.openide.compiler.Compiler; 33 import org.openide.compiler.*; 34 import org.openide.cookies.CompilerCookie; 35 import org.openide.execution.NbProcessDescriptor; 36 import org.openide.loaders.DataObject; 37 import org.openide.util.HelpCtx; 38 import org.openide.util.NbBundle; 39 40 44 public class XMLCCompilerType extends ExternalCompilerType { 45 46 static final long serialVersionUID = -2979099777437824015L; 48 59 61 66 90 91 private static final NbProcessDescriptor DEFAULT = new NbProcessDescriptor ( 92 "{" + ExternalCompilerGroup.Format.TAG_JAVAHOME + "}{" + ExternalCompilerGroup.Format.TAG_SEPARATOR + 95 "}bin{" + ExternalCompilerGroup.Format.TAG_SEPARATOR + "}javac", 96 "-cp {" + ExternalCompilerGroup.Format.TAG_REPOSITORY + "}" + 99 "{" + ExternalCompilerGroup.Format.TAG_PATHSEPARATOR + "}" + "{" + ExternalCompilerGroup.Format.TAG_CLASSPATH + "}" + 100 "{" + ExternalCompilerGroup.Format.TAG_PATHSEPARATOR + "}" + "{" + ExternalCompilerGroup.Format.TAG_LIBRARY + "}" + 101 "{" + ExternalCompilerGroup.Format.TAG_PATHSEPARATOR + "}" + "{" + ExternalCompilerGroup.Format.TAG_BOOTCLASSPATH + "} " + 102 "{" + ExternalCompilerGroup.Format.TAG_FILES + '}', 106 NbBundle.getMessage (XMLCCompilerType.class, "MSG_format_hint") 108 ); 109 110 private String valueOfMyOption = "someDefaultValue"; 112 113 public XMLCCompilerType() 114 { 115 setExternalCompiler (DEFAULT); 117 121 } 122 123 public String getValueOfMyOption () { 124 return valueOfMyOption; 125 } 126 127 public synchronized void setValueOfMyOption (String nue) { 128 String old = valueOfMyOption; 129 valueOfMyOption = nue; 130 firePropertyChange ("valueOfMyOption", old, nue); 131 } 132 133 152 153 158 159 public void prepareJob (CompilerJob job, Class type, DataObject obj) { 160 Compiler cleaner; 161 if (type.equals (CompilerCookie.Clean.class) || 162 type.equals (CompilerCookie.Build.class)) { 163 cleaner = new XMLCCleanCompiler (obj.getPrimaryFile ()); 164 job.add (cleaner); 165 } else { 166 cleaner = null; 167 } 168 if (type.equals (CompilerCookie.Compile.class) || 169 type.equals (CompilerCookie.Build.class)) { 170 Compiler compiler = new XMLCCompiler 171 (false, obj.getPrimaryFile (), getExternalCompiler (), getErrorExpression (), getValueOfMyOption ()); 172 job.add (compiler); 173 if (cleaner != null) compiler.dependsOn (cleaner); 174 } else if (cleaner == null) { 175 } 177 } 178 179 } 180 | Popular Tags |