Bug 75988 [Preferences] IPreferencePage#performOk() returning false should prevent the dialog from closing
I think that if this method returns false, it should prevent the dialog from closing. Today, in order to perform validation I have to register key listeners to all fields an use #setValid(false) to disable the "OK" button.
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
titleImage.setSize(0, 0);
				titleImage.getParent().layout();
			}
		} else {
			if (showingError) {
				
				showingError = false;
				titleImage.setImage(JFaceResources.getImage(PREF_DLG_TITLE_IMG));
				titleImage.computeSize(SWT.NULL, SWT.NULL);
				titleImage.getParent().layout();
			}
		}
		messageArea.updateText(getShortenedString(message), messageType);
	}
	private final String ellipsis = "..."; 
	/**
	 * Shortened the message if too long.
	 * 
	 * @param textValue
	 *            The messgae value.
	 * @return The shortened string.
	 */
	private String getShortenedString(String textValue) {
		if (textValue == null)
			return null;
		Display display = titleArea.getDisplay();
		GC gc = new GC(display);
		int maxWidth = titleArea.getBounds().width - 28;
		if (gc.textExtent(textValue).x < maxWidth) {
			gc.dispose();