public class SimpleInstallerListener extends java.lang.Object implements InstallerListener
This class implements all methods of interface InstallerListener, but do not do anything. It can be used as base class to save implementation of unneeded methods.
Additional there are some common helper methods which are used from the base class SpecHelper.
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
doInformProgressBar |
private AutomatedInstallData |
installdata |
protected static java.lang.String |
LANG_FILE_NAME
The name of the XML file that specifies the panel langpack
|
protected static LocaleDatabase |
langpack
The packs locale database.
|
private static java.util.ArrayList |
progressBarCaller |
private SpecHelper |
specHelper |
AFTER_DIR, AFTER_FILE, AFTER_PACK, AFTER_PACKS, BEFORE_DIR, BEFORE_FILE, BEFORE_PACK, BEFORE_PACKS| Constructor and Description |
|---|
SimpleInstallerListener()
The default constructor.
|
SimpleInstallerListener(boolean useSpecHelper)
Constructs a simple installer listener.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterDir(java.io.File dir,
PackFile pf)
This method will be called from the unpacker after one directory was created.
|
void |
afterFile(java.io.File file,
PackFile pf)
This method will be called from the unpacker after one file was installed.
|
void |
afterPack(Pack pack,
java.lang.Integer i,
AbstractUIProgressHandler handler)
This method will be called from the unpacker after the installation of one pack was
performed.
|
void |
afterPacks(AutomatedInstallData idata,
AbstractUIProgressHandler handler)
This method will be called from the unpacker after the installation of all packs was
performed.
|
void |
beforeDir(java.io.File dir,
PackFile pf)
This method will be called from the unpacker before one directory should be created.
|
void |
beforeFile(java.io.File file,
PackFile pf)
This method will be called from the unpacker before one file should be installed.
|
void |
beforePack(Pack pack,
java.lang.Integer i,
AbstractUIProgressHandler handler)
This method will be called from the unpacker before the installation of one pack will be
performed.
|
void |
beforePacks(AutomatedInstallData idata,
java.lang.Integer npacks,
AbstractUIProgressHandler handler)
This method will be called from the unpacker before the installation of all packs will be
performed.
|
AutomatedInstallData |
getInstalldata()
Returns the current installdata object.
|
protected java.lang.String |
getMsg(java.lang.String id)
Returns the language dependant message from the resource CustomActionsLang.xml or the common
language pack for the given id.
|
static int |
getProgressBarCallerCount()
Returns the count of listeners which are registered as progress bar caller.
|
protected int |
getProgressBarCallerId()
Returns the progress bar caller id of this object.
|
SpecHelper |
getSpecHelper()
Returns current specification helper.
|
protected boolean |
informProgressBar()
Returns whether this object should inform the progress bar or not.
|
boolean |
isFileListener()
Returns true if this listener would be informed at every file and directory installation,
else false.
|
void |
setInstalldata(AutomatedInstallData data)
Sets the installdata object.
|
protected void |
setProgressBarCaller()
Sets this object as progress bar caller.
|
void |
setSpecHelper(SpecHelper helper)
Sets the given specification helper to the current used helper.
|
private static java.util.ArrayList progressBarCaller
protected static final java.lang.String LANG_FILE_NAME
protected static LocaleDatabase langpack
protected static boolean doInformProgressBar
private AutomatedInstallData installdata
private SpecHelper specHelper
public SimpleInstallerListener()
public SimpleInstallerListener(boolean useSpecHelper)
useSpecHelper - public void afterFile(java.io.File file,
PackFile pf)
throws java.lang.Exception
InstallerListenerafterFile in interface InstallerListenerfile - current File object of the just installed filepf - corresponding PackFile objectjava.lang.Exceptionpublic void afterDir(java.io.File dir,
PackFile pf)
throws java.lang.Exception
InstallerListenerafterDir in interface InstallerListenerdir - current File object of the just created directorypf - corresponding PackFile objectjava.lang.Exceptionpublic void afterPacks(AutomatedInstallData idata, AbstractUIProgressHandler handler) throws java.lang.Exception
InstallerListenerafterPacks in interface InstallerListeneridata - object containing the current installation datahandler - a handler to the current used UIProgressHandlerjava.lang.Exceptionpublic void afterPack(Pack pack, java.lang.Integer i, AbstractUIProgressHandler handler) throws java.lang.Exception
InstallerListenerafterPack in interface InstallerListenerpack - current pack objecti - current pack numberhandler - a handler to the current used UIProgressHandlerjava.lang.Exceptionpublic void beforePacks(AutomatedInstallData idata, java.lang.Integer npacks, AbstractUIProgressHandler handler) throws java.lang.Exception
InstallerListenerbeforePacks in interface InstallerListeneridata - object containing the current installation datanpacks - number of packs which are defined for this installationhandler - a handler to the current used UIProgressHandlerjava.lang.Exceptionpublic void beforePack(Pack pack, java.lang.Integer i, AbstractUIProgressHandler handler) throws java.lang.Exception
InstallerListenerbeforePack in interface InstallerListenerpack - current pack objecti - current pack numberhandler - a handler to the current used UIProgressHandlerjava.lang.Exceptionpublic boolean isFileListener()
InstallerListenerisFileListener in interface InstallerListenerpublic void beforeFile(java.io.File file,
PackFile pf)
throws java.lang.Exception
InstallerListenerbeforeFile in interface InstallerListenerfile - current File object of the file which should be installedpf - corresponding PackFile objectjava.lang.Exceptionpublic void beforeDir(java.io.File dir,
PackFile pf)
throws java.lang.Exception
InstallerListenerbeforeDir in interface InstallerListenerdir - current File object of the just directory which should be createdpf - corresponding PackFile objectjava.lang.Exceptionpublic SpecHelper getSpecHelper()
public void setSpecHelper(SpecHelper helper)
helper - specification helper which should be usedpublic AutomatedInstallData getInstalldata()
public void setInstalldata(AutomatedInstallData data)
data - installdata object which should be set to currentpublic static int getProgressBarCallerCount()
protected int getProgressBarCallerId()
protected void setProgressBarCaller()
protected boolean informProgressBar()
protected java.lang.String getMsg(java.lang.String id)
id - string id for which the message should be resolved