RCP Context Sensitive Help Question [message #687632] |
Wed, 22 June 2011 22:02 |
Ronald So Messages: 198 Registered: April 2011 |
Senior Member |
|
|
I have added the page key for my view but when I select a component inside that view and click F1, the help system does not pop up and I got the following messages in debug mode.
ContextManager.getContext("com.company.ui.core.view.demoview")
ContextManager.getContext - no context found
Registered Context Provider IDs:
--------------------------------
com.syncsort.newbex.ui.core [view.demoview]
--------------------------------
ContextManager.getContext("org.eclipse.ui.missing")
ContextManager.getContext - no context found
Registered Context Provider IDs:
--------------------------------
com.syncsort.newbex.ui.core [view.demoview]
--------------------------------
I have added this line to my view:
PlatformUI.getWorkbench().getHelpSystem().setHelp(control, "com.company.ui.core.view.demoview");
The name of my plug-in is "com.company.ui.core". I have also added the contexts.xml file:
<contexts>
<context id="view.demoview">
<description>This is Demo View</description>
<topic
label="Tasks for Demo View"
href="help/html/tasks/subtopic.html"/>
</context>
</contexts>
I have also added these lines in plugin.xml:
<extension
point="org.eclipse.help.contexts">
<contexts
file="help/contexts.xml"/>
</extension>
Is there anything obvious that I am not doing correctly?
Thanks,
Ronald
[Updated on: Thu, 23 June 2011 14:10] Report message to a moderator
|
|
|
Re: RCP Context Sensitive Help Question [message #687955 is a reply to message #687632] |
Thu, 23 June 2011 15:16 |
Ronald So Messages: 198 Registered: April 2011 |
Senior Member |
|
|
Well I found myself answering my questions lately but heck I will put up my solution anyway.
The problem is the context ID. Using "view.demoview" as my context ID is the cause of the problem. DO NOT use any "periods" for your context ID. The "ContextManager.getContext()" call is very sensitive on the use of "periods" to get a hold of the AbstractContextProvider. I changed the ID to "view_demoview" and make the corresponding change to contexts.xml solves the problem.
In DemoView.java,
public void createPartControl(Composite parent) {
viewer = new TableViewer(
parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
// Provide the input to the ContentProvider
viewer.setInput(new String[] {"One", "Two", "Three"});
// Context-sensitive help
CoreUtil.setHelpPageKey(viewer.getTable(), "com.company.ui.core." + "view_demoview");
}
In context.xml,
<?xml version="1.0" encoding="UTF-8"?>
<contexts>
<context id="view_demoview">
<description>This is Demo View</description>
<topic
label="Tasks for Demo View"
href="help/html/tasks/subtopic.html"/>
</context>
</contexts>
In plugin.xml,
<extension
point="org.eclipse.help.contexts">
<contexts
file="help/contexts.xml"
plugin="com.company.ui.core"/>
</extension>
[Updated on: Thu, 23 June 2011 15:27] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05840 seconds