[izpack-devel] Another patch suggestion: setting multiple variables in radio fields

Joachim Hofer joachim.hofer at imbus.de
Wed Jul 19 12:47:03 CEST 2006


Hi,

another thing I needed to add...

Scenario: The user selects a JDBC driver type via radio buttons. The
application has two variables "$jdbcURL" and "$jdbcClass" that need to
be substituted in various configuration files. The current radio field
can only set one of them. We need to set both at once.

I extended the XML of the <choice> tag within the <field type="radio">
section of UserInputPanel.xml and adapted UserInputPanel.java accordingly.

Now it is possible to do the following (as an example):

    <field type="radio" variable="ClientMinimalMem">
      <description align="left"  id="minRAM"
          txt="please enter client minimal memory" />
      <spec>
        <choice txt=" 32 MB" id="minimal.1" value="-Xms32m">
          <assign variable="meminfo" value="32 MB" />
          <assign variable="meminfo_extended"
              value="The current minimal memory is set to 32 MB" />
        </choice>
        <choice txt=" 64 MB" id="minimal.2" value="-Xms64m" set="true">
          <assign variable="meminfo" value="64 MB" />
          <assign variable="meminfo_extended"
              value="The current minimal memory is set to 64 MB" />
        </choice>
      </spec>
    </field>

The attached patch handles this in the intuitive way (setting
$ClientMinimalMem to "-Xms32m"/"-Xms64m", $meminfo to "32 MB"/"64 MB"
etc respectively).

The patch is combined with my previous patch suggestion, as I haven't
branched separately.

I also cleaned up two compiler warnings happening with jdk 1.5 (though
this will probably stop compilation with jdk 1.4 if that has still been
working before).

Joachim Hofer
imbus AG
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: UserInputPanel.java.diff
Url: https://lists.berlios.de/pipermail/izpack-devel/attachments/20060719/a43a739a/attachment.ksh 


More information about the izpack-devel mailing list