Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Platform - User Assistance (UA) » context help showing wrong content
context help showing wrong content [message #475122] Tue, 03 March 2009 15:21 Go to next message
Chris Merrill is currently offline Chris MerrillFriend
Messages: 19
Registered: July 2009
Junior Member
Our product is an an RCP-based app that uses the context-sensitive help (along with
a full manual using the Eclipse help system). We have "infopops" for most of our
views and editors. When focus is inside one of the views/editors and we push F1, we
get the right content. If we then click inside another component which has an
infopop, the "About ..." heading will update correctly to reflect the view that was
selected, but the paragraph below the heading still shows the content related to the
previous view. We can then click a 3rd view and the about heading will again update
correctly but the paragraph below the heading will show the content for the 2nd
view selected. We can rotate between the 3 views/editors and the content is always
one click behind. In any of the three after clicking and seeing the wrong content
(but right heading), we can hit F1 and see the correct content. Also, the "dynamic
help" section shows the correct content at each step, just like the heading of the
"about" section.

I assumed our code was doing something wrong (since we haven't updated this part of
the code for several releases, probably back to Eclipse 3.1) but all the code examples
I found did the same thing we do - in createView() we do this:
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "<context_id>");
where parent is the composite passed into createView().

Our editors do fire their own selection events, but the views don't, so that doesn't
seem like a likely cause...but I thought it was worth mentioning.

I should also add that we are currently deploying the with Eclipse 3.3, but one of
our developers has it working with 3.4 in his development environment and it shows
the same behavior.

I can do a screencast, record a video or provide our installer, if it would be helpful
to see the behavior. I can also provide a complete list of the plugins we have
installed....or anything else that would help :>

Any help would be most appreciated! My next step is to try stepping into the Eclipse
code, but I fear that may not be very productive for me without knowing where
to look :(

Thanks in advance!
Chris
Re: context help showing wrong content - solved [message #475226 is a reply to message #475122] Wed, 04 March 2009 13:50 Go to previous messageGo to next message
Chris Merrill is currently offline Chris MerrillFriend
Messages: 19
Registered: July 2009
Junior Member
After stepping through the Eclipse code, I found the source of the problem. Some (most)
of our editors and views were not implementing setFocus() correctly. As a result, the
help viewer was using the newly selected part but then using getDisplay().getFocusControl(),
which was (correctly) returning a Control that was not in the part. The HelpView
does not check this, so it renders the title from the current part, but looks up the
help context for a control that is in another part - and thus displays the wrong
content with the correct title. This happens even if the user clicks within the
view, thus setting focus to a control in the view. At that point, the help has
already been updated.

So the solution, obviously, is to implement setFocus() correctly.

Chris
Re: context help showing wrong content - solved [message #623237 is a reply to message #475122] Wed, 04 March 2009 13:50 Go to previous messageGo to next message
Chris Merrill is currently offline Chris MerrillFriend
Messages: 19
Registered: July 2009
Junior Member
After stepping through the Eclipse code, I found the source of the problem. Some (most)
of our editors and views were not implementing setFocus() correctly. As a result, the
help viewer was using the newly selected part but then using getDisplay().getFocusControl(),
which was (correctly) returning a Control that was not in the part. The HelpView
does not check this, so it renders the title from the current part, but looks up the
help context for a control that is in another part - and thus displays the wrong
content with the correct title. This happens even if the user clicks within the
view, thus setting focus to a control in the view. At that point, the help has
already been updated.

So the solution, obviously, is to implement setFocus() correctly.

Chris
Re: context help showing wrong content - solved [message #740279 is a reply to message #623237] Tue, 18 October 2011 10:39 Go to previous message
thomasr Missing name is currently offline thomasr Missing nameFriend
Messages: 6
Registered: December 2010
Junior Member

Hi Chris,
what exactly do you mean by 'Implementing setFocus() correctly'. Can you post an example of this code ?

Thank you
Previous Topic:Context Sensitive Help problems
Next Topic:Maximized welcome page
Goto Forum:
  


Current Time: Thu Nov 27 19:59:19 GMT 2014

Powered by FUDForum. Page generated in 0.02114 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software