@ Override public boolean performOk ( ) { reportConfigurationTab . performOk ( ) ; boolean analysisSettingsChanged = false ; boolean reporterSettingsChanged = false ; boolean needRedisplayMarkers = false ; if ( workspaceSettingsTab != null ) { workspaceSettingsTab . performOK ( ) ; } boolean pluginsChanged = false ; // Have user preferences for project changed? // If so, write them to the user preferences file & re-run builder if ( ! currentUserPreferences . equals ( origUserPreferences ) ) { pluginsChanged = ! currentUserPreferences . getCustomPlugins ( ) . equals ( origUserPreferences . getCustomPlugins ( ) ) ; // save only if we in the workspace page OR in the project page with // enabled // project settings if ( getProject ( ) == null || enableProjectCheck . getSelection ( ) ) { try { FindbugsPlugin . saveUserPreferences ( getProject ( ) , currentUserPreferences ) ; } catch ( CoreException e ) { FindbugsPlugin . getDefault ( ) . logException ( e , "Could not store SpotBugs preferences for project" ) ; } } if ( pluginsChanged ) { FindbugsPlugin . applyCustomDetectors ( true ) ; } } analysisSettingsChanged = pluginsChanged || areAnalysisPrefsChanged ( currentUserPreferences , origUserPreferences ) ; reporterSettingsChanged = ! currentUserPreferences . getFilterSettings ( ) . equals ( origUserPreferences . getFilterSettings ( ) ) ; boolean markerSeveritiesChanged = reportConfigurationTab . isMarkerSeveritiesChanged ( ) ; needRedisplayMarkers = pluginsChanged || markerSeveritiesChanged || reporterSettingsChanged ; boolean builderEnabled = false ; if ( getProject ( ) != null ) { builderEnabled = chkEnableFindBugs . getSelection ( ) ; // Update whether or not FindBugs is run automatically. if ( ! natureEnabled && builderEnabled ) { addNature ( ) ; } else if ( natureEnabled && ! builderEnabled ) { removeNature ( ) ; } // update the flag to match the incremental/not property builderEnabled &= chkRunAtFullBuild . getSelection ( ) ; boolean newSelection = enableProjectCheck . getSelection ( ) ; if ( projectPropsInitiallyEnabled != newSelection ) { analysisSettingsChanged = true ; FindbugsPlugin . setProjectSettingsEnabled ( project , projectStore , newSelection ) ; } } if ( analysisSettingsChanged ) { // trigger a Findbugs rebuild here if ( builderEnabled ) { runFindbugsBuilder ( ) ; needRedisplayMarkers = false ; } else { if ( ! getPreferenceStore ( ) . getBoolean ( FindBugsConstants . DONT_REMIND_ABOUT_FULL_BUILD ) ) { remindAboutFullBuild ( ) ; } } } if ( needRedisplayMarkers ) { redisplayMarkers ( ) ; } return true ; }
Will be called when the user presses the OK button .