Search in sources :

Example 1 with ProjectFilterAction

use of net.sourceforge.pmd.eclipse.ui.views.actions.ProjectFilterAction in project pmd-eclipse-plugin by pmd.

the class ViolationOverviewMenuManager method createProjectFilterMenu.

/**
 * Create the Menu for filtering Projects
 *
 * @param manager, the MenuManager
 */
private void createProjectFilterMenu(IMenuManager manager) {
    final List<AbstractPMDRecord> projectFilterList = this.overview.getProjectFilterList();
    final List<ProjectRecord> projectList = new ArrayList<ProjectRecord>();
    // We get a List of all Projects
    final AbstractPMDRecord[] projects = this.overview.getAllProjects();
    for (int i = 0; i < projects.length; i++) {
        final ProjectRecord project = (ProjectRecord) projects[i];
        // we add a FilterAction for it
        if (project.hasMarkers()) {
            // NOPMD by Herlin on 09/10/06 15:03
            final Action projectFilterAction = new ProjectFilterAction(project, this.overview);
            // we set it as "visible"
            if (!projectFilterList.contains(projects[i])) {
                // NOPMD by Herlin on 09/10/06 15:04
                projectFilterAction.setChecked(true);
            }
            manager.add(projectFilterAction);
            projectList.add(project);
        }
    }
    manager.add(new Separator());
}
Also used : ProjectFilterAction(net.sourceforge.pmd.eclipse.ui.views.actions.ProjectFilterAction) CalculateStatisticsAction(net.sourceforge.pmd.eclipse.ui.views.actions.CalculateStatisticsAction) PriorityFilterAction(net.sourceforge.pmd.eclipse.ui.views.actions.PriorityFilterAction) Action(org.eclipse.jface.action.Action) ProjectFilterAction(net.sourceforge.pmd.eclipse.ui.views.actions.ProjectFilterAction) ViolationPresentationTypeAction(net.sourceforge.pmd.eclipse.ui.views.actions.ViolationPresentationTypeAction) CollapseAllAction(net.sourceforge.pmd.eclipse.ui.views.actions.CollapseAllAction) ProjectRecord(net.sourceforge.pmd.eclipse.ui.model.ProjectRecord) ArrayList(java.util.ArrayList) Separator(org.eclipse.jface.action.Separator) AbstractPMDRecord(net.sourceforge.pmd.eclipse.ui.model.AbstractPMDRecord)

Aggregations

ArrayList (java.util.ArrayList)1 AbstractPMDRecord (net.sourceforge.pmd.eclipse.ui.model.AbstractPMDRecord)1 ProjectRecord (net.sourceforge.pmd.eclipse.ui.model.ProjectRecord)1 CalculateStatisticsAction (net.sourceforge.pmd.eclipse.ui.views.actions.CalculateStatisticsAction)1 CollapseAllAction (net.sourceforge.pmd.eclipse.ui.views.actions.CollapseAllAction)1 PriorityFilterAction (net.sourceforge.pmd.eclipse.ui.views.actions.PriorityFilterAction)1 ProjectFilterAction (net.sourceforge.pmd.eclipse.ui.views.actions.ProjectFilterAction)1 ViolationPresentationTypeAction (net.sourceforge.pmd.eclipse.ui.views.actions.ViolationPresentationTypeAction)1 Action (org.eclipse.jface.action.Action)1 Separator (org.eclipse.jface.action.Separator)1