Search in sources :

Example 1 with SetComparatorAction

use of org.wikipediacleaner.gui.swing.action.SetComparatorAction in project wpcleaner by WPCleaner.

the class DisambiguationWindow method createSortMenu.

/**
 * @return Sort menu.
 */
private JMenu createSortMenu() {
    JMenu menu = Utilities.createJMenu(GT._T("Sort"));
    List<CompositeComparator<Page>> comparators = PageComparator.getComparators();
    for (CompositeComparator<Page> comparator : comparators) {
        JMenuItem menuItem = Utilities.createJMenuItem(comparator.getName(), true);
        menuItem.addActionListener(new SetComparatorAction(modelLinks, comparator));
        menu.add(menuItem);
    }
    return menu;
}
Also used : Page(org.wikipediacleaner.api.data.Page) ActionWatchPage(org.wikipediacleaner.gui.swing.action.ActionWatchPage) JMenuItem(javax.swing.JMenuItem) JMenu(javax.swing.JMenu) CompositeComparator(org.wikipediacleaner.api.data.CompositeComparator) SetComparatorAction(org.wikipediacleaner.gui.swing.action.SetComparatorAction)

Example 2 with SetComparatorAction

use of org.wikipediacleaner.gui.swing.action.SetComparatorAction in project wpcleaner by WPCleaner.

the class OnePageAnalysisWindow method createSortMenu.

/**
 * @return Sort menu.
 */
private JMenu createSortMenu() {
    JMenu menu = Utilities.createJMenu(GT._T("Sort"));
    List<CompositeComparator<Page>> comparators = PageComparator.getComparators();
    for (CompositeComparator<Page> comparator : comparators) {
        JMenuItem menuItem = Utilities.createJMenuItem(comparator.getName(), true);
        menuItem.addActionListener(new SetComparatorAction(modelLinks, comparator));
        menu.add(menuItem);
    }
    return menu;
}
Also used : Page(org.wikipediacleaner.api.data.Page) CheckErrorPage(org.wikipediacleaner.api.check.CheckErrorPage) ActionDeletePage(org.wikipediacleaner.gui.swing.action.ActionDeletePage) ActionWatchPage(org.wikipediacleaner.gui.swing.action.ActionWatchPage) JMenuItem(javax.swing.JMenuItem) JMenu(javax.swing.JMenu) CompositeComparator(org.wikipediacleaner.api.data.CompositeComparator) SetComparatorAction(org.wikipediacleaner.gui.swing.action.SetComparatorAction)

Aggregations

JMenu (javax.swing.JMenu)2 JMenuItem (javax.swing.JMenuItem)2 CompositeComparator (org.wikipediacleaner.api.data.CompositeComparator)2 Page (org.wikipediacleaner.api.data.Page)2 ActionWatchPage (org.wikipediacleaner.gui.swing.action.ActionWatchPage)2 SetComparatorAction (org.wikipediacleaner.gui.swing.action.SetComparatorAction)2 CheckErrorPage (org.wikipediacleaner.api.check.CheckErrorPage)1 ActionDeletePage (org.wikipediacleaner.gui.swing.action.ActionDeletePage)1