root / trunk / build / distribution / IzPack / src / lib / com / izforge / izpack / panels / ExtendedInstallPanel.java @ 21757
History | View | Annotate | Download (3 KB)
1 |
/*
|
---|---|
2 |
* $Id: ExtendedInstallPanel.java 5819 2006-06-14 07:29:09Z cesar $
|
3 |
* IzPack
|
4 |
* Copyright (C) 2004 Klaus Bartz
|
5 |
*
|
6 |
* File : ExtendedInstallPanel.java
|
7 |
* Description : A panel to launch the installation process.
|
8 |
* Author's email : bartzkau@users.berlios.de
|
9 |
*
|
10 |
* This program is free software; you can redistribute it and/or
|
11 |
* modify it under the terms of the GNU General Public License
|
12 |
* as published by the Free Software Foundation; either version 2
|
13 |
* of the License, or any later version.
|
14 |
*
|
15 |
* This program is distributed in the hope that it will be useful,
|
16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
* GNU General Public License for more details.
|
19 |
*
|
20 |
* You should have received a copy of the GNU General Public License
|
21 |
* along with this program; if not, write to the Free Software
|
22 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
23 |
*/
|
24 |
package com.izforge.izpack.panels; |
25 |
|
26 |
|
27 |
import com.izforge.izpack.installer.InstallData; |
28 |
import com.izforge.izpack.installer.InstallerFrame; |
29 |
import com.izforge.izpack.util.ExtendedUIProgressHandler; |
30 |
|
31 |
/**
|
32 |
* The install panel class.
|
33 |
* Launches the actual installation job with extensions for
|
34 |
* custom actions.
|
35 |
*
|
36 |
* @author Klaus Bartz
|
37 |
*/
|
38 |
public class ExtendedInstallPanel extends InstallPanel |
39 |
implements ExtendedUIProgressHandler
|
40 |
{ |
41 |
protected int currentStep = 0; |
42 |
|
43 |
|
44 |
/**
|
45 |
* The constructor.
|
46 |
*
|
47 |
* @param parent The parent window.
|
48 |
* @param idata The installation data.
|
49 |
*/
|
50 |
public ExtendedInstallPanel(InstallerFrame parent, InstallData idata)
|
51 |
{ |
52 |
super(parent, idata);
|
53 |
} |
54 |
|
55 |
/* (non-Javadoc)
|
56 |
* @see com.izforge.izpack.util.ExtendedUIProgressHandler#startAction(java.lang.String, java.lang.String, java.lang.String, int)
|
57 |
*/
|
58 |
public void restartAction(String name, String overallMsg, String tipMsg, int no_of_steps) |
59 |
{ |
60 |
overallOpLabel.setText(overallMsg); |
61 |
tipLabel.setText(tipMsg); |
62 |
currentStep = 0;
|
63 |
startAction(name, no_of_steps ); |
64 |
} |
65 |
|
66 |
/**
|
67 |
* Normal progress indicator.
|
68 |
*
|
69 |
* @param val The progression value.
|
70 |
* @param msg The progression message.
|
71 |
*/
|
72 |
public void progress(int val, String msg) |
73 |
{ |
74 |
packProgressBar.setValue(val + 1);
|
75 |
packOpLabel.setText(msg); |
76 |
currentStep++; |
77 |
} |
78 |
|
79 |
|
80 |
/* (non-Javadoc)
|
81 |
* @see com.izforge.izpack.util.ExtendedUIProgressHandler#progress(java.lang.String, java.lang.String)
|
82 |
*/
|
83 |
public void progress(String stepMessage) |
84 |
{ |
85 |
packOpLabel.setText(stepMessage); |
86 |
currentStep++; |
87 |
packProgressBar.setValue(currentStep); |
88 |
} |
89 |
|
90 |
/**
|
91 |
* Pack changing.
|
92 |
*
|
93 |
* @param packName The pack name.
|
94 |
* @param stepno The number of the pack.
|
95 |
* @param max The new maximum progress.
|
96 |
*/
|
97 |
public void nextStep(String packName, int stepno, int max) |
98 |
{ |
99 |
currentStep = 0;
|
100 |
super.nextStep(packName, stepno, max);
|
101 |
} |
102 |
|
103 |
} |