Wednesday, June 27, 2007

Debugging context sensitive help

This feature was removed from the Europa (3.3) release. See bug 197335 for details.
Context sensitive help allows you to assign a help page to an SWT widget. When it works it is a thing of beauty. When it doesn't it can be a small nightmare to debug. I'm not going into details about how to use context sensitive help since it is well documented in the Eclipse IDE. What isn't covered is how to use tracing to help you debug.
In your run configuration click on the tracing tab. Enable tracing and select the following plugins and all of the trace options for each plugin.
  • org.eclipse.help.base
  • org.eclipse.help.ui
  • org.eclipse.help.webapp
When you run your application/plugin you will see tracing information. Warning: the first time you activate the help plugin you will see a flood of trace messages. If you display the Problems View and press F1 (Ctrl F1 on linux) you will see the following.
    ContextManager.getContext(org.eclipse.ui.problem_view_context)
    ContextManager.getContext(org.eclipse.ui.problem_view_context)
    ContextManager.getContext(org.eclipse.ui.problem_view_context)
The context id is "problem_view_context" and is associated with plugin "org.eclipse.ui".

Friday, June 15, 2007

ViewPart content description

I hadn't realized that a ViewPart can place a short description at the top.
public VintageView extends ViewPart {
    public void createPartControl(Composite aParent) {
        setContentDescription("C_TEST123456");
        ....
    }
}