Bug 48400 [Dialogs] MessageDialog needs javadoc for returnCode == -1
org.eclipse.jface.dialogs.MessageDialog extends handleShellCloseEvent() and sets a returnCode of -1 when the dialog is closed without pressing a button (pressed esc key or clicked close box). This special returnCode needs to be commented in JavaDocs, since it is an unexpected result (and already caused problems). I suggest to ... - transform the comment for handleShellCloseEvent() into a JavaDoc comment - replace '-1' by SWT.DEFAULT or a new 'public static final int' constant - mention the special returnCode in MessageDialog's class JavaDoc
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/MessageDialog.java
if(defaultButton && !customShouldTakeFocus())
		button.setFocus();
	return button;
}
/**
 * Return whether or not we should apply the workaround where
 * we take focus for the default button or if that should be 
 * determined by the dialog.
 * By default only return true if the custom area is a label
 * or CLabel that cannot take focus.
 * @return boolean
 */
protected boolean customShouldTakeFocus() {
	if(customArea instanceof Label) 
		return false;
	
	if(customArea instanceof CLabel)
		return (customArea.getStyle() & SWT.NO_FOCUS) > 0;
	
	return true;	
}
	/*
	 * @see IconAndMessageDialog#getImage()
	 */
	public Image getImage() {
		return image;
	}
}