@ SuppressWarnings ( "checkstyle:npathcomplexity" ) public boolean selectSpecificSRE ( ISREInstall sre ) { ISREInstall theSRE = sre ; if ( theSRE == null ) { theSRE = SARLRuntime . getDefaultSREInstall ( ) ; } if ( theSRE != null ) { boolean changed = false ; final boolean oldNotify = this . notify ; try { this . notify = false ; if ( isSystemWideDefaultSRE ( ) ) { doSpecificSREButtonClick ( ) ; changed = true ; } final ISREInstall oldSRE = getSelectedSRE ( ) ; if ( oldSRE != theSRE ) { final int index = indexOf ( theSRE ) ; if ( index >= 0 ) { this . runtimeEnvironmentCombo . select ( index ) ; changed = true ; } } if ( ! this . runtimeEnvironments . isEmpty ( ) ) { int selection = this . runtimeEnvironmentCombo . getSelectionIndex ( ) ; if ( selection < 0 || selection >= this . runtimeEnvironments . size ( ) ) { // Ensure that there is a selected element selection = indexOf ( theSRE ) ; this . runtimeEnvironmentCombo . select ( ( selection < 0 ) ? 0 : selection ) ; changed = true ; } } } finally { this . notify = oldNotify ; } if ( changed ) { firePropertyChange ( ) ; return true ; } } return false ; }
Select a specific SRE .