use of org.wikipediacleaner.api.constants.EnumQueryPage in project wpcleaner by WPCleaner.
the class PageListWorker method constructQueryPage.
/**
* Construct special list of pages.
*
* @param pages List of pages.
* @throws APIException
*/
private void constructQueryPage(List<Page> pages) throws APIException {
final API api = APIFactory.getAPI();
EnumWikipedia wiki = getWikipedia();
EnumQueryPage query = EnumQueryPage.findByCode(elementNames.get(0));
List<Page> tmpPages = api.getQueryPages(wiki, query);
if (tmpPages != null) {
pages.addAll(tmpPages);
}
}
use of org.wikipediacleaner.api.constants.EnumQueryPage in project wpcleaner by WPCleaner.
the class MainWindow method actionSpecialList.
/**
* Action called to get a special list.
*
* @param code Query code.
*/
public void actionSpecialList(String code) {
EnumWikipedia wikipedia = getWikipedia();
if (wikipedia == null) {
return;
}
EnumQueryPage query = EnumQueryPage.findByCode(code);
if (query == null) {
return;
}
new PageListWorker(wikipedia, this, null, Collections.singletonList(code), PageListWorker.Mode.QUERY_PAGE, false, query.getName()).start();
}
use of org.wikipediacleaner.api.constants.EnumQueryPage in project wpcleaner by WPCleaner.
the class MainWindow method actionSpecialLists.
/**
* Action called when Special Lists button is pressed.
*/
public void actionSpecialLists() {
// Create menu for special lists
JPopupMenu menu = new JPopupMenu();
for (EnumQueryPage query : EnumQueryPage.values()) {
JMenuItem item = new JMenuItem(query.getName());
item.setActionCommand(query.getCode());
item.addActionListener(EventHandler.create(ActionListener.class, this, "actionSpecialList", "actionCommand"));
menu.add(item);
}
menu.show(buttonSpecialLists, 0, buttonSpecialLists.getHeight());
}
Aggregations