Bug 203451 - [spy] add support for spying context help ids
Summary: [spy] add support for spying context help ids
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Incubators (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Remy Suen CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
Depends on:
Blocks:
 
Reported: 2007-09-14 12:17 EDT by Chris Aniszczyk CLA
Modified: 2007-10-30 15:34 EDT (History)
7 users (show)

See Also:


Attachments
org.eclipse.pde.runtime.patch (1.38 KB, patch)
2007-09-14 12:20 EDT, Chris Aniszczyk CLA
no flags Details | Diff
Updated patch (4.01 KB, patch)
2007-09-14 16:50 EDT, Brian Fitzpatrick CLA
no flags Details | Diff
org.eclipse.pde.runtime.patch (893 bytes, patch)
2007-10-10 13:08 EDT, Chris Aniszczyk CLA
no flags Details | Diff
Patch to fix the preference page issue described in comment #4. (4.56 KB, patch)
2007-10-10 13:34 EDT, Remy Suen CLA
no flags Details | Diff
Updated patch to ignore to prevent an IAE. (4.87 KB, patch)
2007-10-16 00:06 EDT, Remy Suen CLA
no flags Details | Diff
org.eclipse.pde.runtime.patch (13.44 KB, patch)
2007-10-30 15:26 EDT, Chris Aniszczyk CLA
no flags Details | Diff
mylyn/context/zip (1.44 KB, application/octet-stream)
2007-10-30 15:26 EDT, Chris Aniszczyk CLA
no flags Details
mylyn/context/zip (1.44 KB, application/octet-stream)
2007-10-30 15:27 EDT, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2007-09-14 12:17:42 EDT
It would be cool to see the active help ids
Comment 1 Chris Aniszczyk CLA 2007-09-14 12:20:10 EDT
Created attachment 78446 [details]
org.eclipse.pde.runtime.patch

initial code to enable spying for help...

see ActiveHelpSection
Comment 2 Chris Aniszczyk CLA 2007-09-14 15:59:55 EDT
I updated the code a bit... still seems like there's some issues but we are getting more ids back now ;D
Comment 3 Brian Fitzpatrick CLA 2007-09-14 16:50:49 EDT
Created attachment 78474 [details]
Updated patch

Hey Chris...

Here's an updated patch. So far as I can tell, it works like the original code that I wrote did for the older PDE Spy does. I made a couple of tweaks, but nothing major. 

I added the control or shell.toString() calls to the help ID listings because it's useful to know where a help ID is registered. And I moved the initial

		helpBuffer.append(processControlHelp(event, toolkit));

to it's own else block so that we just got the IDs for the dialog or dialog page or other control instead of a mix of whatever was selected in the active part in addition to the other items...

		} else {
			helpBuffer.append(processControlHelp(event, toolkit));
 		}

But that's really it. This little tool is very cool.

It might be nice to have a preference page for it so you could turn some of the sections on/off if you wanted to customize or focus the results a bit.

Hope that helps!
--Fitz
Comment 4 Chris Aniszczyk CLA 2007-09-17 12:44:39 EDT
committed the code... still not getting any ids for editors. Weird behavior when selecting preference pages a few times (ie.., select target platform, then move to somewhere else, context ids for target platform stay around). I'm going to disable the functionality for help ids for M2 until it's completely polished. patches welcomed.

Ideally, this could should be contributed by the wonderful UA team who are the experts in this domain.
Comment 5 Chris Aniszczyk CLA 2007-10-10 13:08:48 EDT
Created attachment 80076 [details]
org.eclipse.pde.runtime.patch

This patch enables active help spying
Comment 6 Remy Suen CLA 2007-10-10 13:34:59 EDT
Created attachment 80077 [details]
Patch to fix the preference page issue described in comment #4.

The issue is that as more pages get created, more and more child Controls gets created. As you iterate through all the children of the top-level Shell, it goes through the Controls of the previous pages also, so the list just keeps increasing.
Comment 7 Chris Aniszczyk CLA 2007-10-15 23:45:18 EDT
It doesn't work in these cases so far:

1) Preferences->Team->-CVS->Synchronize/Compare (IAE)
2) Package Explorer View (no context ids show up)

Something is still iffy with the logic.

Chris G., can you comment on the best way to sniff out these context ids? This would be a cool addition but we need a domain expert in the land of context help ids.
Comment 8 Remy Suen CLA 2007-10-16 00:06:04 EDT
Created attachment 80409 [details]
Updated patch to ignore to prevent an IAE.

(In reply to comment #7)
> 1) Preferences->Team->-CVS->Synchronize/Compare (IAE)

This is caused by an ampersand within the text (presumably for mnemonic/accelerator purposes). As it is not escaped, the XML parsing that's performed within FormText fails.

Chris, do you want me to just use replaceAll(String, String) and escape it that way as above?
Comment 9 Chris Aniszczyk CLA 2007-10-29 17:25:29 EDT
If someone can figure out why the latest patch won't work against the JDT's Package Explorer, I'm about ready to commit it. After some cleanup and polish, it should be good to go. I haven't had time to dig in to see what's special about the Package Explorer.
Comment 10 Chris Aniszczyk CLA 2007-10-29 17:26:52 EDT
Brian, have you any ideas?
Comment 11 Remy Suen CLA 2007-10-29 18:54:51 EDT
(In reply to comment #9)
> If someone can figure out why the latest patch won't work against the JDT's
> Package Explorer, I'm about ready to commit it. After some cleanup and polish,
> it should be good to go. I haven't had time to dig in to see what's special
> about the Package Explorer.

Please see bug 207878. This is a bug with JDT/UI.
Comment 12 Chris Aniszczyk CLA 2007-10-30 15:19:31 EDT
Ok, going to add the first cut of this patch into M3.

There is an issue still with finding certain context ids, I opened bug 208097 to investigate these problems.

Thanks everyone for their contributions.
Comment 13 Chris Aniszczyk CLA 2007-10-30 15:26:21 EDT
Created attachment 81632 [details]
org.eclipse.pde.runtime.patch

Thanks for the help everyone.
Comment 14 Chris Aniszczyk CLA 2007-10-30 15:26:24 EDT
Created attachment 81633 [details]
mylyn/context/zip
Comment 15 Chris Aniszczyk CLA 2007-10-30 15:27:07 EDT
:D
Comment 16 Chris Aniszczyk CLA 2007-10-30 15:27:11 EDT
Created attachment 81634 [details]
mylyn/context/zip
Comment 17 Brian Fitzpatrick CLA 2007-10-30 15:34:45 EDT
Thanks Chris & everybody!