]> git.argeo.org Git - gpl/argeo-slc.git/blob - plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/EclipseBootLaunchConfiguration.java
Work on SLC IDE eclipse plugin
[gpl/argeo-slc.git] / plugins / org.argeo.slc.ide.ui / src / main / java / org / argeo / slc / ide / ui / launch / osgi / EclipseBootLaunchConfiguration.java
1 package org.argeo.slc.ide.ui.launch.osgi;
2
3 import java.util.Map;
4 import java.util.TreeMap;
5
6 import org.argeo.slc.ide.ui.SlcIdeUiPlugin;
7 import org.eclipse.core.resources.IFile;
8 import org.eclipse.core.resources.IResource;
9 import org.eclipse.core.runtime.CoreException;
10 import org.eclipse.core.runtime.IProgressMonitor;
11 import org.eclipse.debug.core.ILaunch;
12 import org.eclipse.debug.core.ILaunchConfiguration;
13 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
14 import org.eclipse.pde.launching.EclipseApplicationLaunchConfiguration;
15
16 /** OSGiBoot launch configuration. */
17 public class EclipseBootLaunchConfiguration extends
18 EclipseApplicationLaunchConfiguration {
19 public final static String ID = SlcIdeUiPlugin.ID + ".EclipseBootLauncher";
20
21 @Override
22 public void launch(ILaunchConfiguration configuration, String mode,
23 ILaunch launch, IProgressMonitor monitor) throws CoreException {
24 super.launch(configuration, mode, launch, monitor);
25
26 // System.out.println("targetBundles="
27 // + configuration.getAttribute(
28 // IPDELauncherConstants.SELECTED_TARGET_PLUGINS, ""));
29 // System.out.println("workspaceBundles="
30 // + configuration.getAttribute(
31 // IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS, ""));
32
33 // Refresh resources before launching
34 final IFile propertiesFile = (IFile) configuration.getMappedResources()[0];
35 propertiesFile.getParent().refreshLocal(IResource.DEPTH_INFINITE,
36 monitor);
37 }
38
39 @SuppressWarnings("unchecked")
40 @Override
41 protected void preLaunchCheck(ILaunchConfiguration configuration,
42 ILaunch launch, IProgressMonitor monitor) throws CoreException {
43 ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
44 OsgiLaunchHelper.updateLaunchConfiguration(wc, true);
45 wc.doSave();
46 Map<String, ?> attrs = new TreeMap<String, Object>(
47 (Map<String, String>) wc.getAttributes());
48 OsgiLaunchHelper.debug("WC " + wc);
49 for (String key : attrs.keySet())
50 OsgiLaunchHelper.debug(key + "=" + attrs.get(key));
51
52 super.preLaunchCheck(configuration, launch, monitor);
53
54 // Note that if a Java project contains a build.properties it has to
55 // declare the sources otherwise it will be skipped in the generation of
56 // the dev.properties file!
57
58 // for(Object bundleId:fAllBundles.keySet()){
59 // System.out.println(bundleId+"="+fAllBundles.get(bundleId));
60 // }
61 }
62
63 }