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.AcceptLicense;
29 import org.openoffice.setup.ResourceManager;
30 
31 public class AcceptLicenseCtrl extends PanelController {
32 
33     private String helpFile;
34 
AcceptLicenseCtrl()35     public AcceptLicenseCtrl() {
36         super("AcceptLicense", new AcceptLicense());
37         helpFile = "String_Helpfile_AcceptLicense";
38     }
39 
getNext()40     public String getNext() {
41         InstallData data = InstallData.getInstance();
42 
43         if ( data.isRootInstallation() ) {
44             if ( data.olderVersionExists() ) {
45                 return new String("InstallationImminent");
46             } else if ( data.sameVersionExists() ) {
47                 return new String("ChooseComponents");
48             } else {
49                 return new String("ChooseInstallationType");
50             }
51         } else {
52             return new String("ChooseDirectory");
53         }
54     }
55 
getPrevious()56     public String getPrevious() {
57         return new String("Prologue");
58     }
59 
getHelpFileName()60     public final String getHelpFileName () {
61         return this.helpFile;
62     }
63 
beforeShow()64     public void beforeShow() {
65         String StringInstall = ResourceManager.getString("String_AcceptLicense");
66         getSetupFrame().setButtonText(StringInstall, getSetupFrame().BUTTON_NEXT);
67         String StringDecline = ResourceManager.getString("String_Decline");
68         getSetupFrame().setButtonText(StringDecline, getSetupFrame().BUTTON_CANCEL);
69 
70         getSetupFrame().setButtonSelected(getSetupFrame().BUTTON_CANCEL);
71     }
72 
73 }
74