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
MessageDialog.openError(getShell(), JFaceResources.getString("Error"), message); 
			}
		});
	}
	/**
	 * Selects the page determined by <code>lastSuccessfulNode</code> in the
	 * page hierarchy.
	 */
	void selectCurrentPageAgain() {
		if (lastSuccessfulNode == null)
			return;
		getTreeViewer().setSelection(new StructuredSelection(lastSuccessfulNode));
		currentPage.setVisible(true);
	}
	/**
	 * Selects the saved item in the tree of preference pages. If it cannot do
	 * this it saves the first one.
	 */
	protected void selectSavedItem() {
		IPreferenceNode node = findNodeMatching(getSelectedNodePreference());
		if (node == null) {
			IPreferenceNode[] nodes = preferenceManager.getRoot().getSubNodes();
			if (nodes.length > 0)
				node = nodes[0];
		}
		if (node != null) {
			getTreeViewer().setSelection(new StructuredSelection(node), true);
			
			getTreeViewer().getControl().setFocus();
		}