Menuitem

Introduction

Menuitem is a sub-tag of menupopup and represents one entry in a menu-system or in a menulist (combobox).

Property

Fires Events

Possible Values

Notes

acceltext (String)

No

 

Text that appears beside the menu label to indicate the shortcut key.

accesskey (String)

No

 

Character that is used as a shortcut key. This should be one of the characters that appears in the label

command (String)

No

 

"controller.method()" format

image (String)

No

 

URL relative to XUL file

label (String)

No

 

 

disabled (bool)

No

 

 

selected (bool)

Yes

 

Only has meaning if the menuitem is of type checkbox. Fired when a checkbox type on user selection.

type (String)

No

"checkbox" or empty

Only supported with SWT at this time

doClick() - Programmatically initiate a click. This should really never be done and any seeming need to do so should be considered a failure of architecture.

<menulist>
  <menupopup>
    <menuitem label="Value 1" />
    <menuitem label="Value 2" />
  </menupopup>
</menulist>

<menu label="Actions">
  <menupopup>
    <menuitem id="process-run" acceltext="F9" accesskey="f9" label="Run" command="handler.run()" />
    <menuitem id="process-stop" acceltext="F10" accesskey="f10" label="Stop" command="handler.stop()" />
  </menupopup>
</menu>