Revision 43126 trunk/org.gvsig.desktop/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/Launcher.java
Launcher.java | ||
---|---|---|
32 | 32 |
import java.awt.Toolkit; |
33 | 33 |
import java.awt.event.ActionEvent; |
34 | 34 |
import java.awt.event.ActionListener; |
35 |
import java.awt.event.WindowAdapter; |
|
35 | 36 |
import java.awt.event.WindowEvent; |
36 |
import java.awt.event.WindowListener; |
|
37 | 37 |
import java.io.BufferedOutputStream; |
38 | 38 |
import java.io.BufferedReader; |
39 | 39 |
import java.io.File; |
... | ... | |
75 | 75 |
import java.util.Properties; |
76 | 76 |
import java.util.Set; |
77 | 77 |
import java.util.TreeSet; |
78 |
import java.util.logging.Level; |
|
79 | 78 |
import java.util.prefs.Preferences; |
80 | 79 |
|
81 | 80 |
import javax.swing.ImageIcon; |
... | ... | |
97 | 96 |
import org.apache.commons.cli.PosixParser; |
98 | 97 |
import org.apache.commons.configuration.PropertiesConfiguration; |
99 | 98 |
import org.apache.commons.io.FileUtils; |
100 |
import org.apache.commons.io.input.ClassLoaderObjectInputStream; |
|
101 | 99 |
import org.apache.commons.lang3.JavaVersion; |
102 | 100 |
import org.apache.commons.lang3.StringUtils; |
103 | 101 |
import org.apache.commons.lang3.SystemUtils; |
... | ... | |
162 | 160 |
import org.gvsig.installer.lib.api.PackageInfo; |
163 | 161 |
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException; |
164 | 162 |
import org.gvsig.installer.swing.api.SwingInstallerLocator; |
165 |
import org.gvsig.installer.swing.api.execution.AbstractInstallPackageWizard;
|
|
163 |
import org.gvsig.installer.swing.api.execution.InstallWizardPanel;
|
|
166 | 164 |
import org.gvsig.installer.swing.api.wizard.InstallerWizardActionListener; |
167 | 165 |
import org.gvsig.installer.swing.api.wizard.InstallerWizardPanel; |
168 | 166 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
3734 | 3732 |
|
3735 | 3733 |
InstallerManager installerManager = InstallerLocator.getInstallerManager(); |
3736 | 3734 |
|
3737 |
// try { |
|
3738 |
// logger.info("Loading plugins configurations"); |
|
3739 |
// this.loadPluginConfigs(); |
|
3740 |
// } catch (Throwable ex) { |
|
3741 |
// logger.warn("Can't load plugins configurations", ex); |
|
3742 |
// } |
|
3743 |
// |
|
3744 |
// try { |
|
3745 |
// logger.info("Loading plugins"); |
|
3746 |
// this.loadPluginServices(); |
|
3747 |
// } catch (Throwable ex) { |
|
3748 |
// logger.warn("Can't load plugins", ex); |
|
3749 |
// } |
|
3735 |
try { |
|
3736 |
logger.info("Loading plugins configurations"); |
|
3737 |
this.loadPluginConfigs(); |
|
3738 |
} catch (Throwable ex) { |
|
3739 |
logger.warn("Can't load plugins configurations", ex); |
|
3740 |
} |
|
3750 | 3741 |
|
3742 |
try { |
|
3743 |
logger.info("Loading plugins"); |
|
3744 |
this.loadPluginServices(); |
|
3745 |
} catch (Throwable ex) { |
|
3746 |
logger.warn("Can't load plugins", ex); |
|
3747 |
} |
|
3748 |
|
|
3751 | 3749 |
AndamiConfig config = getAndamiConfig(); |
3752 | 3750 |
|
3753 | 3751 |
initializeIdentityManagement(new File(config.getPluginsDirectory()).getAbsoluteFile()); |
... | ... | |
3779 | 3777 |
// Launch installer |
3780 | 3778 |
PluginsManager manager = PluginsLocator.getManager(); |
3781 | 3779 |
|
3782 |
AbstractInstallPackageWizard installPackageWizard = SwingInstallerLocator
|
|
3780 |
InstallWizardPanel installPackageWizard = SwingInstallerLocator
|
|
3783 | 3781 |
.getSwingInstallerManager().createInstallPackageWizard( |
3784 | 3782 |
manager.getApplicationFolder(), |
3785 | 3783 |
manager.getInstallFolder()); |
3786 | 3784 |
installPackageWizard.setWizardActionListener(new InstallerWizardActionListener() { |
3785 |
@Override |
|
3787 | 3786 |
public void finish(InstallerWizardPanel installerWizard) { |
3788 | 3787 |
logger.info("Finish installation."); |
3789 | 3788 |
System.exit(0); |
3790 | 3789 |
} |
3791 | 3790 |
|
3791 |
@Override |
|
3792 | 3792 |
public void cancel(InstallerWizardPanel installerWizard) { |
3793 | 3793 |
logger.info("Cancel installation."); |
3794 | 3794 |
System.exit(0); |
... | ... | |
3796 | 3796 |
}); |
3797 | 3797 |
|
3798 | 3798 |
// the wizard will show the Typical or Advanced mode option. |
3799 |
installPackageWizard.setAskTypicalOrCustom(true);
|
|
3799 |
installPackageWizard.setSkipTypicalOrAdvancedWizardPage(false);
|
|
3800 | 3800 |
// default packages will be selected. |
3801 | 3801 |
installPackageWizard.setSelectDefaultPackages(true); |
3802 | 3802 |
|
3803 | 3803 |
JFrame frame = new JFrame(Messages.get("gvsig_package_installer")); |
3804 |
|
|
3805 |
frame.addWindowListener(new WindowListener() { |
|
3806 |
public void windowOpened(WindowEvent we) { |
|
3807 |
logger.info("Open window installation."); |
|
3808 |
} |
|
3809 |
|
|
3804 |
frame.addWindowListener(new WindowAdapter() { |
|
3805 |
@Override |
|
3810 | 3806 |
public void windowClosing(WindowEvent we) { |
3811 | 3807 |
logger.info("Closing installation."); |
3812 | 3808 |
System.exit(0); |
3813 | 3809 |
} |
3814 | 3810 |
|
3811 |
@Override |
|
3815 | 3812 |
public void windowClosed(WindowEvent we) { |
3816 | 3813 |
logger.info("Close installation."); |
3817 | 3814 |
System.exit(0); |
3818 | 3815 |
} |
3819 |
|
|
3820 |
public void windowIconified(WindowEvent we) { |
|
3821 |
} |
|
3822 |
|
|
3823 |
public void windowDeiconified(WindowEvent we) { |
|
3824 |
} |
|
3825 |
|
|
3826 |
public void windowActivated(WindowEvent we) { |
|
3827 |
logger.info("Activate window installation."); |
|
3828 |
} |
|
3829 |
|
|
3830 |
public void windowDeactivated(WindowEvent we) { |
|
3831 |
logger.info("Deactivate window installation."); |
|
3832 |
} |
|
3833 | 3816 |
}); |
3834 |
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
3835 |
|
|
3836 |
frame.getContentPane().add(installPackageWizard, BorderLayout.CENTER); |
|
3837 |
|
|
3817 |
frame.getContentPane().add(installPackageWizard.asJComponent(), BorderLayout.CENTER); |
|
3838 | 3818 |
URL iconURL = getClass().getResource("/images/main/install-icon.png"); |
3839 | 3819 |
if( iconURL!=null ) { |
3840 | 3820 |
ImageIcon icon = new ImageIcon(iconURL); |
Also available in: Unified diff