Package totalcross.ui
Class MenuItem
- java.lang.Object
-
- totalcross.ui.MenuItem
-
public class MenuItem extends java.lang.ObjectThis class represents a menu item. It is used in conjunction with the MenuBar and MenuBarDropDown classes.- Since:
- SuperWaba 5.8
-
-
Constructor Summary
Constructors Constructor Description MenuItem()Constructs a separator menu item.MenuItem(java.lang.String caption)Constructs a menu item with the given caption.MenuItem(java.lang.String caption, boolean isChecked)Constructs a menu item with the given caption and the given default state for the check.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisCheckable()Returns true if this menu item is checkable.
-
-
-
Field Detail
-
caption
public java.lang.String caption
The menu item's caption.
-
isChecked
public boolean isChecked
True if this item is checked. Note that you must use the constructor that specifies the starting state of the check (if set or unset), otherwise changing this will not work.
-
isEnabled
public boolean isEnabled
True if this item is enabled, false otherwise.
-
-
Constructor Detail
-
MenuItem
public MenuItem()
Constructs a separator menu item.
-
MenuItem
public MenuItem(java.lang.String caption)
Constructs a menu item with the given caption. This item CANNOT be checked (to allow that, use the other constructor with 2 parameters), but can be enabled/disabled.- See Also:
MenuItem(String, boolean)
-
MenuItem
public MenuItem(java.lang.String caption, boolean isChecked)Constructs a menu item with the given caption and the given default state for the check. This item CAN be checked and can be enabled/disabled as well.
-
-