package org.helioviewer.jhv.launcher;

import org.helioviewer.base.JavaCompatibility;
import org.helioviewer.jhv.JavaHelioViewer;
import org.helioviewer.jhv.JavaHelioViewerLauncher;
import org.helioviewer.jhv.plugins.swek.SWEKPlugin;
import org.helioviewer.jhv.plugins.swhvhekplugin.SWHVHEKPlugin;
import org.helioviewer.plugins.eveplugin.EVEPlugin;
import org.helioviewer.plugins.eveplugin.EVEPluginLauncher;
import org.helioviewer.viewmodelplugin.controller.PluginManager;

/**
 * Class for launching jhv with several plugins added.
 * 
 * @author Bram.Bourgoignie (Bram.Bourgoignie@oma.be)
 * 
 */
public class SWHVLauncher {
    public static void main(String[] args) {
        System.out.println("================================================================");
        System.out.println("JHelioviewer developer version with external plugin compiled-in.");
        System.out.println("================================================================\n\n");

        JavaHelioViewerLauncher.loadLibs();

        String[] args2 = JavaCompatibility.copyArrayString(args, args.length + 4);

        args2[args2.length - 2] = "--deactivate-plugin";
        args2[args2.length - 1] = "SWEKPlugin.jar";
        args2[args2.length - 4] = "--deactivate-plugin";
        args2[args2.length - 3] = "EVEPlugin.jar";

        JavaHelioViewer.main(args2, new SWEKPlugin(false));

        PluginManager.getSingletonInstance().addPlugin(EVEPluginLauncher.class.getClassLoader(), new EVEPlugin(), null);
        PluginManager.getSingletonInstance().addPlugin(SWHVHEKPlugin.class.getClassLoader(), new SWHVHEKPlugin(), null);
    }

}

@@ -32,16 +32,45 @@
 ncher;%0A%0A
+import java.awt.EventQueue;%0A%0A
 import o
@@ -1393,24 +1393,186 @@
 n(false));%0A%0A
+        EventQueue.invokeLater(new Runnable() %7B%0A%0A            @Override%0A            public void run() %7B%0A                // TODO Auto-generated method stub%0A        
         Plug
@@ -1680,32 +1680,40 @@
  null);%0A        
+     
+   
 PluginManager.ge
@@ -1805,21 +1805,48 @@
 n(), null);%0A
+            %7D%0A%0A        %7D);%0A
     %7D%0A%0A%7D%0A

Load plugins in eventqueue