Declaring a context id

The setHelp method in org.eclipse.ui.help.IWorkbenchHelpSystem is used to associate a context id with a Control, IAction, Menu, or MenuItem. The context id should be fully qualified with the plug-in id. For example, the following snippet associates the id "com.example.helpexample.panic_button" with a button in the application.

PlatformUI.getWorkbench().getHelpSystem().setHelp(myButton, com.example.helpexample.panic_button);

The following UI controls cannot have context ids (and therefore cannot have context-sensitive help):

Widgets that do not get focus should not be assigned context ids, since they will never trigger a context-sensitive help.

Note: The default implementation of help will display the help dialog tray only if the dialog is either large enough to accomodate it, or is resizable. Otherwise, an infopop will be shown.