use of net.sourceforge.pmd.eclipse.ui.views.actions.PriorityFilterAction in project pmd-eclipse-plugin by pmd.
the class ViolationOverviewMenuManager method setupActions.
/**
* Setup the Actions for the ActionBars
*/
public void setupActions() {
RulePriority[] priorities = UISettings.currentPriorities(true);
priorityActions = new PriorityFilterAction[priorities.length];
// create the Actions for the PriorityFilter
for (int i = 0; i < priorities.length; i++) {
// NOPMD by Herlin on 09/10/06 15:02
priorityActions[i] = new PriorityFilterAction(priorities[i], overview);
priorityActions[i].setChecked(PriorityUtil.isPriorityActive(priorities[i]));
}
}
use of net.sourceforge.pmd.eclipse.ui.views.actions.PriorityFilterAction in project pmd-eclipse-plugin by pmd.
the class ViolationOutline method addFilterControls.
/**
* Creates a DropDownMenu for the view
*/
private void addFilterControls() {
IMenuManager manager = getViewSite().getActionBars().getMenuManager();
List<Integer> filterList = priorityFilter.getPriorityFilterList();
// we add the PriorityFilter-Actions to this Menu
RulePriority[] priorities = UISettings.currentPriorities(true);
for (RulePriority priority : priorities) {
Action filterAction = new PriorityFilterAction(priority, this);
if (filterList.contains(priority.getPriority())) {
filterAction.setChecked(true);
}
manager.add(filterAction);
}
}
use of net.sourceforge.pmd.eclipse.ui.views.actions.PriorityFilterAction in project pmd-eclipse-plugin by pmd.
the class ViolationOverviewMenuManager method createContextMenu.
/**
* Creates the Context Menu
*/
public void createContextMenu() {
MenuManager manager = new MenuManager();
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
MenuManager submenuManager;
// one SubMenu for filtering Projects
submenuManager = new MenuManager(getString(StringKeys.VIEW_MENU_RESOURCE_FILTER));
createProjectFilterMenu(submenuManager);
manager.add(submenuManager);
// ... another one for filtering Priorities
submenuManager = new MenuManager(getString(StringKeys.VIEW_MENU_PRIORITY_FILTER));
for (PriorityFilterAction priorityAction : priorityActions) {
submenuManager.add(priorityAction);
}
manager.add(submenuManager);
// ... another one for showing the presentation types
submenuManager = new MenuManager(getString(StringKeys.VIEW_MENU_PRESENTATION_TYPE));
createShowTypeSubmenu(submenuManager);
manager.add(submenuManager);
// additions Action: Clear PMD Violations
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS + "-end"));
}
});
Tree tree = overview.getViewer().getTree();
tree.setMenu(manager.createContextMenu(tree));
overview.getSite().registerContextMenu(manager, overview.getViewer());
}
use of net.sourceforge.pmd.eclipse.ui.views.actions.PriorityFilterAction in project pmd-eclipse-plugin by pmd.
the class ViolationOverviewMenuManager method createActionBars.
/**
* Creates the ActionBars
*/
public void createActionBars(IToolBarManager manager) {
// Action for calculating the #violations/loc
final Action calculateStats = new CalculateStatisticsAction(overview);
manager.add(calculateStats);
manager.add(new Separator());
// the PriorityFilter-Actions
for (PriorityFilterAction priorityAction : priorityActions) {
manager.add(priorityAction);
}
manager.add(new Separator());
Action collapseAllAction = new CollapseAllAction(overview.getViewer());
manager.add(collapseAllAction);
}
Aggregations