Using displayHelpResource() [message #469605] |
Tue, 11 September 2007 13:16  |
Eclipse User |
|
|
|
I would like the functionality of displayHelpResource() (that is,
launching the help viewer in a separate widow and directing it to a
particular topic/page). However, all examples of usage of that method I
can find in the Eclipse source basically hard-code the href path to the
HTML files, either in the code (yuck!) or in a messages.properties file.
What I'd ideally like to do is use context IDs that are already being
defined by our help plugin.
Is there any way to resolve from context ID to href expected by
displayHelpResource()? From digging into the source it looks like you
can prepend "contextId=" to the href String, but that is just taking me
to the home page of Help instead of the topic defined for that ID.
Thanks in advance,
Eric
|
|
|
|
|
|
Re: Using displayHelpResource() [message #469647 is a reply to message #469646] |
Thu, 27 September 2007 12:14  |
Eclipse User |
|
|
|
Ruth Stento wrote:
> Hi Eric,
>
> I gave your snippet to a developer who tried it for our start page editor.
> The existing code looked like:
> } else if (event.location
> .startsWith("http://com.progress.dataxtend.si/showHelpTopic?id="))
> {
>
> // Open a help window to display the specified
> help topic.
>
> String topicId = event.location;
>
> topicId = topicId.substring(topicId.indexOf('=') + 1);
>
> PlatformUI.getWorkbench().getHelpSystem()
>
> .displayHelpResource(topicId);
>
> event.doit = false;
>
>
>
> He commented out the line starting with PlatformUI... and replaced it with:
>
> HelpSystem.getContext(topicID).getRelatedTopics()[0].getHref ()
>
> In the start page HTML source, he used this URL, where ModelObjectEditor
> equals an existing Context ID:
>
> <a href= http://com.progress.dataxtend.si/showHelpTopic?id=ModelObjec tEditor>
>
> It launched the help window but gave a page not found error. Any
> suggestions?
The only thinng I can think of is to check that the topicID is correctly
listed in the help table of contents file (toc.xml) and that the URL
references there actually exists in the help project.
Eric
> "Eric Rizzo" <eclipse5@rizzoweb.com> wrote in message
> news:fc7638$esl$1@build.eclipse.org...
>> Eric Rizzo wrote:
>>> I would like the functionality of displayHelpResource() (that is,
>>> launching the help viewer in a separate widow and directing it to a
>>> particular topic/page). However, all examples of usage of that method I
>>> can find in the Eclipse source basically hard-code the href path to the
>>> HTML files, either in the code (yuck!) or in a messages.properties file.
>>> What I'd ideally like to do is use context IDs that are already being
>>> defined by our help plugin.
>>> Is there any way to resolve from context ID to href expected by
>>> displayHelpResource()? From digging into the source it looks like you can
>>> prepend "contextId=" to the href String, but that is just taking me to
>>> the home page of Help instead of the topic defined for that ID.
>> So I found that I can do this, and it works:
>> HelpSystem.getContext(myContextID).getRelatedTopics()[0].get Href()
>>
>> But surely there is a better way to map from a context ID to an href that
>> can be passed to IWorkbenchHelpSystem.displayHelpResource()...
>>
>> ...right?
>>
>> Eric
>
>
|
|
|
Re: Using displayHelpResource() [message #576631 is a reply to message #469605] |
Tue, 11 September 2007 18:50  |
Eclipse User |
|
|
|
Eric Rizzo wrote:
> I would like the functionality of displayHelpResource() (that is,
> launching the help viewer in a separate widow and directing it to a
> particular topic/page). However, all examples of usage of that method I
> can find in the Eclipse source basically hard-code the href path to the
> HTML files, either in the code (yuck!) or in a messages.properties file.
> What I'd ideally like to do is use context IDs that are already being
> defined by our help plugin.
> Is there any way to resolve from context ID to href expected by
> displayHelpResource()? From digging into the source it looks like you
> can prepend "contextId=" to the href String, but that is just taking me
> to the home page of Help instead of the topic defined for that ID.
So I found that I can do this, and it works:
HelpSystem.getContext(myContextID).getRelatedTopics()[0].get Href()
But surely there is a better way to map from a context ID to an href
that can be passed to IWorkbenchHelpSystem.displayHelpResource()...
....right?
Eric
|
|
|
Re: Using displayHelpResource() [message #576671 is a reply to message #469614] |
Wed, 12 September 2007 14:04  |
Eclipse User |
|
|
|
>
> So I found that I can do this, and it works:
> HelpSystem.getContext(myContextID).getRelatedTopics()[0].get Href()
>
> But surely there is a better way to map from a context ID to an href
> that can be passed to IWorkbenchHelpSystem.displayHelpResource()...
>
> ...right?
>
> Eric
A context may have no links, one link or more than one link, which means
that you have to do something like the code above. Be sure to check that
there is at least one link to avoid an exception.
|
|
|
Re: Using displayHelpResource() [message #586006 is a reply to message #469614] |
Wed, 26 September 2007 17:31  |
Eclipse User |
|
|
|
Hi Eric,
I gave your snippet to a developer who tried it for our start page editor.
The existing code looked like:
} else if (event.location
.startsWith("http://com.progress.dataxtend.si/showHelpTopic?id="))
{
// Open a help window to display the specified
help topic.
String topicId = event.location;
topicId = topicId.substring(topicId.indexOf('=') + 1);
PlatformUI.getWorkbench().getHelpSystem()
.displayHelpResource(topicId);
event.doit = false;
He commented out the line starting with PlatformUI... and replaced it with:
HelpSystem.getContext(topicID).getRelatedTopics()[0].getHref ()
In the start page HTML source, he used this URL, where ModelObjectEditor
equals an existing Context ID:
<a href= http://com.progress.dataxtend.si/showHelpTopic?id=ModelObjec tEditor>
It launched the help window but gave a page not found error. Any
suggestions?
thanks!
Ruth Stento
"Eric Rizzo" <eclipse5@rizzoweb.com> wrote in message
news:fc7638$esl$1@build.eclipse.org...
> Eric Rizzo wrote:
>> I would like the functionality of displayHelpResource() (that is,
>> launching the help viewer in a separate widow and directing it to a
>> particular topic/page). However, all examples of usage of that method I
>> can find in the Eclipse source basically hard-code the href path to the
>> HTML files, either in the code (yuck!) or in a messages.properties file.
>> What I'd ideally like to do is use context IDs that are already being
>> defined by our help plugin.
>> Is there any way to resolve from context ID to href expected by
>> displayHelpResource()? From digging into the source it looks like you can
>> prepend "contextId=" to the href String, but that is just taking me to
>> the home page of Help instead of the topic defined for that ID.
>
> So I found that I can do this, and it works:
> HelpSystem.getContext(myContextID).getRelatedTopics()[0].get Href()
>
> But surely there is a better way to map from a context ID to an href that
> can be passed to IWorkbenchHelpSystem.displayHelpResource()...
>
> ...right?
>
> Eric
|
|
|
Re: Using displayHelpResource() [message #586023 is a reply to message #469646] |
Thu, 27 September 2007 12:14  |
Eclipse User |
|
|
|
Ruth Stento wrote:
> Hi Eric,
>
> I gave your snippet to a developer who tried it for our start page editor.
> The existing code looked like:
> } else if (event.location
> .startsWith("http://com.progress.dataxtend.si/showHelpTopic?id="))
> {
>
> // Open a help window to display the specified
> help topic.
>
> String topicId = event.location;
>
> topicId = topicId.substring(topicId.indexOf('=') + 1);
>
> PlatformUI.getWorkbench().getHelpSystem()
>
> .displayHelpResource(topicId);
>
> event.doit = false;
>
>
>
> He commented out the line starting with PlatformUI... and replaced it with:
>
> HelpSystem.getContext(topicID).getRelatedTopics()[0].getHref ()
>
> In the start page HTML source, he used this URL, where ModelObjectEditor
> equals an existing Context ID:
>
> <a href= http://com.progress.dataxtend.si/showHelpTopic?id=ModelObjec tEditor>
>
> It launched the help window but gave a page not found error. Any
> suggestions?
The only thinng I can think of is to check that the topicID is correctly
listed in the help table of contents file (toc.xml) and that the URL
references there actually exists in the help project.
Eric
> "Eric Rizzo" <eclipse5@rizzoweb.com> wrote in message
> news:fc7638$esl$1@build.eclipse.org...
>> Eric Rizzo wrote:
>>> I would like the functionality of displayHelpResource() (that is,
>>> launching the help viewer in a separate widow and directing it to a
>>> particular topic/page). However, all examples of usage of that method I
>>> can find in the Eclipse source basically hard-code the href path to the
>>> HTML files, either in the code (yuck!) or in a messages.properties file.
>>> What I'd ideally like to do is use context IDs that are already being
>>> defined by our help plugin.
>>> Is there any way to resolve from context ID to href expected by
>>> displayHelpResource()? From digging into the source it looks like you can
>>> prepend "contextId=" to the href String, but that is just taking me to
>>> the home page of Help instead of the topic defined for that ID.
>> So I found that I can do this, and it works:
>> HelpSystem.getContext(myContextID).getRelatedTopics()[0].get Href()
>>
>> But surely there is a better way to map from a context ID to an href that
>> can be passed to IWorkbenchHelpSystem.displayHelpResource()...
>>
>> ...right?
>>
>> Eric
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03808 seconds