public void makeDisabled ( boolean b ) throws IOException { if ( disabled == b ) { return ; } this . disabled = b ; Collection < P > projects = getItems ( ) ; // Manage the sub-projects if ( b ) { /* * Populate list only if it is empty. Running this loop when the * parent (and therefore, all sub-projects) are already disabled will * add all branches. Obviously not desirable. */ if ( disabledSubProjects . isEmpty ( ) ) { for ( P project : projects ) { if ( project . isDisabled ( ) ) { disabledSubProjects . add ( project . getName ( ) ) ; } } } // Always forcefully disable all sub-projects for ( P project : projects ) { project . disable ( ) ; } } else { // Re-enable only the projects that weren't manually marked disabled for ( P project : projects ) { if ( ! disabledSubProjects . contains ( project . getName ( ) ) ) { project . enable ( ) ; } } // Clear the list so it can be rebuilt when parent is disabled disabledSubProjects . clear ( ) ; } save ( ) ; ItemListener . fireOnUpdated ( this ) ; }
Marks the build as disabled .