Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Platform - User Assistance (UA) » RCP Context Sensitive Help Question
RCP Context Sensitive Help Question [message #687632] Wed, 22 June 2011 22:02 Go to next message
Ronald So is currently offline Ronald SoFriend
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 Go to previous message
Ronald So is currently offline Ronald SoFriend
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

Previous Topic:(no subject)
Next Topic:Indigo unable to connect to marketplace
Goto Forum:
  


Current Time: Thu Oct 10 05:06:59 GMT 2024

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

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

Back to the top