RFR: 8091153: Customize the Table Button Menu

Andy Goryachev angorya at openjdk.org
Mon May 15 16:19:50 UTC 2023


On Sat, 13 May 2023 19:11:26 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

> This PR implements a way to override the table column menu. 
> When the `cornerRegion` is pressed, it will now call the `showColumnMenu` method. This new method is protected and therefore can be overidden by developers. If not overridden, the known default column 'ContextMenu' is created and shown.
> 
> This PR also resolves [JDK-8091419 ](https://bugs.openjdk.org/browse/JDK-8091419) (The method `showColumnMenu` can be overridden and made public now)
> 
> This PR also helps with [JDK-8092148](https://bugs.openjdk.org/browse/JDK-8092148), but does not address all the points mentioned in the ticket. 
> Now that everyone can provide their own implementation, we can think of treating the current implementation of the table column menu as an [MVP](https://en.wikipedia.org/wiki/Minimum_viable_product) and any other requested feature/idea should be fulfilled by providing your own implementaion of the menu.

modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableHeaderRow.java line 472:

> 470:      * This method can be overridden if there is a desire to create and show a custom menu.
> 471:      *
> 472:      * @param mouseEvent the {@link MouseEvent} which was generated when the corner region was pressed.

probably needs
`@since 21`

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1135#discussion_r1194064131


More information about the openjfx-dev mailing list