public class SimpleInstallerListener extends 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 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 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(File dir,
PackFile pf)
This method will be called from the unpacker after one directory was created.
|
void |
afterFile(File file,
PackFile pf)
This method will be called from the unpacker after one file was installed.
|
void |
afterPack(Pack pack,
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(File dir,
PackFile pf)
This method will be called from the unpacker before one directory should be created.
|
void |
beforeFile(File file,
PackFile pf)
This method will be called from the unpacker before one file should be installed.
|
void |
beforePack(Pack pack,
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,
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 String |
getMsg(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 ArrayList progressBarCaller
protected static final 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(File file, PackFile pf) throws Exception
InstallerListener
afterFile
in interface InstallerListener
file
- current File object of the just installed filepf
- corresponding PackFile objectException
public void afterDir(File dir, PackFile pf) throws Exception
InstallerListener
afterDir
in interface InstallerListener
dir
- current File object of the just created directorypf
- corresponding PackFile objectException
public void afterPacks(AutomatedInstallData idata, AbstractUIProgressHandler handler) throws Exception
InstallerListener
afterPacks
in interface InstallerListener
idata
- object containing the current installation datahandler
- a handler to the current used UIProgressHandlerException
public void afterPack(Pack pack, Integer i, AbstractUIProgressHandler handler) throws Exception
InstallerListener
afterPack
in interface InstallerListener
pack
- current pack objecti
- current pack numberhandler
- a handler to the current used UIProgressHandlerException
public void beforePacks(AutomatedInstallData idata, Integer npacks, AbstractUIProgressHandler handler) throws Exception
InstallerListener
beforePacks
in interface InstallerListener
idata
- object containing the current installation datanpacks
- number of packs which are defined for this installationhandler
- a handler to the current used UIProgressHandlerException
public void beforePack(Pack pack, Integer i, AbstractUIProgressHandler handler) throws Exception
InstallerListener
beforePack
in interface InstallerListener
pack
- current pack objecti
- current pack numberhandler
- a handler to the current used UIProgressHandlerException
public boolean isFileListener()
InstallerListener
isFileListener
in interface InstallerListener
public void beforeFile(File file, PackFile pf) throws Exception
InstallerListener
beforeFile
in interface InstallerListener
file
- current File object of the file which should be installedpf
- corresponding PackFile objectException
public void beforeDir(File dir, PackFile pf) throws Exception
InstallerListener
beforeDir
in interface InstallerListener
dir
- current File object of the just directory which should be createdpf
- corresponding PackFile objectException
public 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 String getMsg(String id)
id
- string id for which the message should be resolvedWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses