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.Controller;
25 
26 import org.openoffice.setup.InstallData;
27 import org.openoffice.setup.PanelController;
28 import org.openoffice.setup.Panel.UninstallationCompleted;
29 import org.openoffice.setup.ResourceManager;
30 import org.openoffice.setup.SetupData.ProductDescription;
31 import org.openoffice.setup.SetupData.SetupDataProvider;
32 import org.openoffice.setup.Util.InfoCtrl;
33 import org.openoffice.setup.Util.LogManager;
34 import java.util.Vector;
35 
36 public class UninstallationCompletedCtrl extends PanelController {
37 
38     private String helpFile;
39     private String mDialogText;
40     private String htmlInfoText;
41 
UninstallationCompletedCtrl()42     public UninstallationCompletedCtrl() {
43         super("UninstallationCompleted", new UninstallationCompleted());
44         helpFile = "String_Helpfile_UninstallationCompleted";
45     }
46 
beforeShow()47     public void beforeShow() {
48         InstallData installData = InstallData.getInstance();
49         ProductDescription productData = SetupDataProvider.getProductDescription();
50 
51         getSetupFrame().setButtonEnabled(false, getSetupFrame().BUTTON_PREVIOUS);
52         getSetupFrame().setButtonEnabled(false, getSetupFrame().BUTTON_CANCEL);
53         getSetupFrame().setButtonEnabled(false, getSetupFrame().BUTTON_HELP);
54         getSetupFrame().removeButtonIcon(getSetupFrame().BUTTON_NEXT);
55         getSetupFrame().setButtonSelected(getSetupFrame().BUTTON_NEXT);
56 
57         UninstallationCompleted panel = (UninstallationCompleted)getPanel();
58         panel.setDetailsButtonActionCommand(getSetupFrame().ACTION_DETAILS);
59         panel.addDetailsButtonActionListener(getSetupFrame().getSetupActionListener());
60 
61         if (( installData.isCustomInstallation() ) && ( ! installData.isMaskedCompleteUninstallation() )) {
62             String dialogText = ResourceManager.getString("String_UninstallationCompleted2_Partial");
63             panel.setDialogText(dialogText);
64         }
65 
66         if ( installData.isAbortedInstallation() ) {
67             String titleText = ResourceManager.getString("String_UninstallationCompleted1_Abort");
68             panel.setTitleText(titleText);
69             String dialogText = ResourceManager.getString("String_UninstallationCompleted2_Abort");
70             panel.setDialogText(dialogText);
71         } else if ( installData.isErrorInstallation() ) {
72             String titleText = ResourceManager.getString("String_UninstallationCompleted1_Error");
73             panel.setTitleText(titleText);
74             String dialogText = ResourceManager.getString("String_UninstallationCompleted2_Error");
75             panel.setDialogText(dialogText);
76         }
77 
78         htmlInfoText = InfoCtrl.setHtmlFrame("header", htmlInfoText);
79         htmlInfoText = InfoCtrl.setInstallLogInfoText(productData, htmlInfoText);
80         htmlInfoText = InfoCtrl.setHtmlFrame("end", htmlInfoText);
81     }
82 
getNext()83     public String getNext() {
84         return null;
85     }
86 
getPrevious()87     public String getPrevious() {
88         return null;
89     }
90 
getHelpFileName()91     public final String getHelpFileName () {
92         return this.helpFile;
93     }
94 
getDialogText()95     public String getDialogText() {
96         return htmlInfoText;
97     }
98 
99 }
100