Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 280357 - [Help][Context] Tools to create, debug, edit context sensitive help (CSH)
Summary: [Help][Context] Tools to create, debug, edit context sensitive help (CSH)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.6 M5   Edit
Assignee: Chris Austin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-15 17:11 EDT by Kelly Raposo CLA
Modified: 2010-01-04 15:37 EST (History)
5 users (show)

See Also:


Attachments
Patch V1 (2.03 KB, patch)
2009-10-06 15:49 EDT, Chris Austin CLA
no flags Details | Diff
Patch V2 (6.13 KB, patch)
2009-12-30 12:32 EST, Chris Austin CLA
no flags Details | Diff
Sample output from Patch V2 (85.04 KB, text/plain)
2009-12-30 12:34 EST, Chris Austin CLA
no flags Details
Patch V3 (7.46 KB, patch)
2010-01-04 14:52 EST, Chris Austin CLA
cgold: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kelly Raposo CLA 2009-06-15 17:11:34 EDT
Because it is difficult to create and debug CSH, it would be nice if we had tools to help with this task. Particularly, it would be nice if there was a tool that did the following:
1. Identify the context ID for a particular focus spot in the UI at runtime.
2. Search through a code plugin and provide a list of context IDs, possibly identify duplicate IDs.
3. Compare the IDs used in the code plugin to the IDs used in the doc plugin
4. Inline CSH creation/editing tool.
Comment 1 Chris Austin CLA 2009-10-06 15:49:01 EDT
Created attachment 148933 [details]
Patch V1

OK, I took a stab at this one, but it doesn't do everything on the list.  Right now I took a simple approach.  This patch print out the list of registered CSH id's on a failed lookup.  For example, I press F1 on a menu item with a context id of 'com.ibm.ccl.help.test.csh.action_csh'.  In the log (when the Context Debugging flag is turned on) this is what I would see :

ContextManager.getContext("com.ibm.ccl.help.test.csh.action_csh")
ContextManager.getContext - no context found
Registered Context Provider IDs:
--------------------------------
com.ibm.etools.webtools.webpage.template
com.ibm.datatools.core.ui.infopop
com.ibm.datatools.derbymigration.infopop
com.ibm.datatools.xml.schema.infopop
com.ibm.etools.ejb.sbf.ui
...
--------------------------------

thoughts?
Comment 2 Chris Goldthorpe CLA 2009-10-07 13:48:45 EDT
I notice that some code was added to ContextManager.addContext() which is never called, see Bug 291639. One common problem when writing contexts is that users don't realize that a context string is plugin-id.context or how to create it correctly. Maybe we can add the following debug lines

a) If the context does not contain a '.' write a message to that effect, otherwise write a message like "plug-in id = my.plugin, context id = myId".
b) If there are no context providers for a plug-in write a message to that effect.
Comment 3 Kelly Raposo CLA 2009-10-16 13:17:54 EDT
Do I have to test each CSH individually? Is there a way to run this tool on all of the IDs in a plugin?.
Comment 4 Chris Austin CLA 2009-11-24 14:04:28 EST
I have made some changes to org.eclipse.ui.workbench, tracking in Bug 296042.  I have amended my approach to a 3 step process, enabled by debug flags (yet to be determined).

Step 1: Determine if any UI controls are setting context help to the same context id.  If so, log a warning.

Step 2: Determine if any context help has the same context id.  If so, log a warning.

Step 3: If CSH fails to come up when requested, log the missing id, and the list of registered ids.
Comment 5 Chris Goldthorpe CLA 2009-12-04 14:50:57 EST
Deferred to M5
Comment 6 Chris Austin CLA 2009-12-30 12:32:26 EST
Created attachment 155133 [details]
Patch V2

As we wait for Bug 296042 to be resolved, I have continued ahead with the UA side of this bug.  Patch V2 does items 2 and 3 of the list in comment 4.

CSH debug must be enabled to see these changes:
  1) Create a .options file in the working directory with the contents:
org.eclipse.help/debug=true
org.eclipse.help/debug/context=true
  2)Run eclipse as "eclipse.exe -debug" and watch the System.out.prints

When debug is on, we will see warnings if a context id exists twice in the same context.xml file, or if a context id exists twice in seperate context.xml files for a given plugin.  If a csh event is fired, and no csh id is found, we print out the list of known ids.
Comment 7 Chris Austin CLA 2009-12-30 12:34:26 EST
Created attachment 155134 [details]
Sample output from Patch V2
Comment 8 Chris Austin CLA 2010-01-04 14:52:23 EST
Created attachment 155268 [details]
Patch V3

Patch Version 3:
Also adds some case insensitive searching to see if the contextId in question is similar to existing context ids in other plugins.

Example Output:
The ID searched is foo.TEST_CONTEXT. Did you mean to call setHelp with:
[bar.test_context]
Comment 9 Chris Goldthorpe CLA 2010-01-04 15:37:13 EST
Patch committed to HEAD, Fixed.