Bug 157511 [Preferences] FileFieldEditor should have a constructor allowing the validation strategy to be set
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).
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/FileFieldEditor.java
* do not.
     */
    private File getFile(File startingDirectory) {
        FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
        if (startingDirectory != null) {
			dialog.setFileName(startingDirectory.getPath());
		}
        if (extensions != null) {
			dialog.setFilterExtensions(extensions);
		}
        String file = dialog.open();
        if (file != null) {
            file = file.trim();
            if (file.length() > 0) {
				return new File(file);
			}
        }
        return null;
    }
    /**
     * Sets this file field editor's file extension filter.
     *
     * @param extensions a list of file extension, or <code>null</code> 
     * to set the filter to the system's default value
     */
    public void setFileExtensions(String[] extensions) {
        this.extensions = extensions;
    }
}