package com.izforge.izpack.installer.base;

import com.izforge.izpack.api.data.AutomatedInstallData;
import com.izforge.izpack.api.exception.IzPackException;
import com.izforge.izpack.installer.manager.PanelManager;

import javax.swing.*;

/**
 * Installer frame controller
 *
 * @author Anthonin Bonnefoy
 */
public class InstallerController
{

    private InstallerFrame installerFrame;
    private PanelManager panelManager;
    private AutomatedInstallData automatedInstallData;

    public InstallerController(PanelManager panelManager, InstallDataConfiguratorWithRules installDataRulesEngineManager, InstallerFrame installerFrame, AutomatedInstallData automatedInstallData)
    {

        this.panelManager = panelManager;
        this.installerFrame = installerFrame;
        this.automatedInstallData = automatedInstallData;
        installDataRulesEngineManager.configureInstallData();

    }

    public InstallerController buildInstallation() throws Exception
    {
        SwingUtilities.invokeLater(new Runnable()
        {
            public void run()
            {
                try
                {
                    panelManager.loadPanelsInContainer();
                    panelManager.instantiatePanels();
                    installerFrame.buildGUI();
                    installerFrame.sizeFrame();
                }
                catch (ClassNotFoundException e)
                {
                    throw new IzPackException(e);
                }
            }
        });
        return this;
    }

    public void launchInstallation()
    {
        activateFirstPanel();
    }

    private void activateFirstPanel()
    {
        int firstPanel = installerFrame.hasNavigateNext(-1, false);
        if (firstPanel > -1)
        {
            installerFrame.setVisible(true);
            automatedInstallData.setCurPanelNumber(firstPanel);
            installerFrame.switchPanel(firstPanel);
        }
    }

}

@@ -98,65 +98,8 @@
 ta;%0A
-import com.izforge.izpack.api.exception.IzPackException;%0A
 impo
@@ -157,31 +157,8 @@
 r;%0A%0A
-import javax.swing.*;%0A%0A
 /**%0A
@@ -894,162 +894,8 @@
   %7B%0A
-        SwingUtilities.invokeLater(new Runnable()%0A        %7B%0A            public void run()%0A            %7B%0A                try%0A                %7B%0A            
     
@@ -932,36 +932,24 @@
 ontainer();%0A
-            
         pane
@@ -974,36 +974,24 @@
 tePanels();%0A
-            
         inst
@@ -1021,28 +1021,16 @@
         
-       
-     
 installe
@@ -1053,187 +1053,8 @@
 ();%0A
-                %7D%0A                catch (ClassNotFoundException e)%0A                %7B%0A                    throw new IzPackException(e);%0A                %7D%0A            %7D%0A        %7D);%0A
     

Remove useless invokeLater