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

Context-Menu contains Close Item though View is set to be not closeable

Open Inky19 opened this issue 4 months ago • 0 comments

This issue is created to reopen an old issue from 2015, which was closed by a bot due to a lack of activity on the old bug tracker : https://bugs.eclipse.org/bugs/show_bug.cgi?id=479952 Original forum post : https://www.eclipse.org/forums/index.php/m/1711463/

I encounter the same exact problem : in a RCP project, a non closeable view can still be closed when minimized using the context menu of the icon. I suspect that this menu is the same for all views and doesn't actually check its properties.

Steps to reproduce

I managed to reproduce the bug in the latest SDK version (4.37) using the default sample RCP project (created using this tutorial) :

  • Create a new RCP application using a Plug-in project and check "Create sample content"
  • Launch the sample application
  • The "Sample Part" tab is by default non closeable (no close button)
  • Minimize it using the buttons in the top right corner of the view
  • Open the context menu on the view icon once minimized
  • "Close" appears as an option

Image Image Image

In the original project where I encountered this bug (SDK 4.34) I tried :

  • Using .setCloseable(false) on the ViewLayout in the PerspectiveFactory.
  • Adding the "NoClose" tag to the part descriptor in the workbench.e4xmi file of the project.
  • Setting closeable=false in the plugin.xml where declaring the view.

The close button of the view disappears but the context menu of the minimized icon still contains "close".

I expected : The user should not be able to close an nonCloseable view by any direct mean.

Tested under these environments:

  • Debian 12 with Eclipse SDK 2024-12 (4.34.0), Build id: 20241128-0757
  • Arch Linux with Eclipse SDK 2025-09 (4.37), Build id: I20250905-0730

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.

Inky19 avatar Sep 19 '25 09:09 Inky19