private boolean isSelectable(final MenuItem item, final SelectionMode selectionMode) {

		if (!(item instanceof MenuItemSelectable) || !item.isVisible()
				|| (item instanceof Disableable && ((Disableable) item).isDisabled())) {
			return false;
		}

		// SubMenus are only selectable in a column menu type
		if (item instanceof WSubMenu && !MenuType.COLUMN.equals(getType())) {
			return false;
		}

		// Item is specificially set to selectable/unselectable
		Boolean itemSelectable = ((MenuItemSelectable) item).getSelectability();
		if (itemSelectable != null) {
			return itemSelectable;
		}

		// Container has selection turned on
		return SelectionMode.SINGLE.equals(selectionMode) || SelectionMode.MULTIPLE.equals(selectionMode);

	}
private boolean isSelectable ( final MenuItem item , final SelectionMode selectionMode ) { if ( ! ( item instanceof MenuItemSelectable ) || ! item . isVisible ( ) || ( item instanceof Disableable && ( ( Disableable ) item ) . isDisabled ( ) ) ) { return false ; } if ( item instanceof WSubMenu && ! MenuType . COLUMN . equals ( getType ( ) ) ) { return false ; } Boolean itemSelectable = ( ( MenuItemSelectable ) item ) . getSelectability ( ) ; if ( itemSelectable != null ) { return itemSelectable ; } return SelectionMode . SINGLE . equals ( selectionMode ) || SelectionMode . MULTIPLE . equals ( selectionMode ) ; }
Indicates whether the given menu item is selectable.

@param item the menu item to check.
@param selectionMode the select mode of the current menu/sub-menu
@return true if the meu item is selectable, false otherwise.