1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package org.openoffice.setup;
25 
26 import org.openoffice.setup.Controller.AcceptLicenseCtrl;
27 import org.openoffice.setup.Controller.ChooseComponentsCtrl;
28 import org.openoffice.setup.Controller.ChooseUninstallationComponentsCtrl;
29 import org.openoffice.setup.Controller.ChooseUninstallationTypeCtrl;
30 import org.openoffice.setup.Controller.ChooseDirectoryCtrl;
31 import org.openoffice.setup.Controller.ChooseInstallationTypeCtrl;
32 import org.openoffice.setup.Controller.UninstallationCompletedCtrl;
33 import org.openoffice.setup.Controller.UninstallationImminentCtrl;
34 import org.openoffice.setup.Controller.UninstallationOngoingCtrl;
35 import org.openoffice.setup.Controller.UninstallationPrologueCtrl;
36 import org.openoffice.setup.Controller.InstallationCompletedCtrl;
37 import org.openoffice.setup.Controller.InstallationImminentCtrl;
38 import org.openoffice.setup.Controller.InstallationOngoingCtrl;
39 import org.openoffice.setup.Controller.PrologueCtrl;
40 // import org.openoffice.setup.Util.Dumper;
41 
42 public class Main {
43 
main(String[] args)44     public static void main(String[] args) {
45         // try {
46         //    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
47         // } catch (Exception e) { }
48 
49         // Dumper.dumpAllProperties();
50         SetupFrame frame = new SetupFrame();
51         InstallData data = InstallData.getInstance();
52         if ( data.isInstallationMode() ) {
53             PanelController controller1 = new PrologueCtrl();
54             frame.addPanel(controller1, controller1.getName());
55             PanelController controller2 = new AcceptLicenseCtrl();
56             frame.addPanel(controller2, controller2.getName());
57             PanelController controller3 = new ChooseDirectoryCtrl();
58             frame.addPanel(controller3, controller3.getName());
59             PanelController controller4 = new ChooseInstallationTypeCtrl();
60             frame.addPanel(controller4, controller4.getName());
61             PanelController controller5 = new ChooseComponentsCtrl();
62             frame.addPanel(controller5, controller5.getName());
63             PanelController controller6 = new InstallationImminentCtrl();
64             frame.addPanel(controller6, controller6.getName());
65             PanelController controller7 = new InstallationOngoingCtrl();
66             frame.addPanel(controller7, controller7.getName());
67             PanelController controller8 = new InstallationCompletedCtrl();
68             frame.addPanel(controller8, controller8.getName());
69             frame.setCurrentPanel(controller1.getName(), false, true);
70         } else {
71             PanelController controller1 = new UninstallationPrologueCtrl();
72             frame.addPanel(controller1, controller1.getName());
73             PanelController controller2 = new ChooseUninstallationTypeCtrl();
74             frame.addPanel(controller2, controller2.getName());
75             PanelController controller3 = new ChooseUninstallationComponentsCtrl();
76             frame.addPanel(controller3, controller3.getName());
77             PanelController controller4 = new UninstallationImminentCtrl();
78             frame.addPanel(controller4, controller4.getName());
79             PanelController controller5 = new UninstallationOngoingCtrl();
80             frame.addPanel(controller5, controller5.getName());
81             PanelController controller6 = new UninstallationCompletedCtrl();
82             frame.addPanel(controller6, controller6.getName());
83             frame.setCurrentPanel(controller1.getName(), false, true);
84         }
85 
86         int ret = frame.showFrame();
87 
88         while ( data.stillRunning() ) {
89             for (int i = 0; i < 100; i++) {}    // why?
90         }
91 
92         System.exit(0);
93     }
94 }
95