1 12 package org.eclipse.pde.internal.build.tasks; 13 14 import java.util.Locale ; 15 16 import org.apache.tools.ant.BuildException; 17 import org.apache.tools.ant.Task; 18 19 public class JNLPGeneratorTask extends Task { 20 21 private String feature; 22 private String jnlp = null; 23 private String codebase = null; 24 private String j2se; 25 private Locale locale = Locale.getDefault(); 26 private boolean generateOfflineAllowed = true; 27 private String configs = null; 28 29 34 public void setFeature(String value) { 35 feature = value; 36 } 37 38 48 public void setJNLP(String value) { 49 jnlp = value; 50 } 51 52 58 public void setCodebase(String value) { 59 codebase = value; 60 } 61 62 66 public void setJ2SE(String value) { 67 j2se = value; 68 } 69 70 75 public void setLocale(String nlsString) { 76 String [] strings = nlsString.split("_"); if (nlsString.charAt(0) == '$') 78 return; 79 80 if (strings != null) { 81 switch (strings.length) { 82 case 1: 83 locale = new Locale (strings[0]); 84 break; 85 case 2: 86 locale = new Locale (strings[0], strings[1]); 87 break; 88 case 3: 89 locale = new Locale (strings[0], strings[1], strings[2]); 90 break; 91 } 92 } 93 } 94 95 public void execute() throws BuildException { 96 JNLPGenerator generator = new JNLPGenerator(feature, jnlp, codebase, j2se, locale, generateOfflineAllowed, configs); 97 generator.process(); 98 } 99 100 public void setGenerateOfflineAllowed(String generateOfflineAllowed) { 101 if (generateOfflineAllowed.equalsIgnoreCase("false")) this.generateOfflineAllowed = false; 103 if (generateOfflineAllowed.equalsIgnoreCase("true")) this.generateOfflineAllowed = false; 105 } 106 107 public void setConfigInfo(String configs) { 108 this.configs = configs; 109 } 110 111 } 112 | Popular Tags |