Details
Description
TargetPanel was modified in order to take variables out of the install definition (Target.dir.os)
A nice feature would be to allow modifying the target path within user panels called before the target panel. This is impossible right now
After investigation, I noticed that the code loading the variables out of the install.xml file is called through the constructor.
- This is not safe, since calling an overidable method through a constructor can cause trouble in java (http://www.javapractices.com/topic/TopicAction.do?Id=215)*
- This prevents the default install path to be reevaluated each time the panel is actually showed.
Instead, I propose to call that code through the panelActivated() method which was created for this purpose
I issued a patch with this issue. I tested the patch which works
- created a user panel that let the user select some kind of "target environment" ie development or production
- that panel is the first to be called
- modified installer.xml so the TargetPanel.dir variable is using the variable defined in the first user panel
- tested the installer, the default install directory changes as expected
diff -r -w -u jponge-izpack-4.3.5 jponge-izpack-4.3.5-hq > patch.txt