Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335514 - [Compatibility] Context help in 'Help' view is stale
Summary: [Compatibility] Context help in 'Help' view is stale
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1 M6   Edit
Assignee: Remy Suen CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-26 16:59 EST by Chris Goldthorpe CLA
Modified: 2011-02-08 18:33 EST (History)
3 users (show)

See Also:


Attachments
EPartService patch v1 (1.04 KB, patch)
2011-02-02 10:01 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Goldthorpe CLA 2011-01-26 16:59:57 EST
I20110125-2200

Launch Eclipse, select a view and hit F1, the correct context help displays in the help view.

Now click around to different views, note that the title for the context help is correct but the description and links are not. For example after clicking on the JavaDoc view I see

About JavaDoc

This view allows the user to view help pages, view the help table of contents or search the help system.
See also:
The Help View

Sometimes the title and description both match but often the description comes from a previously selected view or editor.
Comment 1 Chris Goldthorpe CLA 2011-01-26 18:33:57 EST
Parts which use an  IContextProvider seem to work fine, the problem occurs for all other parts. The HelpView class is listening for part activation events, when it gets one and there is no IContextProvider the code below is used to determine which control in the view being switched to is has focus.

    Display display = part.getSite().getShell().getDisplay();
    Control c = display.getFocusControl();

In Eclipse 3.7 display.getFocusControl() returns the control that has focus after the part activation, in Eclipse 4.1 it returns the control that had focus before the part activation.
Comment 2 Remy Suen CLA 2011-01-27 16:13:29 EST
This seems to be primarily noticeable if I switch between views in the same stack. If I click on different stacks it does not appear to occur.
Comment 3 Remy Suen CLA 2011-02-02 10:01:38 EST
Created attachment 188149 [details]
EPartService patch v1

Activation events were being fired before the part was granted focus. This patch delays the activation notification so that the part will get focus first.
Comment 4 Remy Suen CLA 2011-02-02 10:32:53 EST
(In reply to comment #3)
> Activation events were being fired before the part was granted focus. This
> patch delays the activation notification so that the part will get focus first.

Initially I was concerned that the active part wouldn't match the part that got its focus method called...but that actually seems to be the case in 3.x. I suppose I can buy that it's not technically active until focus has been granted and the method has returned.
Comment 5 Remy Suen CLA 2011-02-02 10:47:41 EST
(In reply to comment #3)
> Created attachment 188149 [details]
> EPartService patch v1

Patch released to HEAD. It's early in M6 so we should have plenty of time to gauge the severity of this change.

Thanks for the bug report, Chris!
Comment 6 Chris Goldthorpe CLA 2011-02-08 18:33:50 EST
Verified in I20110204-0715.