|
Lines 25-99
Link Here
|
| 25 |
public class ProductFile extends DefaultHandler implements IPDEBuildConstants { |
25 |
public class ProductFile extends DefaultHandler implements IPDEBuildConstants { |
| 26 |
private final static SAXParserFactory parserFactory = SAXParserFactory.newInstance(); |
26 |
private final static SAXParserFactory parserFactory = SAXParserFactory.newInstance(); |
| 27 |
|
27 |
|
|
|
28 |
private static final String PROGRAM_ARGS = "programArgs"; //$NON-NLS-1$ |
| 29 |
private static final String PROGRAM_ARGS_LINUX = "programArgsLin"; //$NON-NLS-1$ |
| 30 |
private static final String PROGRAM_ARGS_MAC = "programArgsMac"; //$NON-NLS-1$ |
| 31 |
private static final String PROGRAM_ARGS_SOLARIS = "programArgsSol"; //$NON-NLS-1$ |
| 32 |
private static final String PROGRAM_ARGS_WIN = "programArgsWin"; //$NON-NLS-1$ |
| 33 |
private static final String VM_ARGS = "vmArgs"; //$NON-NLS-1$ |
| 34 |
private static final String VM_ARGS_LINUX = "vmArgsLin"; //$NON-NLS-1$ |
| 35 |
private static final String VM_ARGS_MAC = "vmArgsMac"; //$NON-NLS-1$ |
| 36 |
private static final String VM_ARGS_SOLARIS = "vmArgsSol"; //$NON-NLS-1$ |
| 37 |
private static final String VM_ARGS_WIN = "vmArgsWin"; //$NON-NLS-1$ |
| 38 |
|
| 28 |
private static final String SOLARIS_LARGE = "solarisLarge"; //$NON-NLS-1$ |
39 |
private static final String SOLARIS_LARGE = "solarisLarge"; //$NON-NLS-1$ |
| 29 |
private static final String SOLARIS_MEDIUM = "solarisMedium"; //$NON-NLS-1$ |
40 |
private static final String SOLARIS_MEDIUM = "solarisMedium"; //$NON-NLS-1$ |
| 30 |
private static final String SOLARIS_SMALL = "solarisSmall"; //$NON-NLS-1$ |
41 |
private static final String SOLARIS_SMALL = "solarisSmall"; //$NON-NLS-1$ |
| 31 |
private static final String SOLARIS_TINY = "solarisTiny"; //$NON-NLS-1$ |
42 |
private static final String SOLARIS_TINY = "solarisTiny"; //$NON-NLS-1$ |
| 32 |
|
|
|
| 33 |
private static final String WIN32_16_LOW = "winSmallLow"; //$NON-NLS-1$ |
43 |
private static final String WIN32_16_LOW = "winSmallLow"; //$NON-NLS-1$ |
| 34 |
private static final String WIN32_16_HIGH = "winSmallHigh"; //$NON-NLS-1$ |
44 |
private static final String WIN32_16_HIGH = "winSmallHigh"; //$NON-NLS-1$ |
| 35 |
private static final String WIN32_32_LOW = "winMediumLow"; //$NON-NLS-1$ |
45 |
private static final String WIN32_32_LOW = "winMediumLow"; //$NON-NLS-1$ |
| 36 |
private static final String WIN32_32_HIGH = "winMediumHigh"; //$NON-NLS-1$ |
46 |
private static final String WIN32_32_HIGH = "winMediumHigh"; //$NON-NLS-1$ |
| 37 |
private static final String WIN32_48_LOW = "winLargeLow"; //$NON-NLS-1$ |
47 |
private static final String WIN32_48_LOW = "winLargeLow"; //$NON-NLS-1$ |
| 38 |
private static final String WIN32_48_HIGH = "winLargeHigh"; //$NON-NLS-1$ |
48 |
private static final String WIN32_48_HIGH = "winLargeHigh"; //$NON-NLS-1$ |
| 39 |
|
49 |
|
|
|
50 |
private static final String PRODUCT = "product"; //$NON-NLS-1$ |
| 51 |
private static final String CONFIG_INI = "configIni"; //$NON-NLS-1$ |
| 52 |
private static final String LAUNCHER = "launcher"; //$NON-NLS-1$ |
| 53 |
private static final String LAUNCHER_ARGS = "launcherArgs"; //$NON-NLS-1$ |
| 54 |
private static final String PLUGINS = "plugins"; //$NON-NLS-1$ |
| 55 |
private static final String FEATURES = "features"; //$NON-NLS-1$ |
| 56 |
private static final String SPLASH = "splash"; //$NON-NLS-1$ |
| 40 |
private static final String P_USE_ICO = "useIco"; //$NON-NLS-1$ |
57 |
private static final String P_USE_ICO = "useIco"; //$NON-NLS-1$ |
|
|
58 |
|
| 59 |
//These constants form a small state machine to parse the .product file |
| 60 |
private static final int STATE_START = 0; |
| 61 |
private static final int STATE_PRODUCT = 1; |
| 62 |
private static final int STATE_LAUNCHER = 2; |
| 63 |
private static final int STATE_LAUNCHER_ARGS = 3; |
| 64 |
private static final int STATE_PLUGINS = 4; |
| 65 |
private static final int STATE_FEATURES = 5; |
| 66 |
private static final int STATE_PROGRAM_ARGS = 6; |
| 67 |
private static final int STATE_PROGRAM_ARGS_LINUX = 7; |
| 68 |
private static final int STATE_PROGRAM_ARGS_MAC = 8; |
| 69 |
private static final int STATE_PROGRAM_ARGS_SOLARIS = 9; |
| 70 |
private static final int STATE_PROGRAM_ARGS_WIN = 10; |
| 71 |
private static final int STATE_VM_ARGS = 11; |
| 72 |
private static final int STATE_VM_ARGS_LINUX = 12; |
| 73 |
private static final int STATE_VM_ARGS_MAC = 13; |
| 74 |
private static final int STATE_VM_ARGS_SOLARIS = 14; |
| 75 |
private static final int STATE_VM_ARGS_WIN = 15; |
| 76 |
|
| 77 |
private int state = STATE_START; |
| 41 |
|
78 |
|
| 42 |
private SAXParser parser; |
79 |
private SAXParser parser; |
| 43 |
private File location; |
|
|
| 44 |
private String currentOS = null; |
80 |
private String currentOS = null; |
| 45 |
private boolean useIco = false; |
81 |
private boolean useIco = false; |
| 46 |
private ArrayList result = new ArrayList(6); |
82 |
private ArrayList result = new ArrayList(6); |
| 47 |
private String launcherName = null; |
83 |
private String launcherName = ""; //$NON-NLS-1$ |
| 48 |
private String icons[] = null; |
84 |
private String icons[] = null; |
| 49 |
private boolean parsed = false; |
85 |
private String configPath = ""; //$NON-NLS-1$ |
| 50 |
private String configPath = null; |
86 |
private String id = ""; //$NON-NLS-1$ |
| 51 |
private String id = null; |
|
|
| 52 |
private boolean useFeatures = false; |
87 |
private boolean useFeatures = false; |
| 53 |
private List plugins = null; |
88 |
private List plugins = null; |
| 54 |
private List features = null; |
89 |
private List features = null; |
| 55 |
private String splashLocation = null; |
90 |
private String splashLocation = ""; //$NON-NLS-1$ |
| 56 |
private String productName; |
91 |
private String productName = ""; //$NON-NLS-1$ |
|
|
92 |
|
| 93 |
private Properties launcherArgs = null; |
| 94 |
|
| 95 |
private static String normalize(String text) { |
| 96 |
if (text == null || text.trim().length() == 0) |
| 97 |
return ""; //$NON-NLS-1$ |
| 57 |
|
98 |
|
|
|
99 |
text = text.replaceAll("\\r|\\n|\\f|\\t", " "); //$NON-NLS-1$ //$NON-NLS-2$ |
| 100 |
return text.replaceAll("\\s+", " "); //$NON-NLS-1$ //$NON-NLS-2$ |
| 101 |
} |
| 102 |
|
| 58 |
/** |
103 |
/** |
| 59 |
* Constructs a feature parser. |
104 |
* Constructs a feature parser. |
| 60 |
*/ |
105 |
*/ |
| 61 |
public ProductFile(String location, String os) throws CoreException { |
106 |
public ProductFile(String location, String os) throws CoreException { |
| 62 |
super(); |
107 |
super(); |
| 63 |
this.location = new File(location); |
|
|
| 64 |
this.currentOS = os; |
108 |
this.currentOS = os; |
| 65 |
try { |
109 |
try { |
| 66 |
parserFactory.setNamespaceAware(true); |
110 |
parserFactory.setNamespaceAware(true); |
| 67 |
parser = parserFactory.newSAXParser(); |
111 |
parser = parserFactory.newSAXParser(); |
|
|
112 |
InputStream in = new FileInputStream(location); |
| 113 |
parser.parse(new InputSource(in), this); |
| 68 |
} catch (ParserConfigurationException e) { |
114 |
} catch (ParserConfigurationException e) { |
| 69 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, e.getLocalizedMessage(), e)); |
115 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, e.getLocalizedMessage(), e)); |
| 70 |
} catch (SAXException e) { |
116 |
} catch (SAXException e) { |
| 71 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, e.getLocalizedMessage(), e)); |
117 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, e.getLocalizedMessage(), e)); |
|
|
118 |
} catch (FileNotFoundException e) { |
| 119 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, e.getLocalizedMessage(), e)); |
| 120 |
} catch (IOException e) { |
| 121 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, e.getLocalizedMessage(), e)); |
| 72 |
} |
122 |
} |
| 73 |
} |
123 |
} |
| 74 |
|
124 |
|
| 75 |
public String getLauncherName() { |
125 |
public String getLauncherName() { |
| 76 |
if (parsed) |
|
|
| 77 |
return launcherName; |
| 78 |
parse(); |
| 79 |
return launcherName; |
126 |
return launcherName; |
| 80 |
} |
127 |
} |
| 81 |
|
128 |
|
| 82 |
public List getPlugins() { |
129 |
public List getPlugins() { |
| 83 |
if(!parsed) |
130 |
if (plugins == null) |
| 84 |
parse(); |
131 |
return Collections.EMPTY_LIST; |
| 85 |
return plugins; |
132 |
return plugins; |
| 86 |
} |
133 |
} |
| 87 |
|
134 |
|
| 88 |
public List getFeatures() { |
135 |
public List getFeatures() { |
| 89 |
if(!parsed) |
136 |
if(features == null) |
| 90 |
parse(); |
137 |
return Collections.EMPTY_LIST; |
| 91 |
return features; |
138 |
return features; |
| 92 |
} |
139 |
} |
| 93 |
|
140 |
|
| 94 |
public boolean containsPlugin(String plugin) { |
141 |
public boolean containsPlugin(String plugin) { |
| 95 |
if(!parsed) |
|
|
| 96 |
parse(); |
| 97 |
return plugins != null && plugins.contains(plugin); |
142 |
return plugins != null && plugins.contains(plugin); |
| 98 |
} |
143 |
} |
| 99 |
|
144 |
|
|
Lines 103-110
Link Here
|
| 103 |
public String[] getIcons() { |
148 |
public String[] getIcons() { |
| 104 |
if (icons != null) |
149 |
if (icons != null) |
| 105 |
return icons; |
150 |
return icons; |
| 106 |
if (!parsed) |
|
|
| 107 |
parse(); |
| 108 |
String[] temp = new String[result.size()]; |
151 |
String[] temp = new String[result.size()]; |
| 109 |
int i = 0; |
152 |
int i = 0; |
| 110 |
for (Iterator iter = result.iterator(); iter.hasNext();) { |
153 |
for (Iterator iter = result.iterator(); iter.hasNext();) { |
|
Lines 118-199
Link Here
|
| 118 |
} |
161 |
} |
| 119 |
|
162 |
|
| 120 |
public String getConfigIniPath() { |
163 |
public String getConfigIniPath() { |
| 121 |
if (!parsed) |
|
|
| 122 |
parse(); |
| 123 |
return configPath; |
164 |
return configPath; |
| 124 |
} |
165 |
} |
| 125 |
|
166 |
|
| 126 |
public String getId() { |
167 |
public String getId() { |
| 127 |
if (!parsed) |
|
|
| 128 |
parse(); |
| 129 |
return id; |
168 |
return id; |
| 130 |
} |
169 |
} |
| 131 |
|
170 |
|
| 132 |
public String getSplashLocation() { |
171 |
public String getSplashLocation() { |
| 133 |
if (!parsed) |
|
|
| 134 |
parse(); |
| 135 |
return splashLocation; |
172 |
return splashLocation; |
| 136 |
} |
173 |
} |
| 137 |
|
174 |
|
| 138 |
public String getProductName() { |
175 |
public String getProductName() { |
| 139 |
if (!parsed) |
|
|
| 140 |
parse(); |
| 141 |
return productName; |
176 |
return productName; |
| 142 |
} |
177 |
} |
| 143 |
|
178 |
|
| 144 |
public boolean useFeatures() { |
179 |
public boolean useFeatures() { |
| 145 |
if (!parsed) |
|
|
| 146 |
parse(); |
| 147 |
return useFeatures; |
180 |
return useFeatures; |
| 148 |
} |
181 |
} |
| 149 |
|
182 |
|
| 150 |
private void parse() { |
183 |
public String getVMArguments(String os) { |
| 151 |
// mark us as parsed. If we fail this time it is likely we will fail next time |
184 |
String key = null; |
| 152 |
// so don't even bother. |
185 |
if( os.equals(Platform.OS_WIN32)){ |
| 153 |
parsed = true; |
186 |
key = VM_ARGS_WIN; |
| 154 |
InputStream in = null; |
187 |
} else if( os.equals(Platform.OS_LINUX)) { |
| 155 |
try { |
188 |
key = VM_ARGS_LINUX; |
| 156 |
in = new FileInputStream(location); |
189 |
} else if( os.equals(Platform.OS_MACOSX)) { |
| 157 |
try { |
190 |
key = VM_ARGS_MAC; |
| 158 |
parser.parse(new InputSource(in), this); |
191 |
} else if(os.equals(Platform.OS_SOLARIS)) { |
| 159 |
} catch (SAXException e) { |
192 |
key = VM_ARGS_SOLARIS; |
| 160 |
//Ignore |
|
|
| 161 |
} finally { |
| 162 |
in.close(); |
| 163 |
} |
| 164 |
} catch (IOException e) { |
| 165 |
//Ignore |
| 166 |
} |
193 |
} |
|
|
194 |
|
| 195 |
String prefix = launcherArgs.getProperty(VM_ARGS); |
| 196 |
String platform = launcherArgs.getProperty(key); |
| 197 |
String args = null; |
| 198 |
if (prefix != null) |
| 199 |
args = platform != null ? prefix + " " + platform : prefix; //$NON-NLS-1$ |
| 200 |
else |
| 201 |
args = platform != null ? platform : ""; //$NON-NLS-1$ |
| 202 |
return normalize(args); |
| 167 |
} |
203 |
} |
| 168 |
|
204 |
|
|
|
205 |
public String getProgramArguments(String os) { |
| 206 |
String key = null; |
| 207 |
if( os.equals(Platform.OS_WIN32)){ |
| 208 |
key = PROGRAM_ARGS_WIN; |
| 209 |
} else if( os.equals(Platform.OS_LINUX)) { |
| 210 |
key = PROGRAM_ARGS_LINUX; |
| 211 |
} else if( os.equals(Platform.OS_MACOSX)) { |
| 212 |
key = PROGRAM_ARGS_MAC; |
| 213 |
} else if(os.equals(Platform.OS_SOLARIS)) { |
| 214 |
key = PROGRAM_ARGS_SOLARIS; |
| 215 |
} |
| 216 |
|
| 217 |
String prefix = launcherArgs.getProperty(PROGRAM_ARGS); |
| 218 |
String platform = launcherArgs.getProperty(key); |
| 219 |
String args = null; |
| 220 |
if (prefix != null) |
| 221 |
args = platform != null ? prefix + " " + platform : prefix; //$NON-NLS-1$ |
| 222 |
else |
| 223 |
args = platform != null ? platform : ""; //$NON-NLS-1$ |
| 224 |
return normalize(args); |
| 225 |
} |
| 226 |
|
| 169 |
public void startElement(String uri, String localName, String qName, Attributes attributes) { |
227 |
public void startElement(String uri, String localName, String qName, Attributes attributes) { |
| 170 |
if ("launcher".equals(localName)) { //$NON-NLS-1$ |
228 |
switch (state) { |
| 171 |
processLauncher(attributes); |
229 |
case STATE_START : |
| 172 |
} else if ("solaris".equals(localName)) { //$NON-NLS-1$ |
230 |
if (PRODUCT.equals(localName)) { |
| 173 |
processSolaris(attributes); |
231 |
processProduct(attributes); |
| 174 |
} else if ("win".equals(localName)) { //$NON-NLS-1$ |
232 |
state = STATE_PRODUCT; |
| 175 |
processWin(attributes); |
233 |
} |
| 176 |
} else if ("linux".equals(localName)) { //$NON-NLS-1$ |
234 |
break; |
| 177 |
processLinux(attributes); |
235 |
|
| 178 |
} else if ("macosx".equals(localName)) { //$NON-NLS-1$ |
236 |
case STATE_PRODUCT : |
| 179 |
processMac(attributes); |
237 |
if (CONFIG_INI.equals(localName)) { |
| 180 |
} else if ("ico".equals(localName)) { //$NON-NLS-1$ |
238 |
processConfigIni(attributes); |
| 181 |
processIco(attributes); |
239 |
} else if (LAUNCHER.equals(localName)) { |
| 182 |
} else if ("bmp".equals(localName)) { //$NON-NLS-1$ |
240 |
processLauncher(attributes); |
| 183 |
processBmp(attributes); |
241 |
state = STATE_LAUNCHER; |
| 184 |
} else if ("configIni".equals(localName)) { //$NON-NLS-1$ |
242 |
} else if (PLUGINS.equals(localName)) { |
| 185 |
processConfigIni(attributes); |
243 |
state = STATE_PLUGINS; |
| 186 |
} else if ("product".equals(localName)) { //$NON-NLS-1$ |
244 |
} else if (FEATURES.equals(localName)) { |
| 187 |
processProduct(attributes); |
245 |
state = STATE_FEATURES; |
| 188 |
} else if ("plugin".equals(localName)) { //$NON-NLS-1$ |
246 |
} else if (LAUNCHER_ARGS.equals(localName)) { |
| 189 |
processPlugin(attributes); |
247 |
state = STATE_LAUNCHER_ARGS; |
| 190 |
} else if ("splash".equals(localName)) { //$NON-NLS-1$ |
248 |
} else if (SPLASH.equals(localName)) { |
| 191 |
splashLocation = attributes.getValue("location"); //$NON-NLS-1$ |
249 |
splashLocation = attributes.getValue("location"); //$NON-NLS-1$ |
| 192 |
} else if ("feature".equals(localName)) { //$NON-NLS-1$ |
250 |
} |
| 193 |
processFeature(attributes); |
251 |
break; |
|
|
252 |
|
| 253 |
case STATE_LAUNCHER : |
| 254 |
if (Platform.OS_SOLARIS.equals(localName)) { |
| 255 |
processSolaris(attributes); |
| 256 |
} else if (Platform.OS_WIN32.equals(localName)) { |
| 257 |
processWin(attributes); |
| 258 |
} else if (Platform.OS_LINUX.equals(localName)) { |
| 259 |
processLinux(attributes); |
| 260 |
} else if (Platform.OS_MACOSX.equals(localName)) { |
| 261 |
processMac(attributes); |
| 262 |
} |
| 263 |
if ("ico".equals(localName)) { //$NON-NLS-1$ |
| 264 |
processIco(attributes); |
| 265 |
} else if ("bmp".equals(localName)) { //$NON-NLS-1$ |
| 266 |
processBmp(attributes); |
| 267 |
} |
| 268 |
break; |
| 269 |
|
| 270 |
case STATE_LAUNCHER_ARGS : |
| 271 |
if (PROGRAM_ARGS.equals(localName)) { |
| 272 |
state = STATE_PROGRAM_ARGS; |
| 273 |
} else if (PROGRAM_ARGS_LINUX.equals(localName)) { |
| 274 |
state = STATE_PROGRAM_ARGS_LINUX; |
| 275 |
} else if (PROGRAM_ARGS_MAC.equals(localName)) { |
| 276 |
state = STATE_PROGRAM_ARGS_MAC; |
| 277 |
} else if (PROGRAM_ARGS_SOLARIS.equals(localName)) { |
| 278 |
state = STATE_PROGRAM_ARGS_SOLARIS; |
| 279 |
} else if (PROGRAM_ARGS_WIN.equals(localName)) { |
| 280 |
state = STATE_PROGRAM_ARGS_WIN; |
| 281 |
} else if (VM_ARGS.equals(localName)) { |
| 282 |
state = STATE_VM_ARGS; |
| 283 |
} else if (VM_ARGS_LINUX.equals(localName)) { |
| 284 |
state = STATE_VM_ARGS_LINUX; |
| 285 |
} else if (VM_ARGS_MAC.equals(localName)) { |
| 286 |
state = STATE_VM_ARGS_MAC; |
| 287 |
} else if (VM_ARGS_SOLARIS.equals(localName)) { |
| 288 |
state = STATE_VM_ARGS_SOLARIS; |
| 289 |
} else if (VM_ARGS_WIN.equals(localName)) { |
| 290 |
state = STATE_VM_ARGS_WIN; |
| 291 |
} |
| 292 |
break; |
| 293 |
|
| 294 |
case STATE_PLUGINS : |
| 295 |
if ("plugin".equals(localName)) { //$NON-NLS-1$ |
| 296 |
processPlugin(attributes); |
| 297 |
} |
| 298 |
break; |
| 299 |
|
| 300 |
case STATE_FEATURES : |
| 301 |
if ("feature".equals(localName)) { //$NON-NLS-1$ |
| 302 |
processFeature(attributes); |
| 303 |
} |
| 304 |
break; |
| 194 |
} |
305 |
} |
| 195 |
} |
306 |
} |
| 196 |
|
307 |
|
|
|
308 |
public void endElement(String uri, String localName, String qName) { |
| 309 |
switch (state) { |
| 310 |
case STATE_PLUGINS : |
| 311 |
if (PLUGINS.equals(localName)) |
| 312 |
state = STATE_PRODUCT; |
| 313 |
break; |
| 314 |
case STATE_FEATURES : |
| 315 |
if (FEATURES.equals(localName)) |
| 316 |
state = STATE_PRODUCT; |
| 317 |
break; |
| 318 |
case STATE_LAUNCHER_ARGS : |
| 319 |
if (LAUNCHER_ARGS.equals(localName)) |
| 320 |
state = STATE_PRODUCT; |
| 321 |
break; |
| 322 |
case STATE_LAUNCHER : |
| 323 |
if (LAUNCHER.equals(localName)) |
| 324 |
state = STATE_PRODUCT; |
| 325 |
break; |
| 326 |
|
| 327 |
case STATE_PROGRAM_ARGS : |
| 328 |
case STATE_PROGRAM_ARGS_LINUX : |
| 329 |
case STATE_PROGRAM_ARGS_MAC : |
| 330 |
case STATE_PROGRAM_ARGS_SOLARIS : |
| 331 |
case STATE_PROGRAM_ARGS_WIN : |
| 332 |
case STATE_VM_ARGS : |
| 333 |
case STATE_VM_ARGS_LINUX : |
| 334 |
case STATE_VM_ARGS_MAC : |
| 335 |
case STATE_VM_ARGS_SOLARIS : |
| 336 |
case STATE_VM_ARGS_WIN : |
| 337 |
state = STATE_LAUNCHER_ARGS; |
| 338 |
break; |
| 339 |
} |
| 340 |
} |
| 341 |
|
| 342 |
public void characters(char[] ch, int start, int length) { |
| 343 |
switch (state) { |
| 344 |
case STATE_PROGRAM_ARGS : |
| 345 |
addLaunchArgumentToMap(PROGRAM_ARGS, String.valueOf(ch, start, length)); |
| 346 |
break; |
| 347 |
case STATE_PROGRAM_ARGS_LINUX : |
| 348 |
addLaunchArgumentToMap(PROGRAM_ARGS_LINUX, String.valueOf(ch, start, length)); |
| 349 |
break; |
| 350 |
case STATE_PROGRAM_ARGS_MAC : |
| 351 |
addLaunchArgumentToMap(PROGRAM_ARGS_MAC, String.valueOf(ch, start, length)); |
| 352 |
break; |
| 353 |
case STATE_PROGRAM_ARGS_SOLARIS : |
| 354 |
addLaunchArgumentToMap(PROGRAM_ARGS_SOLARIS, String.valueOf(ch, start, length)); |
| 355 |
break; |
| 356 |
case STATE_PROGRAM_ARGS_WIN : |
| 357 |
addLaunchArgumentToMap(PROGRAM_ARGS_WIN, String.valueOf(ch, start, length)); |
| 358 |
break; |
| 359 |
case STATE_VM_ARGS : |
| 360 |
addLaunchArgumentToMap(VM_ARGS, String.valueOf(ch, start, length)); |
| 361 |
break; |
| 362 |
case STATE_VM_ARGS_LINUX : |
| 363 |
addLaunchArgumentToMap(VM_ARGS_LINUX, String.valueOf(ch, start, length)); |
| 364 |
break; |
| 365 |
case STATE_VM_ARGS_MAC : |
| 366 |
addLaunchArgumentToMap(VM_ARGS_MAC, String.valueOf(ch, start, length)); |
| 367 |
break; |
| 368 |
case STATE_VM_ARGS_SOLARIS : |
| 369 |
addLaunchArgumentToMap(VM_ARGS_SOLARIS, String.valueOf(ch, start, length)); |
| 370 |
break; |
| 371 |
case STATE_VM_ARGS_WIN : |
| 372 |
addLaunchArgumentToMap(VM_ARGS_WIN, String.valueOf(ch, start, length)); |
| 373 |
break; |
| 374 |
} |
| 375 |
} |
| 376 |
|
| 377 |
private void addLaunchArgumentToMap(String key, String value) { |
| 378 |
if (launcherArgs == null) |
| 379 |
launcherArgs = new Properties(); |
| 380 |
|
| 381 |
String oldValue = launcherArgs.getProperty(key); |
| 382 |
if (oldValue != null) |
| 383 |
launcherArgs.setProperty(key, oldValue + value); |
| 384 |
else |
| 385 |
launcherArgs.setProperty(key, value); |
| 386 |
} |
| 197 |
private void processPlugin(Attributes attributes) { |
387 |
private void processPlugin(Attributes attributes) { |
| 198 |
if (plugins == null) |
388 |
if (plugins == null) |
| 199 |
plugins = new ArrayList(); |
389 |
plugins = new ArrayList(); |
|
Lines 233-239
Link Here
|
| 233 |
} |
423 |
} |
| 234 |
|
424 |
|
| 235 |
private void processSolaris(Attributes attributes) { |
425 |
private void processSolaris(Attributes attributes) { |
| 236 |
if (!osMatch("solaris")) //$NON-NLS-1$ |
426 |
if (!osMatch(Platform.OS_SOLARIS)) |
| 237 |
return; |
427 |
return; |
| 238 |
result.add(attributes.getValue(SOLARIS_LARGE)); |
428 |
result.add(attributes.getValue(SOLARIS_LARGE)); |
| 239 |
result.add(attributes.getValue(SOLARIS_MEDIUM)); |
429 |
result.add(attributes.getValue(SOLARIS_MEDIUM)); |
|
Lines 242-260
Link Here
|
| 242 |
} |
432 |
} |
| 243 |
|
433 |
|
| 244 |
private void processWin(Attributes attributes) { |
434 |
private void processWin(Attributes attributes) { |
| 245 |
if (!osMatch("win32")) //$NON-NLS-1$ |
435 |
if (!osMatch(Platform.OS_WIN32)) |
| 246 |
return; |
436 |
return; |
| 247 |
useIco = "true".equals(attributes.getValue(P_USE_ICO)); //$NON-NLS-1$ |
437 |
useIco = IBuildPropertiesConstants.TRUE.equalsIgnoreCase(attributes.getValue(P_USE_ICO)); |
| 248 |
} |
438 |
} |
| 249 |
|
439 |
|
| 250 |
private void processIco(Attributes attributes) { |
440 |
private void processIco(Attributes attributes) { |
| 251 |
if (!osMatch("win32") || !useIco) //$NON-NLS-1$ |
441 |
if (!osMatch(Platform.OS_WIN32) || !useIco) |
| 252 |
return; |
442 |
return; |
| 253 |
result.add(attributes.getValue("path")); //$NON-NLS-1$ |
443 |
result.add(attributes.getValue("path")); //$NON-NLS-1$ |
| 254 |
} |
444 |
} |
| 255 |
|
445 |
|
| 256 |
private void processBmp(Attributes attributes) { |
446 |
private void processBmp(Attributes attributes) { |
| 257 |
if (!osMatch("win32") || useIco) //$NON-NLS-1$ |
447 |
if (!osMatch(Platform.OS_WIN32) || useIco) |
| 258 |
return; |
448 |
return; |
| 259 |
result.add(attributes.getValue(WIN32_16_HIGH)); |
449 |
result.add(attributes.getValue(WIN32_16_HIGH)); |
| 260 |
result.add(attributes.getValue(WIN32_16_LOW)); |
450 |
result.add(attributes.getValue(WIN32_16_LOW)); |
|
Lines 265-277
Link Here
|
| 265 |
} |
455 |
} |
| 266 |
|
456 |
|
| 267 |
private void processLinux(Attributes attributes) { |
457 |
private void processLinux(Attributes attributes) { |
| 268 |
if (!osMatch("linux")) //$NON-NLS-1$ |
458 |
if (!osMatch(Platform.OS_LINUX)) |
| 269 |
return; |
459 |
return; |
| 270 |
result.add(attributes.getValue("icon")); //$NON-NLS-1$ |
460 |
result.add(attributes.getValue("icon")); //$NON-NLS-1$ |
| 271 |
} |
461 |
} |
| 272 |
|
462 |
|
| 273 |
private void processMac(Attributes attributes) { |
463 |
private void processMac(Attributes attributes) { |
| 274 |
if (!osMatch("macosx")) //$NON-NLS-1$ |
464 |
if (!osMatch(Platform.OS_MACOSX)) |
| 275 |
return; |
465 |
return; |
| 276 |
result.add(attributes.getValue("icon")); //$NON-NLS-1$ |
466 |
result.add(attributes.getValue("icon")); //$NON-NLS-1$ |
| 277 |
} |
467 |
} |