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.*; 31 import org.openide.compiler.Compiler; 32 import org.openide.execution.NbProcessDescriptor; 33 34 public class XMLCCompilerGroup extends ExternalCompilerGroup { 35 36 private String myOpt = null; 38 public void add (Compiler c) throws IllegalArgumentException { 39 super.add (c); 41 if (! (c instanceof XMLCCompiler)) throw new IllegalArgumentException (); 42 XMLCCompiler comp = (XMLCCompiler) c; 43 myOpt = comp.getMyOpt (); 46 } 47 48 protected Process createProcess (NbProcessDescriptor desc, String [] files) throws IOException { 49 return desc.exec (new Format (files, myOpt)); 50 } 51 52 public static class Format extends ExternalCompilerGroup.Format { 53 54 public static final String TAG_MYOPTIONVAL = "myOpt"; 55 56 public Format (String [] files, String myOpt) { 57 super (files); 58 Map map = getMap (); 59 map.put (TAG_MYOPTIONVAL, myOpt); 60 } 61 62 } 63 64 } 65 | Popular Tags |