[izpack-devel] Text-field validator + variable substitutor for staticText filed

Piotr Skowronek piotr at skowro.net
Tue Jan 15 12:52:08 CET 2008


Hi All,

In the attachment you can find following extensions:

1) Text fields now can support Validators. Validation has been
done basing on Rule-field validator.

Example of use:
<field type="text" variable="hostname">
	<spec txt="Enter hostname:"/>
	<validator 	class="com.izforge.izpack.util.RegularExpressionValidator" 
txt="Must 	have at least 3 characters long">
		<param name="pattern" value=".{3,}"/>
	</validator>
</field>


2) Added Variable substitutor to the following field types:
- title
- staticText
- description
- spec

The method UserInputPanel#getText has been amended,
to do variable substitution (getText is used by those types of fields). 
The modification also supports langpacks.

Example of use:
<field type="title" txt="Settings for server name: $hostname"/>

In above example, $hostname will be replaced by the value of $hostname 
variable.


3) Modification of UserInputPanel, two new mothods have been added:
showMessageDialog, and showWarningMessageDialog (whch invokes the first 
one). I have introduced this methods to clean up the code, now, 
following methods use these helpers instead of calling 
JOptionPane.showMessageDialog directly:
- readPasswordField
- readRuleField
- readTextField
- actionPerformed


Can you tell what do you think about these enhancements?

Regards
Piotr Skowronek
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ps_patch.diff
Url: https://lists.berlios.de/pipermail/izpack-devel/attachments/20080115/b7f98414/attachment.ksh 


More information about the izpack-devel mailing list