Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 400042 - Help of Shell is overriden by Eclipse when Workbench starts
Summary: Help of Shell is overriden by Eclipse when Workbench starts
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M1   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 422092
  Show dependency tree
 
Reported: 2013-02-05 20:46 EST by Janice Li CLA
Modified: 2013-11-19 16:42 EST (History)
1 user (show)

See Also:


Attachments
Move setting the help system (1.03 KB, patch)
2013-02-06 08:44 EST, Paul Webster CLA
no flags Details | Diff
Test plugin for the problem (17.30 KB, application/zip)
2013-07-25 20:32 EDT, Janice Li CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Janice Li CLA 2013-02-05 20:46:01 EST
Our product (IBM Installation Manager) has one perspective with a stand-alone view. In the ViewPart.setFocus(), we set the help id by using:

public void setFocus() {
    PlatformUI.getWorkbench().getHelpSystem().setHelp(this.getSite().getShell(), getHelpRef());
   //....
}

But ViewPart.setFocus() is called in 'page.setPerspective(perspective)' in WorkbenchWindow.setup():

public void setup() {
  //...
  page.setPerspective(perspective);
  //...
  workbench.getHelpSystem().setHelp(getShell(),
IWorkbenchHelpContextIds.WORKBENCH_WINDOW);
  //...
}

And later one, the help id for our product shell was overriden by workbench.getHelpSystem().setHelp(getShell(),
IWorkbenchHelpContextIds.WORKBENCH_WINDOW);

as you can see from WorkbenchWindow.setup(). This is a regression from Eclipse 4.2.1 adoption.
Comment 1 Paul Webster CLA 2013-02-06 08:44:37 EST
Created attachment 226624 [details]
Move setting the help system

I can move the help system linking up to a similar position in the setup() method (before the perspective is set/fired).

Does this patch help?

Also, how do I activate something that will show help for this shell, so I can make sure it doesn't break anything?

PW
Comment 2 Janice Li CLA 2013-02-06 13:33:18 EST
I think this patch will fix the problem.

Not sure if I understand your question of 'Also, how do I activate something that will show help for this shell, so I can make sure it doesn't break anything?'. 

Our product displays the stand-alone view in the Shell and when user presses F1 button, WorkbenchHelpSystem.displayContext(IContext, int, int) would be called to display the CS help.
Comment 3 Janice Li CLA 2013-03-19 15:34:32 EDT
When will the fix be delivered?
Comment 4 Paul Webster CLA 2013-03-19 16:04:22 EDT
I don't have a reproducible scenario in the eclipse SDK yet to prove it fixes something.

PW
Comment 5 Janice Li CLA 2013-05-30 18:30:26 EDT
Is there anything I can help to make this problem fixed in the next release of eclipse? Thanks.
Comment 6 Paul Webster CLA 2013-05-31 07:09:44 EDT
(In reply to comment #5)
> Is there anything I can help to make this problem fixed in the next release
> of eclipse? Thanks.

I still need a test that fails before the patch but works afterwards.

PW
Comment 7 Janice Li CLA 2013-05-31 12:15:57 EDT
Is a simple RCP ok? I can try to extract some of our product's plugins into a test. Thanks.
Comment 8 Paul Webster CLA 2013-05-31 12:19:47 EDT
Yes, if you had a simple RCP example plugin that would be great.

PW
Comment 9 Janice Li CLA 2013-07-25 20:32:16 EDT
Created attachment 233813 [details]
Test plugin for the problem

Here is a RCP plugin to use to re-produce the problem.

1. To see the problem, you need to clear the workspace. 
   1) if you set a break point at 'setFocus()' for the View, it will be hit first.
   2) then in 'WorkbenchWindow.setup()':
      
      .....
      workbench.getHelpSystem().setHelp(getShell(),
IWorkbenchHelpContextIds.WORKBENCH_WINDOW);

     would be hit later.

2. Another problem is also detected with this plugin:
   1) if you don't clear the workspace, re-use the perspective opened in the last session, launch this plugin, this problem won't occur.
   2) after the View is open, hit F1 button, the help would be displayed on the right hand side correctly.
   3) Click on anything in the View, the help would be changed to Eclipse workbench help, which is not correct.
Comment 10 Paul Webster CLA 2013-07-29 14:37:54 EDT
(In reply to comment #9)
> Created attachment 233813 [details]
> Test plugin for the problem

Thanks for the test plugin.  Fix released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d731b6c381d06a8e796f2a035d75a959e1813d79

PW
Comment 11 Dani Megert CLA 2013-08-09 04:03:56 EDT
Moving to M2 as per bug 414630 comment 4.
Comment 12 Paul Webster CLA 2013-08-09 10:19:46 EDT
released.

PW
Comment 13 Paul Webster CLA 2013-08-09 10:19:55 EDT
In 4.4.0.I20130806-2000

PW