xref: /AOO41X/main/javainstaller2/src/JavaSetup/org/openoffice/setup/Main.java (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package org.openoffice.setup;
29 
30 import org.openoffice.setup.Controller.AcceptLicenseCtrl;
31 import org.openoffice.setup.Controller.ChooseComponentsCtrl;
32 import org.openoffice.setup.Controller.ChooseUninstallationComponentsCtrl;
33 import org.openoffice.setup.Controller.ChooseUninstallationTypeCtrl;
34 import org.openoffice.setup.Controller.ChooseDirectoryCtrl;
35 import org.openoffice.setup.Controller.ChooseInstallationTypeCtrl;
36 import org.openoffice.setup.Controller.UninstallationCompletedCtrl;
37 import org.openoffice.setup.Controller.UninstallationImminentCtrl;
38 import org.openoffice.setup.Controller.UninstallationOngoingCtrl;
39 import org.openoffice.setup.Controller.UninstallationPrologueCtrl;
40 import org.openoffice.setup.Controller.InstallationCompletedCtrl;
41 import org.openoffice.setup.Controller.InstallationImminentCtrl;
42 import org.openoffice.setup.Controller.InstallationOngoingCtrl;
43 import org.openoffice.setup.Controller.PrologueCtrl;
44 // import org.openoffice.setup.Util.Dumper;
45 
46 public class Main {
47 
48     public static void main(String[] args) {
49         // try {
50         //    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
51         // } catch (Exception e) { }
52 
53         // Dumper.dumpAllProperties();
54         SetupFrame frame = new SetupFrame();
55         InstallData data = InstallData.getInstance();
56         if ( data.isInstallationMode() ) {
57             PanelController controller1 = new PrologueCtrl();
58             frame.addPanel(controller1, controller1.getName());
59             PanelController controller2 = new AcceptLicenseCtrl();
60             frame.addPanel(controller2, controller2.getName());
61             PanelController controller3 = new ChooseDirectoryCtrl();
62             frame.addPanel(controller3, controller3.getName());
63             PanelController controller4 = new ChooseInstallationTypeCtrl();
64             frame.addPanel(controller4, controller4.getName());
65             PanelController controller5 = new ChooseComponentsCtrl();
66             frame.addPanel(controller5, controller5.getName());
67             PanelController controller6 = new InstallationImminentCtrl();
68             frame.addPanel(controller6, controller6.getName());
69             PanelController controller7 = new InstallationOngoingCtrl();
70             frame.addPanel(controller7, controller7.getName());
71             PanelController controller8 = new InstallationCompletedCtrl();
72             frame.addPanel(controller8, controller8.getName());
73             frame.setCurrentPanel(controller1.getName(), false, true);
74         } else {
75             PanelController controller1 = new UninstallationPrologueCtrl();
76             frame.addPanel(controller1, controller1.getName());
77             PanelController controller2 = new ChooseUninstallationTypeCtrl();
78             frame.addPanel(controller2, controller2.getName());
79             PanelController controller3 = new ChooseUninstallationComponentsCtrl();
80             frame.addPanel(controller3, controller3.getName());
81             PanelController controller4 = new UninstallationImminentCtrl();
82             frame.addPanel(controller4, controller4.getName());
83             PanelController controller5 = new UninstallationOngoingCtrl();
84             frame.addPanel(controller5, controller5.getName());
85             PanelController controller6 = new UninstallationCompletedCtrl();
86             frame.addPanel(controller6, controller6.getName());
87             frame.setCurrentPanel(controller1.getName(), false, true);
88         }
89 
90         int ret = frame.showFrame();
91 
92         while ( data.stillRunning() ) {
93             for (int i = 0; i < 100; i++) {}    // why?
94         }
95 
96         System.exit(0);
97     }
98 }
99