Removed
Link Here
|
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2005, 2009 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
7 |
* |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.pde.internal.ui.launcher; |
12 |
|
13 |
import java.io.*; |
14 |
import java.net.URL; |
15 |
import java.util.*; |
16 |
import org.eclipse.core.runtime.*; |
17 |
import org.eclipse.core.variables.IStringVariableManager; |
18 |
import org.eclipse.core.variables.VariablesPlugin; |
19 |
import org.eclipse.debug.core.ILaunchConfiguration; |
20 |
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; |
21 |
import org.eclipse.osgi.service.resolver.BundleDescription; |
22 |
import org.eclipse.pde.core.plugin.IPluginModelBase; |
23 |
import org.eclipse.pde.core.plugin.TargetPlatform; |
24 |
import org.eclipse.pde.internal.build.IPDEBuildConstants; |
25 |
import org.eclipse.pde.internal.core.*; |
26 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
27 |
import org.eclipse.pde.ui.launcher.IPDELauncherConstants; |
28 |
|
29 |
/** |
30 |
* Contains helper methods for launching an Eclipse Runtime Workbench |
31 |
*/ |
32 |
public class LaunchConfigurationHelper { |
33 |
|
34 |
private static final String PROP_OSGI_FRAMEWORK = "osgi.framework"; //$NON-NLS-1$ |
35 |
private static final String PROP_OSGI_BUNDLES = "osgi.bundles"; //$NON-NLS-1$ |
36 |
private static final String PROP_P2_DATA_AREA = "eclipse.p2.data.area"; //$NON-NLS-1$ |
37 |
|
38 |
public static void synchronizeManifests(ILaunchConfiguration config, File configDir) { |
39 |
try { |
40 |
String programArgs = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ""); //$NON-NLS-1$ |
41 |
if (programArgs.indexOf("-clean") != -1) //$NON-NLS-1$ |
42 |
return; |
43 |
} catch (CoreException e) { |
44 |
} |
45 |
File dir = new File(configDir, "org.eclipse.osgi/manifests"); //$NON-NLS-1$ |
46 |
if (dir.exists() && dir.isDirectory()) { |
47 |
PDECore.getDefault().getJavaElementChangeListener().synchronizeManifests(dir); |
48 |
} |
49 |
} |
50 |
|
51 |
public static File getConfigurationArea(ILaunchConfiguration config) { |
52 |
File dir = getConfigurationLocation(config); |
53 |
if (!dir.exists()) |
54 |
dir.mkdirs(); |
55 |
return dir; |
56 |
} |
57 |
|
58 |
public static File getConfigurationLocation(ILaunchConfiguration config) { |
59 |
//bug 170213 change config location if config name contains # |
60 |
String configName = config.getName(); |
61 |
configName = configName.replace('#', 'h'); |
62 |
File dir = new File(PDECore.getDefault().getStateLocation().toOSString(), configName); |
63 |
try { |
64 |
if (!config.getAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, true)) { |
65 |
String userPath = config.getAttribute(IPDELauncherConstants.CONFIG_LOCATION, (String) null); |
66 |
if (userPath != null) { |
67 |
userPath = getSubstitutedString(userPath); |
68 |
dir = new File(userPath).getAbsoluteFile(); |
69 |
} |
70 |
} |
71 |
} catch (CoreException e) { |
72 |
} |
73 |
return dir; |
74 |
} |
75 |
|
76 |
private static String getSubstitutedString(String text) throws CoreException { |
77 |
if (text == null) |
78 |
return ""; //$NON-NLS-1$ |
79 |
IStringVariableManager mgr = VariablesPlugin.getDefault().getStringVariableManager(); |
80 |
return mgr.performStringSubstitution(text); |
81 |
} |
82 |
|
83 |
public static Properties createConfigIniFile(ILaunchConfiguration configuration, String productID, Map bundles, Map bundlesWithStartLevels, File directory) throws CoreException { |
84 |
Properties properties = null; |
85 |
// if we are to generate a config.ini, start with the values in the target platform's config.ini - bug 141918 |
86 |
if (configuration.getAttribute(IPDELauncherConstants.CONFIG_GENERATE_DEFAULT, true)) { |
87 |
properties = TargetPlatformHelper.getConfigIniProperties(); |
88 |
// if target's config.ini does not exist, lets try to fill in default values |
89 |
if (properties == null) |
90 |
properties = new Properties(); |
91 |
// keep properties only if we are launching the default product (bug 175437) |
92 |
else if (productID == null || !productID.equals(properties.get("eclipse.product"))) //$NON-NLS-1$ |
93 |
properties.clear(); |
94 |
// if target's config.ini has the osgi.bundles header, then parse and compute the proper osgi.bundles value |
95 |
String bundleList = properties.getProperty(PROP_OSGI_BUNDLES); |
96 |
if (bundleList != null) |
97 |
properties.setProperty(PROP_OSGI_BUNDLES, computeOSGiBundles(TargetPlatformHelper.stripPathInformation(bundleList), bundles, bundlesWithStartLevels)); |
98 |
String dataArea = properties.getProperty(PROP_P2_DATA_AREA); |
99 |
if (dataArea != null) { |
100 |
// Make the p2 data area in the configuration area itself, rather than a sibling of the configuration |
101 |
// area (which is a the root pde.core shared metadata area) @see bug 272810 |
102 |
properties.setProperty(PROP_P2_DATA_AREA, "@config.dir/.p2"); //$NON-NLS-1$ |
103 |
} |
104 |
} else { |
105 |
String templateLoc = configuration.getAttribute(IPDELauncherConstants.CONFIG_TEMPLATE_LOCATION, (String) null); |
106 |
if (templateLoc != null) { |
107 |
properties = loadFromTemplate(getSubstitutedString(templateLoc)); |
108 |
// if template contains osgi.bundles, then only strip the path, do not compute the value |
109 |
String osgiBundles = properties.getProperty(PROP_OSGI_BUNDLES); |
110 |
if (osgiBundles != null) |
111 |
properties.setProperty(PROP_OSGI_BUNDLES, TargetPlatformHelper.stripPathInformation(osgiBundles)); |
112 |
} |
113 |
} |
114 |
// whether we create a new config.ini or read from one as a template, we should add the required properties - bug 161265 |
115 |
if (properties != null) { |
116 |
addRequiredProperties(properties, productID, bundles, bundlesWithStartLevels); |
117 |
} else { |
118 |
properties = new Properties(); |
119 |
} |
120 |
if (!directory.exists()) { |
121 |
directory.mkdirs(); |
122 |
} |
123 |
String osgiBundles = properties.getProperty(PROP_OSGI_BUNDLES); |
124 |
int start = configuration.getAttribute(IPDELauncherConstants.DEFAULT_START_LEVEL, 4); |
125 |
properties.put("osgi.bundles.defaultStartLevel", Integer.toString(start)); //$NON-NLS-1$ |
126 |
boolean autostart = configuration.getAttribute(IPDELauncherConstants.DEFAULT_AUTO_START, false); |
127 |
|
128 |
// if we are launching using P2, write out P2 files (bundles.txt) and add P2 property to config.ini |
129 |
if (osgiBundles != null && osgiBundles.indexOf(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR) != -1 && bundles.containsKey(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR)) { |
130 |
URL bundlesTxt = null; |
131 |
boolean usedefault = configuration.getAttribute(IPDELauncherConstants.USE_DEFAULT, true); |
132 |
boolean useFeatures = configuration.getAttribute(IPDELauncherConstants.USEFEATURES, false); |
133 |
if (usedefault || useFeatures) { |
134 |
bundlesTxt = P2Utils.writeBundlesTxt(bundlesWithStartLevels, 4, false, directory, osgiBundles); |
135 |
} else { |
136 |
bundlesTxt = P2Utils.writeBundlesTxt(bundlesWithStartLevels, start, autostart, directory, null); |
137 |
} |
138 |
|
139 |
if (bundlesTxt != null) { |
140 |
properties.setProperty("org.eclipse.equinox.simpleconfigurator.configUrl", bundlesTxt.toString()); //$NON-NLS-1$ |
141 |
// if we have simple configurator and update configurator together, ensure update doesn't reconcile |
142 |
if (bundles.get(IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR) != null) { |
143 |
properties.setProperty("org.eclipse.update.reconcile", "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
144 |
} |
145 |
} |
146 |
} |
147 |
|
148 |
setBundleLocations(bundles, properties, autostart); |
149 |
|
150 |
save(new File(directory, "config.ini"), properties); //$NON-NLS-1$ |
151 |
return properties; |
152 |
} |
153 |
|
154 |
private static void addRequiredProperties(Properties properties, String productID, Map bundles, Map bundlesWithStartLevels) { |
155 |
if (!properties.containsKey("osgi.install.area")) //$NON-NLS-1$ |
156 |
properties.setProperty("osgi.install.area", "file:" + TargetPlatform.getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ |
157 |
if (!properties.containsKey("osgi.configuration.cascaded")) //$NON-NLS-1$ |
158 |
properties.setProperty("osgi.configuration.cascaded", "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
159 |
if (!properties.containsKey(PROP_OSGI_FRAMEWORK)) |
160 |
properties.setProperty(PROP_OSGI_FRAMEWORK, IPDEBuildConstants.BUNDLE_OSGI); |
161 |
if (!properties.containsKey("osgi.splashPath") && productID != null) //$NON-NLS-1$ |
162 |
addSplashLocation(properties, productID, bundles); |
163 |
// if osgi.splashPath is set, try to resolve relative paths to absolute paths |
164 |
if (properties.containsKey("osgi.splashPath")) //$NON-NLS-1$ |
165 |
resolveLocationPath(properties.getProperty("osgi.splashPath"), properties, bundles); //$NON-NLS-1$ |
166 |
if (!properties.containsKey(PROP_OSGI_BUNDLES)) |
167 |
properties.setProperty(PROP_OSGI_BUNDLES, computeOSGiBundles(TargetPlatform.getBundleList(), bundles, bundlesWithStartLevels)); |
168 |
if (!properties.containsKey("osgi.bundles.defaultStartLevel")) //$NON-NLS-1$ |
169 |
properties.setProperty("osgi.bundles.defaultStartLevel", "4"); //$NON-NLS-1$ //$NON-NLS-2$ |
170 |
} |
171 |
|
172 |
/** |
173 |
* Computes a list of osgi bundles to be put into the osgi.bundles property based |
174 |
* on the bundles from the target platform config.ini and a map of bundles we are |
175 |
* launching with. The list of bundles must have already had it's path information |
176 |
* removed. |
177 |
* @param bundleList list of bundles without path information |
178 |
* @param bundles map of bundle id to bundle model, contains all bundles being launched with |
179 |
* @param bundlesWithStartLevels map of bundles of start level |
180 |
* @return string list of osgi bundles |
181 |
*/ |
182 |
private static String computeOSGiBundles(String bundleList, Map bundles, Map bundlesWithStartLevels) { |
183 |
|
184 |
// if p2 and only simple configurator and |
185 |
// if simple configurator isn't selected & isn't in bundle list... hack it |
186 |
|
187 |
// if using p2's simple configurator, a bundles.txt will be written, so we only need simple configurator in the config.ini |
188 |
if (bundles.get(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR) != null) |
189 |
return "org.eclipse.equinox.simpleconfigurator@1:start"; //$NON-NLS-1$ |
190 |
|
191 |
StringBuffer buffer = new StringBuffer(); |
192 |
Set initialBundleSet = new HashSet(); |
193 |
StringTokenizer tokenizer = new StringTokenizer(bundleList, ","); //$NON-NLS-1$ |
194 |
while (tokenizer.hasMoreTokens()) { |
195 |
String token = tokenizer.nextToken(); |
196 |
int index = token.indexOf('@'); |
197 |
String id = index != -1 ? token.substring(0, index) : token; |
198 |
if (bundles.containsKey(id)) { |
199 |
if (buffer.length() > 0) |
200 |
buffer.append(','); |
201 |
buffer.append(id); |
202 |
if (index != -1 && index < token.length() - 1) |
203 |
buffer.append(token.substring(index)); |
204 |
initialBundleSet.add(id); |
205 |
} |
206 |
} |
207 |
|
208 |
// if org.eclipse.update.configurator is not included (LIKE IN BASIC RCP APPLICATION), then write out all bundles in osgi.bundles - bug 170772 |
209 |
if (!initialBundleSet.contains(IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR)) { |
210 |
initialBundleSet.add(IPDEBuildConstants.BUNDLE_OSGI); |
211 |
Iterator iter = bundlesWithStartLevels.keySet().iterator(); |
212 |
while (iter.hasNext()) { |
213 |
IPluginModelBase model = (IPluginModelBase) iter.next(); |
214 |
String id = model.getPluginBase().getId(); |
215 |
if (!initialBundleSet.contains(id)) { |
216 |
if (buffer.length() > 0) |
217 |
buffer.append(','); |
218 |
|
219 |
String slinfo = (String) bundlesWithStartLevels.get(model); |
220 |
buffer.append(id); |
221 |
buffer.append('@'); |
222 |
buffer.append(slinfo); |
223 |
} |
224 |
} |
225 |
} |
226 |
return buffer.toString(); |
227 |
} |
228 |
|
229 |
private static Properties loadFromTemplate(String templateLoc) throws CoreException { |
230 |
Properties properties = new Properties(); |
231 |
File templateFile = new File(templateLoc); |
232 |
if (templateFile.exists() && templateFile.isFile()) { |
233 |
FileInputStream stream = null; |
234 |
try { |
235 |
stream = new FileInputStream(templateFile); |
236 |
properties.load(stream); |
237 |
} catch (Exception e) { |
238 |
String message = e.getMessage(); |
239 |
if (message != null) |
240 |
throw new CoreException(new Status(IStatus.ERROR, PDEPlugin.getPluginId(), IStatus.ERROR, message, e)); |
241 |
} finally { |
242 |
if (stream != null) { |
243 |
try { |
244 |
stream.close(); |
245 |
} catch (IOException e) { |
246 |
} |
247 |
} |
248 |
} |
249 |
} |
250 |
return properties; |
251 |
} |
252 |
|
253 |
private static void addSplashLocation(Properties properties, String productID, Map map) { |
254 |
Properties targetConfig = TargetPlatformHelper.getConfigIniProperties(); |
255 |
String targetProduct = targetConfig == null ? null : targetConfig.getProperty("eclipse.product"); //$NON-NLS-1$ |
256 |
String targetSplash = targetConfig == null ? null : targetConfig.getProperty("osgi.splashPath"); //$NON-NLS-1$ |
257 |
if (!productID.equals(targetProduct) || targetSplash == null) { |
258 |
ArrayList locations = new ArrayList(); |
259 |
String plugin = getContributingPlugin(productID); |
260 |
locations.add(plugin); |
261 |
IPluginModelBase model = (IPluginModelBase) map.get(plugin); |
262 |
if (model != null) { |
263 |
BundleDescription desc = model.getBundleDescription(); |
264 |
if (desc != null) { |
265 |
BundleDescription[] fragments = desc.getFragments(); |
266 |
for (int i = 0; i < fragments.length; i++) |
267 |
locations.add(fragments[i].getSymbolicName()); |
268 |
} |
269 |
} |
270 |
resolveLocationPath(locations, properties, map); |
271 |
} else |
272 |
resolveLocationPath(targetSplash, properties, map); |
273 |
} |
274 |
|
275 |
private static void resolveLocationPath(String splashPath, Properties properties, Map map) { |
276 |
ArrayList locations = new ArrayList(); |
277 |
StringTokenizer tok = new StringTokenizer(splashPath, ","); //$NON-NLS-1$ |
278 |
while (tok.hasMoreTokens()) |
279 |
locations.add(tok.nextToken()); |
280 |
resolveLocationPath(locations, properties, map); |
281 |
} |
282 |
|
283 |
private static void resolveLocationPath(ArrayList locations, Properties properties, Map map) { |
284 |
StringBuffer buffer = new StringBuffer(); |
285 |
for (int i = 0; i < locations.size(); i++) { |
286 |
String location = (String) locations.get(i); |
287 |
if (location.startsWith("platform:/base/plugins/")) { //$NON-NLS-1$ |
288 |
location = location.replaceFirst("platform:/base/plugins/", ""); //$NON-NLS-1$ //$NON-NLS-2$ |
289 |
} |
290 |
String url = getBundleURL(location, map, false); |
291 |
if (url == null) |
292 |
continue; |
293 |
if (buffer.length() > 0) |
294 |
buffer.append(","); //$NON-NLS-1$ |
295 |
buffer.append(url); |
296 |
} |
297 |
if (buffer.length() > 0) |
298 |
properties.setProperty("osgi.splashPath", buffer.toString()); //$NON-NLS-1$ |
299 |
} |
300 |
|
301 |
/** |
302 |
* Returns a string url representing the install location of the bundle model with the |
303 |
* specified id. The model is obtained using the provided map. |
304 |
* @param id the id of the bundle |
305 |
* @param pluginMap mapping of bundle ids to bundle models |
306 |
* @param includeReference whether to prefix the url with 'reference:' |
307 |
* @return string url for the bundle location |
308 |
*/ |
309 |
public static String getBundleURL(String id, Map pluginMap, boolean includeReference) { |
310 |
IPluginModelBase model = (IPluginModelBase) pluginMap.get(id.trim()); |
311 |
return getBundleURL(model, includeReference); |
312 |
} |
313 |
|
314 |
/** |
315 |
* Returns a string url representing the install location of the given bundle model |
316 |
* @param model the model to create the url for |
317 |
* @param includeReference whether to prefix the url with 'reference:' |
318 |
* @return string url for bundle location |
319 |
*/ |
320 |
public static String getBundleURL(IPluginModelBase model, boolean includeReference) { |
321 |
if (model == null || model.getInstallLocation() == null) |
322 |
return null; |
323 |
StringBuffer buf = new StringBuffer(); |
324 |
if (includeReference) { |
325 |
buf.append(TargetPlatformHelper.REFERENCE_PREFIX); |
326 |
} |
327 |
buf.append(TargetPlatformHelper.FILE_URL_PREFIX); |
328 |
buf.append(new Path(model.getInstallLocation()).removeTrailingSeparator().toString()); |
329 |
return buf.toString(); |
330 |
} |
331 |
|
332 |
/** |
333 |
* Use the map of bundles we are launching with to update the osgi.framework |
334 |
* and osgi.bundles properties with the correct info. |
335 |
* @param map map of bundles being launched (id mapped to model) |
336 |
* @param properties properties for config.ini |
337 |
*/ |
338 |
private static void setBundleLocations(Map map, Properties properties, boolean defaultAuto) { |
339 |
String framework = properties.getProperty(PROP_OSGI_FRAMEWORK); |
340 |
if (framework != null) { |
341 |
framework = TargetPlatformHelper.stripPathInformation(framework); |
342 |
String url = getBundleURL(framework, map, false); |
343 |
if (url != null) |
344 |
properties.setProperty(PROP_OSGI_FRAMEWORK, url); |
345 |
} |
346 |
|
347 |
String bundles = properties.getProperty(PROP_OSGI_BUNDLES); |
348 |
if (bundles != null) { |
349 |
StringBuffer buffer = new StringBuffer(); |
350 |
StringTokenizer tokenizer = new StringTokenizer(bundles, ","); //$NON-NLS-1$ |
351 |
while (tokenizer.hasMoreTokens()) { |
352 |
String token = tokenizer.nextToken().trim(); |
353 |
String url = getBundleURL(token, map, false); |
354 |
int i = -1; |
355 |
if (url == null) { |
356 |
i = token.indexOf('@'); |
357 |
if (i != -1) { |
358 |
url = getBundleURL(token.substring(0, i), map, false); |
359 |
} |
360 |
if (url == null) { |
361 |
i = token.indexOf(':'); |
362 |
if (i != -1) |
363 |
url = getBundleURL(token.substring(0, i), map, false); |
364 |
} |
365 |
} |
366 |
if (url != null) { |
367 |
if (buffer.length() > 0) { |
368 |
buffer.append(","); //$NON-NLS-1$ |
369 |
} |
370 |
buffer.append("reference:" + url); //$NON-NLS-1$ |
371 |
if (i != -1) { |
372 |
String slinfo = token.substring(i + 1); |
373 |
buffer.append(getStartData(slinfo, defaultAuto)); |
374 |
} |
375 |
} |
376 |
} |
377 |
properties.setProperty(PROP_OSGI_BUNDLES, buffer.toString()); |
378 |
} |
379 |
} |
380 |
|
381 |
/** |
382 |
* Convenience method to parses the startData ("startLevel:autoStart"), convert it to the |
383 |
* format expected by the OSGi bundles property, and append to a StringBuffer. |
384 |
* @param startData data to parse ("startLevel:autoStart") |
385 |
* @param defaultAuto default auto start setting |
386 |
*/ |
387 |
public static String getStartData(String startData, boolean defaultAuto) { |
388 |
StringBuffer buffer = new StringBuffer(); |
389 |
int index = startData.indexOf(':'); |
390 |
String level = index > 0 ? startData.substring(0, index) : "default"; //$NON-NLS-1$ |
391 |
String auto = startData; |
392 |
if (!startData.equals("start")) //$NON-NLS-1$ |
393 |
auto = index >= 0 && index < startData.length() - 1 ? startData.substring(index + 1) : "default"; //$NON-NLS-1$ |
394 |
if ("default".equals(auto)) //$NON-NLS-1$ |
395 |
auto = Boolean.toString(defaultAuto); |
396 |
if (!level.equals("default") || "true".equals(auto) || "start".equals(auto)) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
397 |
buffer.append("@"); //$NON-NLS-1$ |
398 |
|
399 |
if (!level.equals("default")) { //$NON-NLS-1$ |
400 |
buffer.append(level); |
401 |
if ("start".equals(auto) || "true".equals(auto)) //$NON-NLS-1$ //$NON-NLS-2$ |
402 |
buffer.append(":"); //$NON-NLS-1$ |
403 |
} |
404 |
if ("start".equals(auto) || "true".equals(auto)) { //$NON-NLS-1$ //$NON-NLS-2$ |
405 |
buffer.append("start"); //$NON-NLS-1$ |
406 |
} |
407 |
return buffer.toString(); |
408 |
} |
409 |
|
410 |
public static void save(File file, Properties properties) { |
411 |
try { |
412 |
FileOutputStream stream = new FileOutputStream(file); |
413 |
properties.store(stream, "Configuration File"); //$NON-NLS-1$ |
414 |
stream.flush(); |
415 |
stream.close(); |
416 |
} catch (IOException e) { |
417 |
PDECore.logException(e); |
418 |
} |
419 |
} |
420 |
|
421 |
public static String getContributingPlugin(String productID) { |
422 |
if (productID == null) |
423 |
return null; |
424 |
int index = productID.lastIndexOf('.'); |
425 |
return index == -1 ? productID : productID.substring(0, index); |
426 |
} |
427 |
|
428 |
public static String getProductID(ILaunchConfiguration configuration) throws CoreException { |
429 |
if (configuration.getAttribute(IPDELauncherConstants.USE_PRODUCT, false)) { |
430 |
return configuration.getAttribute(IPDELauncherConstants.PRODUCT, (String) null); |
431 |
} |
432 |
|
433 |
// find the product associated with the application, and return its |
434 |
// contributing plug-in |
435 |
String appID = configuration.getAttribute(IPDELauncherConstants.APPLICATION, TargetPlatform.getDefaultApplication()); |
436 |
IExtension[] extensions = PDECore.getDefault().getExtensionsRegistry().findExtensions("org.eclipse.core.runtime.products", true); //$NON-NLS-1$ |
437 |
for (int i = 0; i < extensions.length; i++) { |
438 |
String id = extensions[i].getUniqueIdentifier(); |
439 |
if (id == null) |
440 |
continue; |
441 |
IConfigurationElement[] children = extensions[i].getConfigurationElements(); |
442 |
if (children.length != 1) |
443 |
continue; |
444 |
if (!"product".equals(children[0].getName())) //$NON-NLS-1$ |
445 |
continue; |
446 |
if (appID.equals(children[0].getAttribute("application"))) //$NON-NLS-1$ |
447 |
return id; |
448 |
} |
449 |
return null; |
450 |
|
451 |
} |
452 |
|
453 |
} |