1*9a1eeea9SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9a1eeea9SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9a1eeea9SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9a1eeea9SAndrew Rist  * distributed with this work for additional information
6*9a1eeea9SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9a1eeea9SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9a1eeea9SAndrew Rist  * "License"); you may not use this file except in compliance
9*9a1eeea9SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9a1eeea9SAndrew Rist  *
11*9a1eeea9SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9a1eeea9SAndrew Rist  *
13*9a1eeea9SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9a1eeea9SAndrew Rist  * software distributed under the License is distributed on an
15*9a1eeea9SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9a1eeea9SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9a1eeea9SAndrew Rist  * specific language governing permissions and limitations
18*9a1eeea9SAndrew Rist  * under the License.
19*9a1eeea9SAndrew Rist  *
20*9a1eeea9SAndrew Rist  *************************************************************/
21*9a1eeea9SAndrew Rist 
22*9a1eeea9SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package org.openoffice.setup.Controller;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import org.openoffice.setup.InstallData;
27cdf0e10cSrcweir import org.openoffice.setup.PanelController;
28cdf0e10cSrcweir import org.openoffice.setup.Panel.AcceptLicense;
29cdf0e10cSrcweir import org.openoffice.setup.ResourceManager;
30cdf0e10cSrcweir 
31cdf0e10cSrcweir public class AcceptLicenseCtrl extends PanelController {
32cdf0e10cSrcweir 
33cdf0e10cSrcweir     private String helpFile;
34cdf0e10cSrcweir 
AcceptLicenseCtrl()35cdf0e10cSrcweir     public AcceptLicenseCtrl() {
36cdf0e10cSrcweir         super("AcceptLicense", new AcceptLicense());
37cdf0e10cSrcweir         helpFile = "String_Helpfile_AcceptLicense";
38cdf0e10cSrcweir     }
39cdf0e10cSrcweir 
getNext()40cdf0e10cSrcweir     public String getNext() {
41cdf0e10cSrcweir         InstallData data = InstallData.getInstance();
42cdf0e10cSrcweir 
43cdf0e10cSrcweir         if ( data.isRootInstallation() ) {
44cdf0e10cSrcweir             if ( data.olderVersionExists() ) {
45cdf0e10cSrcweir                 return new String("InstallationImminent");
46cdf0e10cSrcweir             } else if ( data.sameVersionExists() ) {
47cdf0e10cSrcweir                 return new String("ChooseComponents");
48cdf0e10cSrcweir             } else {
49cdf0e10cSrcweir                 return new String("ChooseInstallationType");
50cdf0e10cSrcweir             }
51cdf0e10cSrcweir         } else {
52cdf0e10cSrcweir             return new String("ChooseDirectory");
53cdf0e10cSrcweir         }
54cdf0e10cSrcweir     }
55cdf0e10cSrcweir 
getPrevious()56cdf0e10cSrcweir     public String getPrevious() {
57cdf0e10cSrcweir         return new String("Prologue");
58cdf0e10cSrcweir     }
59cdf0e10cSrcweir 
getHelpFileName()60cdf0e10cSrcweir     public final String getHelpFileName () {
61cdf0e10cSrcweir         return this.helpFile;
62cdf0e10cSrcweir     }
63cdf0e10cSrcweir 
beforeShow()64cdf0e10cSrcweir     public void beforeShow() {
65cdf0e10cSrcweir         String StringInstall = ResourceManager.getString("String_AcceptLicense");
66cdf0e10cSrcweir         getSetupFrame().setButtonText(StringInstall, getSetupFrame().BUTTON_NEXT);
67cdf0e10cSrcweir         String StringDecline = ResourceManager.getString("String_Decline");
68cdf0e10cSrcweir         getSetupFrame().setButtonText(StringDecline, getSetupFrame().BUTTON_CANCEL);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir         getSetupFrame().setButtonSelected(getSetupFrame().BUTTON_CANCEL);
71cdf0e10cSrcweir     }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir }
74