Search in sources :

Example 1 with FilterActivityNotifier

use of edu.umd.cs.findbugs.gui2.FilterActivity.FilterActivityNotifier in project spotbugs by spotbugs.

the class MainFrameTree method createBugPopupMenu.

/**
 * Creates popup menu for bugs on tree.
 */
JPopupMenu createBugPopupMenu() {
    JPopupMenu popupMenu = new JPopupMenu();
    JMenuItem filterMenuItem = MainFrameHelper.newJMenuItem("menu.filterBugsLikeThis", "Filter bugs like this");
    filterMenuItem.addActionListener(evt -> {
        new NewFilterFromBug(new FilterFromBugPicker(currentSelectedBugLeaf.getBug(), Arrays.asList(mainFrame.getAvailableSortables())), new ApplyNewFilter(mainFrame.getProject().getSuppressionFilter(), PreferencesFrame.getInstance(), new FilterActivityNotifier()));
        mainFrame.setProjectChanged(true);
        // Selects the top of the Jtree so the CommentsArea syncs up.
        mainFrame.getTree().setSelectionRow(0);
    });
    popupMenu.add(filterMenuItem);
    return popupMenu;
}
Also used : FilterActivityNotifier(edu.umd.cs.findbugs.gui2.FilterActivity.FilterActivityNotifier) JMenuItem(javax.swing.JMenuItem) JPopupMenu(javax.swing.JPopupMenu)

Aggregations

FilterActivityNotifier (edu.umd.cs.findbugs.gui2.FilterActivity.FilterActivityNotifier)1 JMenuItem (javax.swing.JMenuItem)1 JPopupMenu (javax.swing.JPopupMenu)1