[izpack-users] Disable/Enable or Select/Deselect packs based on a variable

Hal Vaughan hal at thresholddigital.com
Mon Mar 6 23:59:58 CET 2006


On Monday 06 March 2006 17:21, Rich Stephens wrote:
> I have a need to set whether a pack is available to be installed
> based on a variable set at install time.
>
> I have a hidden custom panel that does some system checks and
> determines things about the current installation and sets a variable,
> let's call it "install_type".  In this case, I would like certain
> packs to be preselected (and others to be completely disabled) if
> "install_type" is set to "server", and a different set of panels to
> be preselected (and again, others disabled) if "install_type" is set
> to "client".
>
> I see and understand packs dependencies where one pack depends upon
> the selection of another, but there doesn't appear to be a way to set
> a pack to be dependent upon the value of a variable.
>
> If that feature doesn't exist (and it appears that it doesn't) could
> someone point me to the best place in the code to check for and
> disable/enable and/or select/deselect a panel based on a variable
> value? I know how to check a variable's value, but I'm unsure of the
> best place in the code to go about trying
> disable/enable/select/deselect a panel on the fly based on a
> variable.

In the InstallData object, which is passed to each panel when 
constructed, contains two lists, allPacks and selectedPacks.  In many 
panels, InstallData is named iData (or, also, id).  Can read the packs 
list with iData.allPacks or iData.selectedPacks.

If you want an example, and a panel you can use for troubleshooting, I 
just posted DataCheckPanel to the list yesterday, which reads all the 
InstallData variables and all the packs.  This could give you an 
example for reading the packs (both all and selected), and may well 
help you with debugging.  Just in case, I've taken the liberty of 
attaching the updated source code (fine tuned by Fabrice Mirable).

That lists the packs, and, basically, all you need to do to remove a 
pack is use the List remove() method on either allPacks or 
selectedPacks.

Hope this helps!

Hal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DataCheckPanel.java
Type: text/x-java
Size: 4322 bytes
Desc: not available
Url : https://lists.berlios.de/pipermail/izpack-users/attachments/20060306/90bce9cd/attachment.bin 


More information about the izpack-users mailing list