MenuItem type (joe.win)


The MenuItem widget is an item in a Menu.

Initializer

Methods

Properties

All Node widgets have the following properties.

PropertyTypeDescription
#idStringJavaFX ID
#onActioncallable(1)The onAction handler
#styleStringFXCSS style string
#textStringMenuItem text

See Styling with CSS for more on using CSS.

MenuItem Initializer


MenuItem() → MenuItem

Returns a MenuItem.

Methods



menuItem.action(callable) → this

Adds a no-arg callable to the menu item as its action; pressing the button will invoke the callable.


menuItem.disable([flag]) → this

Sets the item's #disable property to flag; if omitted, flag defaults to true. While true, this item and its descendants in the scene graph will be disabled.


menuItem.getProperty(keyword) → value

Gets the value of the property with the given keyword.


menuItem.id(id) → this

Sets the item's #id property to the given id string.


menuItem.isDisabled() → joe.Boolean

Returns true if the item has been disabled, and false otherwise.


menuItem.listenTo(keyword, listener) → this

Adds a listener to the property with the given keyword. The listener should be a callable taking the three arguments:

  • The property keyword
  • The old value of the property
  • The new value of the property

The listener will be called when the property's value changes.


menuItem.properties() → joe.Set

Returns a readonly Set of the object's property keywords.


menuItem.setProperty(keyword, value) → this

Sets the value of the property with the given keyword. The value must be assignable to the property's value type.


menuItem.styleClasses() → joe.List

Gets the list of the item's FXCSS style class names. Values must be valid CSS style class names.

See Styling with CSS for more on using CSS.


menuItem.styles(style, ...) → this

Sets the item's FXCSS #style property. The caller can pass multiple style strings, which will be joined with semicolons.

See Styling with CSS for more on using CSS.


menuItem.text(text) → this

Sets the item's text.


menuItem.toString() → joe.String

Returns the value's string representation.