void () { if(myCbToSearchForTextOccurrences != null){ if (isSelected(myCbUsages)){ myCbToSearchForTextOccurrences.makeSelectable(); } else{ myCbToSearchForTextOccurrences.makeUnselectable(false); } } boolean hasSelected = isSelected(myCbUsages) || isSelected(myCbClassesUsages); setOKActionEnabled(hasSelected); }