Index: tmp/org.txm.core/src/java/org/txm/StandaloneTest.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/StandaloneTest.java	(revision 2156)
+++ tmp/org.txm.core/src/java/org/txm/StandaloneTest.java	(revision 2157)
@@ -1,53 +0,0 @@
-package org.txm;
-
-import java.util.ServiceLoader;
-
-import org.eclipse.core.internal.runtime.Activator;
-import org.eclipse.core.internal.runtime.InternalPlatform;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-import org.osgi.util.tracker.ServiceTracker;
-import org.txm.core.preferences.TBXPreferences;
-
-public class StandaloneTest {
-	
-	public static void main(String[] args) {
-		
-		try {
-			
-			//Load the framwork factory
-	        ServiceLoader loader = ServiceLoader.load( FrameworkFactory.class );
-	        System.out.println("ServiceLoader= "+loader);
-	        
-	        FrameworkFactory factory = ( FrameworkFactory ) loader.iterator( ).next( );
-	        System.out.println("FrameworkFactory= "+loader);
-	        
-	        // Create a new instance of the framework
-	        Framework framework = factory.newFramework( null );
-	        System.out.println("Framework="+framework);
-	        framework.init( );
-	        framework.start( );
-	        
-	        BundleContext bc = framework.getBundleContext();
-	        System.out.println("BundleContext: "+bc);
-	        
-	        Filter filter = bc.createFilter("(objectClass=*ServiceTasks)");
-	        System.out.println("Filter: "+filter);
-	        
-	        ServiceTracker serviceTaskTracker = new ServiceTracker(bc, filter, null);
-	        System.out.println("ServiceTracker: "+serviceTaskTracker);
-	        
-	        InternalPlatform.getDefault().start(bc);
-	        System.out.println("context started");
-	        
-	     //   Activator.getDefault().start(bc); 
-			
-			Toolbox.initialize(TBXPreferences.class);
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-	}
-}
Index: tmp/org.txm.core/src/java/org/txm/ToolboxApplication.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/ToolboxApplication.java	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/ToolboxApplication.java	(revision 2157)
@@ -0,0 +1,84 @@
+package org.txm;
+
+import org.eclipse.core.runtime.adaptor.EclipseStarter;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.txm.core.preferences.TBXPreferences;
+
+public class ToolboxApplication implements IApplication {
+	
+	public static void main(String[] args) {
+		
+		try {
+			
+//			//Load the framwork factory
+//	        ServiceLoader loader = ServiceLoader.load( FrameworkFactory.class );
+//	        System.out.println("ServiceLoader= "+loader);
+//	        
+//	        FrameworkFactory factory = ( FrameworkFactory ) loader.iterator( ).next( );
+//	        System.out.println("FrameworkFactory= "+loader);
+//	        
+//	        // Create a new instance of the framework
+//	        Framework framework = factory.newFramework( null );
+//	        System.out.println("Framework="+framework);
+//	        framework.init( );
+//	        framework.start( );
+//	        
+//	        BundleContext bc = framework.getBundleContext();
+//	        System.out.println("BundleContext: "+bc);
+//	        
+//	        Filter filter = bc.createFilter("(objectClass=*ServiceTasks)");
+//	        System.out.println("Filter: "+filter);
+//	        
+//	        ServiceTracker serviceTaskTracker = new ServiceTracker(bc, filter, null);
+//	        System.out.println("ServiceTracker: "+serviceTaskTracker);
+//	        
+//	        InternalPlatform.getDefault().start(bc);
+//	        System.out.println("context started");
+//	      
+			
+			
+			
+			String[] pargs = {"-application", "org.txm.core.Toolbox", "-data", "/home/mdecorde/workspace047/../runtime-rcpapplication.product", "-configuration", "file:/home/mdecorde/workspace047/.metadata/.plugins/org.eclipse.pde.core/rcpapplication.product/", "-dev", "file:/home/mdecorde/workspace047/.metadata/.plugins/org.eclipse.pde.core/rcpapplication.product/dev.properties", "-os", "linux", "-ws", "gtk", "-arch", "x86_64", "-nl", "fr_FR", "-consoleLog", "-run"};
+			EclipseStarter.main(pargs);
+//			System.out.println("plugins: "+Arrays.toString(Platform.getPluginRegistry().getPluginDescriptors()));
+//			System.out.println("ext pts: "+Arrays.toString(Platform.getPluginRegistry().getExtensionPoints()));
+
+			
+			//Toolbox.initialize(TBXPreferences.class);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+	public static boolean started = false;
+	private boolean goOn = true;
+	private int exitCode = IApplication.EXIT_OK;
+	
+	public void stopToolbox() {
+		goOn = false;
+	}
+	
+	public void setExitCode(int exitCode) {
+		this.exitCode = exitCode;
+	}
+
+	@Override
+	public Object start(IApplicationContext context) throws Exception {
+		//System.out.println("Starting Toolbox...");
+		//Toolbox.initialize(TBXPreferences.class);
+		started = true;
+		while (goOn) {
+			Thread.sleep(1000);
+			System.out.println("T"+started);
+		}
+		started = false;
+		return IApplicationContext.EXIT_ASYNC_RESULT;
+	}
+
+	@Override
+	public void stop() {
+		// TODO Auto-generated method stub
+	}
+}

Property changes on: tmp/org.txm.core/src/java/org/txm/ToolboxApplication.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.core/plugin.xml
===================================================================
--- tmp/org.txm.core/plugin.xml	(revision 2156)
+++ tmp/org.txm.core/plugin.xml	(revision 2157)
@@ -36,5 +36,17 @@
             name="ScriptEngines">
       </EngineManager>
    </extension>
+   <extension
+         id="Toolbox"
+         point="org.eclipse.core.runtime.applications">
+      <application
+            cardinality="singleton-global"
+            thread="main"
+            visible="true">
+         <run
+               class="org.txm.ToolboxApplication">
+         </run>
+      </application>
+   </extension>
 
 </plugin>
