I have been trying to write a verifylistener for a swt text object that:

1. Allows "NaN" or "Infinity" or "" or a double (decimal)
2. If the decimal has more than 3 decimal places I need it to round and replace the fields contents to 3 decimal places.
3. It will also need to allow ints as a user will have to type an integer before a decimal point e.g. "32"
4. It will need to allow ints followed by a decimal (and no decimal value) e.g. "32."

I have tried so many things and I just can't seem to get what should be easy to work.

Any suggestions would be greatly appreciated.