Project: Eclipse_Platform_UI
Bug 109389 [JFace] API - IntegerFieldEditor does not fire property change all the time
Reported: 2005-09-13 09:24:41 | Status: verified fixed

How to reproduce : JDT must be installed. Open Run->debug... Create a new Remote Java Application. Select (Standard)Socket Attach if not already selected. Change the default port value 8000 to 800011 (this value is invalid but is does not matter). Click on the Apply button. Select another debug configuration and come back to the configuration we have just created. Select the last two figures 11 in the port value and suppress them so that the port value is 8000 again. You will then notice that the apply button is still grayed out, because the IntegerFieldEditor did not fire a propertychange event. Here is the code that should correct it from org.eclipse.jface.preference.IntegerFieldEditor: /* (non-Javadoc) * Method declared on FieldEditor. */ protected void doLoad() { Text text = getTextControl(); if (text != null) { int value = getPreferenceStore().getInt(getPreferenceName()); text.setText("" + value);//$NON-NLS-1$ oldvalue = "" + value;<----------------------- this must be added } } and oldvalue must be made protected in the StringFieldEditor. I think that should correct the bug. Sebastien.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IntegerFieldEditor.java bundles/org.eclipse.jface/src/org/eclipse/jface/preference/StringFieldEditor.java