Skip to content

Inconsistent display of menu tooltips #2483

@ewillink

Description

@ewillink

I found that some of my tooltips were not being shown and after fixing some bad XML (the editor does not diagnose a gratuitous extra premature ">") I found that just changing the org.eclipse.ui.menus extension point in plugin.xml from
<menuContribution locationURI="popup:org.eclipse.ocl.examples.ui.Menu?after=show">
to
<menuContribution locationURI="popup:org.eclipse.ocl.examples.ui.Menu?after=load">
could make the missing tooltip visible.

Debugging by setting a breakpoint at line 1353 of Menu.class
boolean success = OS.GetMenuItemRect (0, selectedMenuItem.parent.handle, selectedMenuItem.index, rect);
if (!success) return null;
revealed two problems. a) when success is true, b) when success is false.

The first (success true) is reprodible on a basic Eclipse platform. Many menu entries have no tooltip. e.g. Help->Tip of the Day however debugging reveals this is because itemToolTip is null. Surely a missing tooltip should be 'inferred' as the label as is often the case already.

The second (success false) appears to be related to plugin.xml extension of a dynamically defined menu - not reprodicible on a basic platform.

In so far as I can debug this, I suspect that the selectedMenuItem.index argument to OS.GetMenuItemRect fails to account for separators and/or invisible entries and/or sub-menus.

'Repro'. The problems I experience are reproducible using the context menu of the Sample Ecore Editor. Team->Show Local History has a tooltip that is not displayed because success=false. (A repro using my released OCL code will just uncover downstream effects of the bad XML.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions