viewtify

viewtify.ui.helper

ContextMenuHelper<Self>

context(ConsumerUIContextMenubuilder)Self

ConsumerUIContextMenubuilder

A consumer that builds the UIContextMenu for the context menu.

Self

A chainable API for further configuration.

Defines the context menu for the UI component. The menu is not generated until it is actually needed. This method allows you to specify a context menu using a builder function.

context(Objectid, ConsumerUIContextMenubuilder)Self

Objectid

An identifier for the context menu.

ConsumerUIContextMenubuilder

A consumer that builds the UIContextMenu for the context menu.

Self

A chainable API for further configuration.

Defines the context menu with the specified ID for the UI component. The menu is not generated until it is actually needed. If the specified ID already exists, the menu will be overwritten instead of added. This method allows you to specify a context menu using a builder function.

context(booleanrebuildable, ConsumerUIContextMenubuilder)Self

booleanrebuildable

If true, the context menu will be generated on every popup.

ConsumerUIContextMenubuilder

A consumer that builds the UIContextMenu for the context menu.

Self

A chainable API for further configuration.

Define the context menu with the option to specify whether it should be generated lazily. This method allows you to specify a context menu using a builder function.

context(Objectid, booleanrebuildable, ConsumerUIContextMenubuilder)Self

Objectid

An identifier for the context menu.

booleanrebuildable

If true, the context menu will be generated on every popup.

ConsumerUIContextMenubuilder

A consumer that builds the UIContextMenu for the context menu.

Self

A chainable API for further configuration.

Define the context menu with the option to specify whether it should be generated lazily. If the specified ID already exists, the menu will be overwritten instead of added. This method allows you to specify a context menu using a builder function.

removeContext()Self

Self

Chainable API.

Deletes all context menus associated with the this instance.

removeContext(Objectid)Self

Objectid

An identifier of context menu.

Self

Chainable API.

Deletes all context menus associated with the specified ID.

showContext()Self

Self

Show the associated context menu.

showContext(javafx.geometry.Sidelocation, doubledx, doubledy)Self

javafx.geometry.Sidelocation

the side

doubledx

the dx value for the x-axis

doubledy

the dy value for the y-axis

Self

Shows the ContextMenu relative to the side specified by the side parameter, and offset by the given dx and dy values for the x-axis and y-axis, respectively. If there is not enough room, the menu is moved to the opposite side and the offset is not applied.

To clarify the purpose of the side parameter, consider that it is relative to the anchor node. As such, a side of TOP would mean that the ContextMenu's bottom left corner is set to the top left corner of the anchor.

This function is useful for finely tuning the position of a menu, relative to the parent node to ensure close alignment.

hideContext()Self

Self

Hide the associated context menu.

toggleContext()Self

Self

Show the associated context menu.

toggleContext(javafx.geometry.Sidelocation, doubledx, doubledy)Self

javafx.geometry.Sidelocation

the side

doubledx

the dx value for the x-axis

doubledy

the dy value for the y-axis

Self

Toggle the context menu.

isContextShowing()boolean

boolean

A result.

Whether or not the context menu is showing (that is, open on the user's system). The context menu might be "showing", yet the user might not be able to see it due to the context menu being rendered behind another context menu or due to the context menu being positioned off the monitor.

behaveLikeButton()Self

Self

Change the control of showing and hiding the context menu from right-click to left-click and ignore native context requesting.

enableContext()Self

Self

Enable the context menu.

disableContext()Self

Self

Enable the context menu.

enableNativeContextRequest()Self

Self

Enable the context menu.

disableNativeContextRequest()Self

Self

Disable the context menu.

hookContext(kiss.WiseRunnablebeforeShowing, kiss.WiseRunnableafterHidden)Self

kiss.WiseRunnablebeforeShowing
kiss.WiseRunnableafterHidden
Self

Hook context event.