I investigated my issue further, and I realized that I have hit bug 200855
https://bugs.eclipse.org/bugs/show_bug.cgi?id=200855
Essentially my problem is that the IManagedOptionValueHandler is called when Apply is pressed, but not when OK is pressed.
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Mario Pierro
Sent: den 7 april 2011 12:52
To: CDT General developers list.
Subject: [cdt-dev] [MBS] Validating toolchain string options
Hello,
I am trying to verify the value of a string option in a MBS toolchain definition, in order to prevent the option from being written to the configuration if it is not valid (in this case, it must represent an integer).
I have been trying to use IOptionApplicability.isOptionEnabled() and IManagedOptionValueHandler.handleValue() for this purpose, but this has not worked well as the previous value of the option is not retained. Also, both handlers are being invoked each time a char is typed in the option’s field editor, which makes displaying an error dialog very difficult.
I have noticed that bug 320949 has been now fixed, adding support for option custom field editors, which is great.
Is there any other way to check for validity of an option value in CDT 6 / 7 ?
Thank you for your help,
/Mario Pierro