Build list of bug categories to be enabled or disabled. Populates
chkEnableBugCategoryList and bugCategoryList fields.

@param parent
control checkboxes should be added to
@param project
the project being configured
428325
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);
        }
    }
1034494
private void addParent(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) {
        MavenProject parent = project.getParent();
        if (parent != null) {
            MavenProjectDescriptor parentDescriptor = resolveProject(parent, MavenProjectDescriptor.class, scannerContext);
            projectDescriptor.setParent(parentDescriptor);
        }
    }
1151791
public void setProjects(java.util.Collection<ProjectSummary> projects) {
        if (projects == null) {
            this.projects = null;
            return;
        }

        this.projects = new java.util.ArrayList<ProjectSummary>(projects);
    }
518892
private void reportBug(Library library) {
        bugReporter.reportBug(new BugInstance(this, BugType.BRPI_BACKPORT_REUSE_PUBLIC_IDENTIFIERS.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                .addSourceLine(this).addString(library.name()));
    }
958956
private void addViews(MpxjTreeNode parentNode, ProjectFile file)
   {
      for (View view : file.getViews())
      {
         final View v = view;
         MpxjTreeNode childNode = new MpxjTreeNode(view)
         {
            @Override public String toString()
            {
               return v.getName();
            }
         };
         parentNode.add(childNode);
      }
   }
629878
private void iniProject(CmsUserSettings settings) {

        try {
            List<CmsProject> projects = OpenCms.getOrgUnitManager().getAllAccessibleProjects(
                m_cms,
                m_ou.getValue(),
                false);
            for (CmsProject project : projects) {
                m_project.addItem(project.getSimpleName());
            }
            m_project.setNewItemsAllowed(false);
            m_project.setNullSelectionAllowed(false);
            if (settings != null) {
                String projString = settings.getStartProject();
                if (projString.contains("/")) {
                    projString = projString.split("/")[projString.split("/").length - 1];
                }
                m_project.select(projString);
            } else {

                Iterator<?> it = m_project.getItemIds().iterator();
                if (m_project.containsId("Offline")) {
                    m_project.select("Offline");
                } else {
                    String p = (String)it.next();
                    while (p.equals(CmsProject.ONLINE_PROJECT_NAME) & it.hasNext()) {
                        p = (String)it.next();
                    }
                    m_project.select(p);
                }
            }
        } catch (CmsException e) {
            LOG.error("Unable to read projects", e);
        }
    }
1064664
private void addChildren(CmsTreeItem parent, List<CmsCategoryTreeEntry> children, List<String> selectedCategories) {

        if (children != null) {
            for (CmsCategoryTreeEntry child : children) {
                // set the category tree item and add to parent tree item
                CmsTreeItem treeItem = buildTreeItem(child, selectedCategories);
                if ((selectedCategories != null) && selectedCategories.contains(child.getPath())) {
                    parent.setOpen(true);
                    openParents(parent);
                }
                parent.addChild(treeItem);
                addChildren(treeItem, child.getChildren(), selectedCategories);
            }
        }
    }
70904
public void setProjectsNotFound(java.util.Collection<String> projectsNotFound) {
        if (projectsNotFound == null) {
            this.projectsNotFound = null;
            return;
        }

        this.projectsNotFound = new java.util.ArrayList<String>(projectsNotFound);
    }
140656
@Override
  public void setProject(final Project project) {
    super.setProject(project);
    this.compilerDef.setProject(project);
    this.linkerDef.setProject(project);
  }
507570
public void checkManagerOfProjectRole(CmsDbContext dbc, CmsProject project) throws CmsRoleViolationException {

        boolean hasRole = false;
        try {
            if (hasRole(dbc, dbc.currentUser(), CmsRole.ROOT_ADMIN)) {
                return;
            }
            hasRole = m_driverManager.getAllManageableProjects(
                dbc,
                m_driverManager.readOrganizationalUnit(dbc, project.getOuFqn()),
                false).contains(project);
        } catch (CmsException e) {
            // should never happen
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        if (!hasRole) {
            throw new CmsRoleViolationException(
                org.opencms.security.Messages.get().container(
                    org.opencms.security.Messages.ERR_NOT_MANAGER_OF_PROJECT_2,
                    dbc.currentUser().getName(),
                    dbc.currentProject().getName()));
        }
    }
1117023
public void buildCategoryTree(List<CmsCategoryTreeEntry> treeEntries, Collection<String> selectedCategories) {

        m_valuesSet = 0;
        m_allSidePath.clear();
        m_categories.removeFromParent();
        m_categories.clear();

        if ((treeEntries != null) && !treeEntries.isEmpty()) {
            // add the first level and children
            for (CmsCategoryTreeEntry category : treeEntries) {
                // set the category tree item and add to list
                CmsTreeItem treeItem;
                boolean hasSelectedChildren = hasSelectedChildren(category.getChildren(), selectedCategories);
                if (!category.getPath().isEmpty() || hasSelectedChildren) {
                    if (m_selectParent || !hasSelectedChildren) {
                        treeItem = buildTreeItem(category, selectedCategories, false);
                        if (treeItem.isOpen()) {
                            m_allSidePath.add(category.getSitePath());
                        }
                    } else {
                        treeItem = buildTreeItem(category, selectedCategories, true);
                    }
                    if (treeItem.isOpen()) {
                        m_singleSidePath = category.getSitePath();

                        m_valuesSet++;
                        addChildren(treeItem, category.getChildren(), selectedCategories);
                    }
                }
            }
        }
        m_scrollPanel.add(m_categories);
        m_scrollPanel.onResizeDescendant();

    }
1203821
public void setParent(HierarchicalFormModel parent) {
		Assert.notNull(parent, "parent");
		this.parent = parent;
		this.parent.addPropertyChangeListener(ENABLED_PROPERTY, parentStateChangeHandler);
		this.parent.addPropertyChangeListener(READONLY_PROPERTY, parentStateChangeHandler);
		enabledUpdated();
		readOnlyUpdated();
	}
724369
void syncBugInformation() {
        boolean prevProjectChanged = projectChanged;
        if (mainFrameTree.getCurrentSelectedBugLeaf() != null) {
            BugInstance bug = mainFrameTree.getCurrentSelectedBugLeaf().getBug();
            displayer.displaySource(bug, bug.getPrimarySourceLineAnnotation());
            updateSummaryTab(mainFrameTree.getCurrentSelectedBugLeaf());
        } else if (currentSelectedBugAspects != null) {
            displayer.displaySource(null, null);
            clearSummaryTab();
        } else {
            displayer.displaySource(null, null);
            clearSummaryTab();
        }
        setProjectChanged(prevProjectChanged);
    }
1233463
public void setCategories(List<CmsCategory> categories) {

        for (int i = 0; i < categories.size(); i++) {
            CmsCategory cat = categories.get(i);
            m_container.addItem(cat);
            m_checkboxes.put(cat, new CheckBox());
            String parentPath = CmsResource.getParentFolder(cat.getPath());
            if (parentPath.length() > 1) {
                for (int j = i - 1; j >= 0; j--) {
                    if (categories.get(j).getPath().equals(parentPath)) {
                        m_container.setParent(cat, categories.get(j));
                        break;
                    }
                }
            }
        }
        // hide openers
        for (CmsCategory cat : categories) {
            if ((m_container.getChildren(cat) == null) || (m_container.getChildren(cat).size() == 0)) {
                m_container.setChildrenAllowed(cat, false);
            }
        }
    }
55156
public void unlockProject(CmsProject project) {

        // unlock all resources in the project
        m_lockManager.removeResourcesInProject(project.getUuid(), false);
        m_monitor.clearResourceCache();
        m_monitor.flushCache(CmsMemoryMonitor.CacheType.PROJECT, CmsMemoryMonitor.CacheType.PERMISSION);
    }
310299
public static void addDebugBorders (JPanel panel)
    {
        Color bcolor = new Color(_rando.nextInt(256), _rando.nextInt(256), _rando.nextInt(256));
        panel.setBorder(BorderFactory.createLineBorder(bcolor));

        for (int ii = 0; ii < panel.getComponentCount(); ii++) {
            Object child = panel.getComponent(ii);
            if (child instanceof JPanel) {
                addDebugBorders((JPanel)child);
            }
        }
    }
1100757
@Override
    protected void configureFindbugsEngine() {
        addArg("-output");
        addArg(outputFile.getPath());
        if (overrideRevisionNames) {
            addArg("-overrideRevisionNames");
        }
        if (noPackageMoves) {
            addArg("-noPackageMoves");
        }
        if (preciseMatch) {
            addArg("-preciseMatch");
        }
        if (precisePriorityMatch) {
            addArg("-precisePriorityMatch");
        }
        if (quiet) {
            addArg("-quiet");
        }
        if (withMessages) {
            addArg("-withMessages");
        }

        for (DataFile dataFile : dataFileList) {
            addArg(dataFile.getName());
        }
    }