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 ) ; }
Indicates whether the given menu item is selectable .