root / import / ext3D / trunk / install-extension3d / IzPack / src / lib / com / izforge / izpack / event / ProgressBarInstallerListener.java @ 15280
History | View | Annotate | Download (2.71 KB)
1 |
/*
|
---|---|
2 |
* $Id: ProgressBarInstallerListener.java,v 1.1 2006/06/14 07:29:07 cesar Exp $
|
3 |
* IzPack
|
4 |
* Copyright (C) 2004 Klaus Bartz
|
5 |
*
|
6 |
* File : ProgressBarInstallerListener.java
|
7 |
* Description : Installer listener for support of progress bar interactions.
|
8 |
* Author's email : bartzkau@users.berlios.de
|
9 |
*
|
10 |
*
|
11 |
* This program is free software; you can redistribute it and/or
|
12 |
* modify it under the terms of the GNU General Public License
|
13 |
* as published by the Free Software Foundation; either version 2
|
14 |
* of the License, or any later version.
|
15 |
*
|
16 |
* This program is distributed in the hope that it will be useful,
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
* GNU General Public License for more details.
|
20 |
*
|
21 |
* You should have received a copy of the GNU General Public License
|
22 |
* along with this program; if not, write to the Free Software
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
24 |
*/
|
25 |
package com.izforge.izpack.event; |
26 |
|
27 |
import com.izforge.izpack.installer.AutomatedInstallData; |
28 |
import com.izforge.izpack.util.AbstractUIProgressHandler; |
29 |
import com.izforge.izpack.util.Debug; |
30 |
import com.izforge.izpack.util.ExtendedUIProgressHandler; |
31 |
|
32 |
/**
|
33 |
* Installer listener for reset the progress bar and initialize
|
34 |
* the simple installer listener to support progress bar interaction.
|
35 |
* To support progress bar interaction add this installer listener
|
36 |
* as first listener.
|
37 |
*
|
38 |
* @author Klaus Bartz
|
39 |
*
|
40 |
*/
|
41 |
public class ProgressBarInstallerListener extends SimpleInstallerListener |
42 |
{ |
43 |
|
44 |
/**
|
45 |
*
|
46 |
*/
|
47 |
public ProgressBarInstallerListener()
|
48 |
{ |
49 |
super(false); |
50 |
// TODO Auto-generated constructor stub
|
51 |
} |
52 |
|
53 |
/* (non-Javadoc)
|
54 |
* @see com.izforge.izpack.compiler.InstallerListener#afterPacks(com.izforge.izpack.installer.AutomatedInstallData, com.izforge.izpack.util.AbstractUIProgressHandler)
|
55 |
*/
|
56 |
public void afterPacks( |
57 |
AutomatedInstallData idata, |
58 |
AbstractUIProgressHandler handler) |
59 |
throws Exception |
60 |
{ |
61 |
if( handler instanceof ExtendedUIProgressHandler && |
62 |
getProgressBarCallerCount() > 0)
|
63 |
{ |
64 |
String progress = getMsg("CustomActions.progress"); |
65 |
String tip = getMsg("CustomActions.tip"); |
66 |
if( tip.equals("CustomActions.tip") || progress.equals("CustomActions.progress")) |
67 |
{ |
68 |
Debug.trace("No messages found for custom action progress bar interactions; skiped.");
|
69 |
return;
|
70 |
} |
71 |
((ExtendedUIProgressHandler) handler).restartAction("Configure",
|
72 |
progress, tip, getProgressBarCallerCount()); |
73 |
SimpleInstallerListener.doInformProgressBar = true;
|
74 |
} |
75 |
} |
76 |
|
77 |
|
78 |
} |