eclipse API: how do i check if there are any changes made in the preferences store on hitting cancel?
===

I have a preference page with a list and few text boxes. I want to pop a warning dialog,   to the user after he makes some changes and *without* hitting "apply" or "OK", he presses cancel.
Something like "You have unsaved changes. Are you sure you want to cancel?".

I tried `putValue(String,String)` but preference stores it immediately. How do I maintain an "intermediate" state sort of? Checking every text box's value or list's value would not be a good idea. 

There is a method `needsSaving()` but I dont know how it works. How do i make it return true?