private void createBugCategoriesGroup ( Composite parent , final IProject project ) { Group checkBoxGroup = new Group ( parent , SWT . SHADOW_ETCHED_OUT ) ; checkBoxGroup . setText ( getMessage ( "property.categoriesGroup" ) ) ; checkBoxGroup . setLayout ( new GridLayout ( 1 , true ) ) ; checkBoxGroup . setLayoutData ( new GridData ( SWT . BEGINNING , SWT . TOP , true , true ) ) ; List < String > bugCategoryList = new LinkedList <> ( DetectorFactoryCollection . instance ( ) . getBugCategories ( ) ) ; chkEnableBugCategoryList = new LinkedList <> ( ) ; ProjectFilterSettings origFilterSettings = propertyPage . getOriginalUserPreferences ( ) . getFilterSettings ( ) ; for ( String category : bugCategoryList ) { Button checkBox = new Button ( checkBoxGroup , SWT . CHECK ) ; checkBox . setText ( I18N . instance ( ) . getBugCategoryDescription ( category ) ) ; checkBox . setSelection ( origFilterSettings . containsCategory ( category ) ) ; GridData layoutData = new GridData ( ) ; layoutData . horizontalIndent = 10 ; checkBox . setLayoutData ( layoutData ) ; // Every time a checkbox is clicked, rebuild the detector factory // table // to show only relevant entries checkBox . addListener ( SWT . Selection , new Listener ( ) { @ Override public void handleEvent ( Event e ) { syncSelectedCategories ( ) ; } } ) ; checkBox . setData ( category ) ; chkEnableBugCategoryList . add ( checkBox ) ; } }
Build list of bug categories to be enabled or disabled . Populates chkEnableBugCategoryList and bugCategoryList fields .