+ /** Expect properties file to be set as mapped resources */
+ public static void updateLaunchConfiguration(
+ ILaunchConfigurationWorkingCopy configuration) {
+ try {
+ IFile propertiesFile = (IFile) configuration.getMappedResources()[0];
+
+ Properties properties = OsgiLaunchHelper
+ .readProperties(propertiesFile);
+
+ List<String> bundlesToStart = new ArrayList<String>();
+ Map<String, String> systemPropertiesToAppend = new HashMap<String, String>();
+ OsgiLaunchHelper.interpretProperties(properties, bundlesToStart,
+ systemPropertiesToAppend);
+
+ // Reinitialize using standard OSGi launch shortcut
+ // Kind of a hack but it lacks extension capabilities and it is
+ // still
+ // cleaner than forking the code (which would imply a lot of fork
+ // indeed
+ // because of all the internal classes)
+ // new OSGiLaunchShortcut() {
+ // @Override
+ // public void initializeConfiguration(
+ // ILaunchConfigurationWorkingCopy configuration) {
+ // // TODO Auto-generated method stub
+ // super.initializeConfiguration(configuration);
+ // }
+ // }.initializeConfiguration(configuration);
+
+ // initializeConfiguration(configuration);
+
+ File workingDir = getWorkingDirectory(configuration);
+ File dataDir = new File(workingDir, "data");
+
+ OsgiLaunchHelper.updateLaunchConfiguration(configuration,
+ bundlesToStart, systemPropertiesToAppend, dataDir
+ .getAbsolutePath());
+ } catch (Exception e) {
+ ErrorDialog.openError(Display.getCurrent().getActiveShell(),
+ "Error", "Cannot read properties",
+ new Status(IStatus.ERROR, SlcIdeUiPlugin.ID,
+ e.getMessage(), e));
+ return;
+ }
+ }
+