Project: Eclipse_Platform_UI
Bug 157511 [Preferences] FileFieldEditor should have a constructor allowing the validation strategy to be set
Reported: 2006-09-15 14:36:48 | Status: verified fixed

When using the org.eclipse.jface.preference.FileFieldEditor, a user can enter an invalid filename and no error is shown unless focus is removed from the preference page and than brought back to it. As soon as the user types again, the error message is removed and the user doesn't know if the file is valid until they remove/reapply focus to the preference page. Using the StringFieldEditor::setValidateStrategy(int value) method after constructing the object does not solve the problem since StringFieldEditor::getTextControl(Composite parent) is called indirectly from the constructor and the listeners will already be setup before there is a chance to set the validation strategy. Therefore a constructor for the FileFieldEditor is needed that will allow a user to supply the validation strategy they need (since the default is currently VALIDATE_ON_FOCUS_LOST).

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