jjazzboss opened a new issue, #8501:
URL: https://github.com/apache/netbeans/issues/8501

   ### Apache NetBeans version
   
   Apache NetBeans 25
   
   ### What happened
   
   A (non-editor) TopComponent with client property 
`TopComponent.PROP_CLOSING_DISABLED=true` is displayed with a tab with no 
_close_ button and no _close_ menu entry. This is OK.
   
   But actually it is still closable via mouse middle-click on the tab.
   
   
   
   
   ### Language / Project Type / NetBeans Component
   
   Netbeans platform application
   
   ### How to reproduce
   
   Add a TopComponent to a NB platform app.
   
   Add `putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE); 
`in constructor.
   
   Run, middle-click tab name (possibly several times), TopComponent is closed.
   
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Win 11
   
   ### JDK
   
   Adoptium 23
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   It seems problem comes from: 
https://github.com/apache/netbeans/blob/master/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java,
 see MouseListener at the beginning.
   
   I tried setting client property `TabbedPaneFactory.NO_CLOSE_BUTTON` to true 
in my TopComponent, so that `hideCloseButton()` returns true and blocks the 
call to `fireCloseRequest()` in `mouseReleased()`, but it did not work. I could 
not debug from my config so I stopped there.
   
   I found an easy workaround by overriding `TopComponent.canClose()` to return 
false.
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to