Search in sources :

Example 1 with ShowRuleAction

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

the class ViolationOutline method buildMenu.

private void buildMenu(IMenuManager manager, TableViewer viewer) {
    // show the Rule Dialog
    Action showRuleAction = new ShowRuleAction(viewer, getSite().getShell());
    manager.add(showRuleAction);
    // add Review Comment
    ReviewAction reviewAction = new ReviewAction(viewer);
    manager.add(reviewAction);
    // Remove Violation
    RemoveViolationAction removeAction = new RemoveViolationAction(viewer);
    manager.add(removeAction);
    // Disable rule
    DisableRuleAction disableAction = new DisableRuleAction(viewer);
    disableAction.setEnabled(disableAction.hasActiveRules());
    manager.add(disableAction);
    // Quick Fix (where possible)
    QuickFixAction quickFixAction = new QuickFixAction(viewer);
    quickFixAction.setEnabled(quickFixAction.hasQuickFix());
    manager.add(quickFixAction);
    // additions Action: Clear reviews
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS + "-end"));
}
Also used : ShowRuleAction(net.sourceforge.pmd.eclipse.ui.views.actions.ShowRuleAction) DisableRuleAction(net.sourceforge.pmd.eclipse.ui.views.actions.DisableRuleAction) ReviewAction(net.sourceforge.pmd.eclipse.ui.views.actions.ReviewAction) PriorityFilterAction(net.sourceforge.pmd.eclipse.ui.views.actions.PriorityFilterAction) Action(org.eclipse.jface.action.Action) RemoveViolationAction(net.sourceforge.pmd.eclipse.ui.views.actions.RemoveViolationAction) ShowRuleAction(net.sourceforge.pmd.eclipse.ui.views.actions.ShowRuleAction) QuickFixAction(net.sourceforge.pmd.eclipse.ui.views.actions.QuickFixAction) ReviewAction(net.sourceforge.pmd.eclipse.ui.views.actions.ReviewAction) RemoveViolationAction(net.sourceforge.pmd.eclipse.ui.views.actions.RemoveViolationAction) DisableRuleAction(net.sourceforge.pmd.eclipse.ui.views.actions.DisableRuleAction) QuickFixAction(net.sourceforge.pmd.eclipse.ui.views.actions.QuickFixAction) Separator(org.eclipse.jface.action.Separator)

Aggregations

DisableRuleAction (net.sourceforge.pmd.eclipse.ui.views.actions.DisableRuleAction)1 PriorityFilterAction (net.sourceforge.pmd.eclipse.ui.views.actions.PriorityFilterAction)1 QuickFixAction (net.sourceforge.pmd.eclipse.ui.views.actions.QuickFixAction)1 RemoveViolationAction (net.sourceforge.pmd.eclipse.ui.views.actions.RemoveViolationAction)1 ReviewAction (net.sourceforge.pmd.eclipse.ui.views.actions.ReviewAction)1 ShowRuleAction (net.sourceforge.pmd.eclipse.ui.views.actions.ShowRuleAction)1 Action (org.eclipse.jface.action.Action)1 Separator (org.eclipse.jface.action.Separator)1