private void selectSeverity ( int severity ) { // Severity is 1-based, but the menu item list is 0-based int index = severity - 1 ; for ( int i = 0 ; i < severityItemList . length ; ++ i ) { MenuItem menuItem = severityItemList [ i ] ; menuItem . setEnabled ( true ) ; menuItem . setSelection ( i == index ) ; } }
Set the menu to given severity level .