001: /*
002: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
003: *
004: * http://izpack.org/
005: * http://izpack.codehaus.org/
006: *
007: * Copyright 2004 Klaus Bartz
008: *
009: * Licensed under the Apache License, Version 2.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: */
021:
022: package com.izforge.izpack.panels;
023:
024: import com.izforge.izpack.installer.InstallData;
025: import com.izforge.izpack.installer.InstallerFrame;
026: import com.izforge.izpack.util.ExtendedUIProgressHandler;
027:
028: /**
029: * The install panel class. Launches the actual installation job with extensions for custom actions.
030: *
031: * @author Klaus Bartz
032: */
033: public class ExtendedInstallPanel extends InstallPanel implements
034: ExtendedUIProgressHandler {
035:
036: private static final long serialVersionUID = 3257291344052500789L;
037:
038: protected int currentStep = 0;
039:
040: /**
041: * The constructor.
042: *
043: * @param parent The parent window.
044: * @param idata The installation data.
045: */
046: public ExtendedInstallPanel(InstallerFrame parent, InstallData idata) {
047: super (parent, idata);
048: }
049:
050: /*
051: * (non-Javadoc)
052: *
053: * @see com.izforge.izpack.util.ExtendedUIProgressHandler#startAction(java.lang.String,
054: * java.lang.String, java.lang.String, int)
055: */
056: public void restartAction(String name, String overallMsg,
057: String tipMsg, int no_of_steps) {
058: overallOpLabel.setText(overallMsg);
059: tipLabel.setText(tipMsg);
060: currentStep = 0;
061: startAction(name, no_of_steps);
062: }
063:
064: /**
065: * Normal progress indicator.
066: *
067: * @param val The progression value.
068: * @param msg The progression message.
069: */
070: public void progress(int val, String msg) {
071: packProgressBar.setValue(val + 1);
072: packOpLabel.setText(msg);
073: currentStep++;
074: }
075:
076: /*
077: * (non-Javadoc)
078: *
079: * @see com.izforge.izpack.util.ExtendedUIProgressHandler#progress(java.lang.String,
080: * java.lang.String)
081: */
082: public void progress(String stepMessage) {
083: packOpLabel.setText(stepMessage);
084: currentStep++;
085: packProgressBar.setValue(currentStep);
086: }
087:
088: /**
089: * Pack changing.
090: *
091: * @param packName The pack name.
092: * @param stepno The number of the pack.
093: * @param max The new maximum progress.
094: */
095: public void nextStep(String packName, int stepno, int max) {
096: currentStep = 0;
097: super.nextStep(packName, stepno, max);
098: }
099:
100: }
|