KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > panels > ExtendedInstallPanel


1 /*
2  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
3  *
4  * http://www.izforge.com/izpack/
5  * http://developer.berlios.de/projects/izpack/
6  *
7  * Copyright 2004 Klaus Bartz
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */

21
22 package com.izforge.izpack.panels;
23
24 import com.izforge.izpack.installer.InstallData;
25 import com.izforge.izpack.installer.InstallerFrame;
26 import com.izforge.izpack.util.ExtendedUIProgressHandler;
27
28 /**
29  * The install panel class. Launches the actual installation job with extensions for custom actions.
30  *
31  * @author Klaus Bartz
32  */

33 public class ExtendedInstallPanel extends InstallPanel implements ExtendedUIProgressHandler
34 {
35
36     private static final long serialVersionUID = 3257291344052500789L;
37
38     protected int currentStep = 0;
39
40     /**
41      * The constructor.
42      *
43      * @param parent The parent window.
44      * @param idata The installation data.
45      */

46     public ExtendedInstallPanel(InstallerFrame parent, InstallData idata)
47     {
48         super(parent, idata);
49     }
50
51     /*
52      * (non-Javadoc)
53      *
54      * @see com.izforge.izpack.util.ExtendedUIProgressHandler#startAction(java.lang.String,
55      * java.lang.String, java.lang.String, int)
56      */

57     public void restartAction(String JavaDoc name, String JavaDoc overallMsg, String JavaDoc tipMsg, int no_of_steps)
58     {
59         overallOpLabel.setText(overallMsg);
60         tipLabel.setText(tipMsg);
61         currentStep = 0;
62         startAction(name, no_of_steps);
63     }
64
65     /**
66      * Normal progress indicator.
67      *
68      * @param val The progression value.
69      * @param msg The progression message.
70      */

71     public void progress(int val, String JavaDoc msg)
72     {
73         packProgressBar.setValue(val + 1);
74         packOpLabel.setText(msg);
75         currentStep++;
76     }
77
78     /*
79      * (non-Javadoc)
80      *
81      * @see com.izforge.izpack.util.ExtendedUIProgressHandler#progress(java.lang.String,
82      * java.lang.String)
83      */

84     public void progress(String JavaDoc stepMessage)
85     {
86         packOpLabel.setText(stepMessage);
87         currentStep++;
88         packProgressBar.setValue(currentStep);
89     }
90
91     /**
92      * Pack changing.
93      *
94      * @param packName The pack name.
95      * @param stepno The number of the pack.
96      * @param max The new maximum progress.
97      */

98     public void nextStep(String JavaDoc packName, int stepno, int max)
99     {
100         currentStep = 0;
101         super.nextStep(packName, stepno, max);
102     }
103
104 }
105
Popular Tags