eclipse.platform.ui icon indicating copy to clipboard operation
eclipse.platform.ui copied to clipboard

Double Separators can be created with empty DynamicMenuContributions

Open N1k145 opened this issue 1 year ago • 10 comments

Let's make sure issue is not already fixed in latest builds first.

Steps to reproduce

AFAIK, JFace has a logic to remove double Separators from Context Menus. But this only works if they are next to each other after the contributions are collected. When some of these contributions do not contribute anything, the double Separators are not removed.

I tried: grafik The Second Contribution in this screenshot creates a dynamic menu contribution and a separator before that. The dynamic contribution does not add any elements (This could be the case that in the current selection, none of the possible results are valid, depending on implementation)

I expected: That the double and end separators are removed

But got: There is a Separator at the end of the Context Menu that is not removed. grafik

Tested under this environment:

  • OS & version: Windows 11 and Linux
  • Eclipse IDE/Platform version (as shown in Help > About): latest 2024-03

Community

  • [x] I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.

N1k145 avatar Feb 12 '24 12:02 N1k145