*/
private boolean checkable = false;
+ /**
+ * Set checkable flag.
+ *
+ * @param checkable if true, this menu item can be checked/unchecked
+ */
+ public final void setCheckable(final boolean checkable) {
+ this.checkable = checkable;
+ }
+
/**
* When true, this item is checked.
*/
CellAttributes background = getTheme().getColor("tmenu");
CellAttributes menuColor;
CellAttributes menuMnemonicColor;
- if (getAbsoluteActive()) {
+ if (isAbsoluteActive()) {
menuColor = getTheme().getColor("tmenu.highlighted");
menuMnemonicColor = getTheme().getColor("tmenu.mnemonic.highlighted");
} else {
- if (getEnabled()) {
+ if (isEnabled()) {
menuColor = getTheme().getColor("tmenu");
menuMnemonicColor = getTheme().getColor("tmenu.mnemonic");
} else {
* Dispatch event(s) due to selection or click.
*/
public void dispatch() {
- assert (getEnabled());
+ assert (isEnabled());
getApplication().addMenuEvent(new TMenuEvent(id));
if (checkable) {
*/
@Override
public void onMouseUp(final TMouseEvent mouse) {
- if ((mouseOnMenuItem(mouse)) && (mouse.getMouse1())) {
+ if ((mouseOnMenuItem(mouse)) && (mouse.isMouse1())) {
dispatch();
return;
}