protected < T extends ProjectFacet > boolean filterValueChoicesFromStack ( Project project , UISelectOne < T > select ) { boolean result = true ; Optional < Stack > stackOptional = project . getStack ( ) ; // Filtering only supported facets if ( stackOptional . isPresent ( ) ) { Stack stack = stackOptional . get ( ) ; Iterable < T > valueChoices = select . getValueChoices ( ) ; Set < T > filter = stack . filter ( select . getValueType ( ) , valueChoices ) ; select . setValueChoices ( filter ) ; if ( filter . size ( ) == 1 ) { select . setDefaultValue ( filter . iterator ( ) . next ( ) ) ; result = false ; } else if ( filter . size ( ) == 0 ) { result = false ; } // FIXME: JBIDE-21584: Contains return false because of proxy class // else if (!filter.contains(select.getValue())) // { // select.setDefaultValue((T) null); // } } return result ; }
Filters the given value choices according the current enabled stack