Bug 244284 [Preferences] Preference page help is not shown when tree is selected
In the Preferences dialog, some pages don't have a help context associated with them. On these pages, the behavior of the help button/F1 key is inconsistent: the help tray is shown if a widget on the respective page is shown, but _not_ if the tree item is selected. Steps to reproduce the problem: 1. Open the Preferences dialog 2. Select the tree item "Tasks" 3. Press F1 (or press the help button in the lower left corner) -> no help is shown 4. Select any widget on the Tasks page 5. Press F1 -> the help tray is shown Root cause analysis: As far as I could find out, the reason for this inconsistent behavior lies in the method org.eclipse.jface.preference.PreferencePage.performHelp(), which is triggered in step 3. This method assumes, that the preference page's top level control has a help listener attached to it. This is true for many other preference pages [see for example org.eclipse.jdt.internal.ui.preferences.JavaBasePreferencePage.createControl(Composite)], but not for the Task preference page [sorry, couldn't find its source code]. So why does step 5 still show the help tray? That step triggers org.eclipse.jface.dialogs.TrayDialog.helpPressed() which searches the widget hierarchy for a help listener, and will always find one on the dialog level. I suggest to chage PreferencePage.performHelp() so that it behaves like TrayDialog.helpPressed(), for example by copying the recursive search for help handlers.
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
GridData titleGridData = new GridData(GridData.FILL_HORIZONTAL);
		titleGridData.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN;
		formTitleComposite.setLayoutData(titleGridData);
		
		
		Composite titleComposite = new Composite(formTitleComposite, SWT.NONE);
		layout = new GridLayout();
		layout.marginBottom = 5;
		layout.marginHeight = 0;
		layout.marginWidth = 0;
		layout.horizontalSpacing = 0;
		titleComposite.setLayout(layout);
		
		FormData titleFormData = new FormData();
	   	titleFormData.top = new FormAttachment(0,0);
    	titleFormData.left = new FormAttachment(0,0);
    	titleFormData.right = new FormAttachment(100,0);
    	titleFormData.bottom = new FormAttachment(100,0);
		
		titleComposite.setLayoutData(titleFormData);
		createTitleArea(titleComposite);
		
		Label separator = new Label(pageAreaComposite, SWT.HORIZONTAL | SWT.SEPARATOR);
		separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
		
		
		
		pageContainer = createPageContainer(pageAreaComposite);
		GridData pageContainerData = new GridData(GridData.FILL_BOTH);