Search in sources :

Example 1 with PageListWorker

use of org.wikipediacleaner.gui.swing.pagelist.PageListWorker in project wpcleaner by WPCleaner.

the class MainWindow method actionWatchlist.

/**
 * Action called when watch list button is pressed.
 */
public void actionWatchlist() {
    EnumWikipedia wikipedia = getWikipedia();
    if (wikipedia == null) {
        return;
    }
    new PageListWorker(wikipedia, this, null, null, PageListWorker.Mode.WATCH_LIST, true, GT._T("Watch list")).start();
}
Also used : PageListWorker(org.wikipediacleaner.gui.swing.pagelist.PageListWorker) EnumWikipedia(org.wikipediacleaner.api.constants.EnumWikipedia)

Example 2 with PageListWorker

use of org.wikipediacleaner.gui.swing.pagelist.PageListWorker in project wpcleaner by WPCleaner.

the class MainWindow method actionMostDabLinks.

/**
 * Action called when "Pages with most disambiguation links" is pressed.
 */
public void actionMostDabLinks() {
    EnumWikipedia wikipedia = getWikipedia();
    if (wikipedia == null) {
        return;
    }
    WPCConfiguration configuration = wikipedia.getConfiguration();
    List<String> mostDabLinks = configuration.getStringList(WPCConfigurationStringList.MOST_DAB_LINKS);
    if ((mostDabLinks == null) || (mostDabLinks.isEmpty())) {
        Utilities.displayMessageForMissingConfiguration(getParentComponent(), WPCConfigurationStringList.MOST_DAB_LINKS.getAttributeName());
        return;
    }
    new PageListWorker(wikipedia, this, null, mostDabLinks, PageListWorker.Mode.CATEGORY_MEMBERS_ARTICLES, false, GT._T("Pages with many disambiguation links")).start();
}
Also used : PageListWorker(org.wikipediacleaner.gui.swing.pagelist.PageListWorker) EnumWikipedia(org.wikipediacleaner.api.constants.EnumWikipedia) ConfigurationValueString(org.wikipediacleaner.utils.ConfigurationValueString) WPCConfiguration(org.wikipediacleaner.api.configuration.WPCConfiguration)

Example 3 with PageListWorker

use of org.wikipediacleaner.gui.swing.pagelist.PageListWorker in project wpcleaner by WPCleaner.

the class MainWindow method actionSearchTitles.

/**
 * Action called when Search Titles button is pressed.
 */
public void actionSearchTitles() {
    String pageName = checkPagename(GT._T("You must input a page name"));
    if (pageName == null) {
        return;
    }
    new PageListWorker(getWikipedia(), this, null, Collections.singletonList(pageName), PageListWorker.Mode.SEARCH_TITLES, false, GT._T("Search results for {0}", pageName)).start();
}
Also used : PageListWorker(org.wikipediacleaner.gui.swing.pagelist.PageListWorker) ConfigurationValueString(org.wikipediacleaner.utils.ConfigurationValueString)

Example 4 with PageListWorker

use of org.wikipediacleaner.gui.swing.pagelist.PageListWorker in project wpcleaner by WPCleaner.

the class MainWindow method actionHelpRequestedOn.

/**
 * Action called when Help Requested On is pressed.
 */
public void actionHelpRequestedOn() {
    EnumWikipedia wikipedia = getWikipedia();
    if (wikipedia == null) {
        return;
    }
    WPCConfiguration configuration = wikipedia.getConfiguration();
    List<Page> templates = configuration.getTemplatesForHelpRequested();
    if ((templates == null) || (templates.isEmpty())) {
        Utilities.displayMessageForMissingConfiguration(getParentComponent(), WPCConfigurationStringList.TEMPLATES_FOR_HELP_REQUESTED.getAttributeName());
        return;
    }
    List<String> pageNames = new ArrayList<>();
    for (Page template : templates) {
        pageNames.add(template.getTitle());
    }
    new PageListWorker(wikipedia, this, null, pageNames, PageListWorker.Mode.EMBEDDED_IN, false, GT._T("Help requested on...")).start();
}
Also used : PageListWorker(org.wikipediacleaner.gui.swing.pagelist.PageListWorker) ArrayList(java.util.ArrayList) EnumWikipedia(org.wikipediacleaner.api.constants.EnumWikipedia) EnumQueryPage(org.wikipediacleaner.api.constants.EnumQueryPage) Page(org.wikipediacleaner.api.data.Page) ConfigurationValueString(org.wikipediacleaner.utils.ConfigurationValueString) WPCConfiguration(org.wikipediacleaner.api.configuration.WPCConfiguration)

Example 5 with PageListWorker

use of org.wikipediacleaner.gui.swing.pagelist.PageListWorker in project wpcleaner by WPCleaner.

the class MainWindow method actionInternalLinks.

/**
 * Action called when Internal Links button is pressed.
 *
 * @param mode Mode.
 */
public void actionInternalLinks(String mode) {
    String pageName = checkPagename(GT._T("You must input a page name for retrieving the list of internal links"));
    if ((pageName == null) || (mode == null)) {
        return;
    }
    Configuration config = Configuration.getConfiguration();
    config.setString(null, ConfigurationValueString.PAGE_NAME, pageName);
    config.save();
    new PageListWorker(getWikipedia(), this, DataManager.getPage(getWikipedia(), pageName, null, null, null), Collections.singletonList(pageName), PageListWorker.Mode.valueOf(mode), false, GT._T("Internal links in {0}", pageName)).start();
}
Also used : PageListWorker(org.wikipediacleaner.gui.swing.pagelist.PageListWorker) WPCConfiguration(org.wikipediacleaner.api.configuration.WPCConfiguration) Configuration(org.wikipediacleaner.utils.Configuration) WikiConfiguration(org.wikipediacleaner.api.configuration.WikiConfiguration) ConfigurationValueString(org.wikipediacleaner.utils.ConfigurationValueString)

Aggregations

PageListWorker (org.wikipediacleaner.gui.swing.pagelist.PageListWorker)17 ConfigurationValueString (org.wikipediacleaner.utils.ConfigurationValueString)13 EnumWikipedia (org.wikipediacleaner.api.constants.EnumWikipedia)10 WPCConfiguration (org.wikipediacleaner.api.configuration.WPCConfiguration)8 EnumQueryPage (org.wikipediacleaner.api.constants.EnumQueryPage)8 Page (org.wikipediacleaner.api.data.Page)7 ArrayList (java.util.ArrayList)5 WikiConfiguration (org.wikipediacleaner.api.configuration.WikiConfiguration)5 Configuration (org.wikipediacleaner.utils.Configuration)5 APIException (org.wikipediacleaner.api.APIException)3 API (org.wikipediacleaner.api.API)2 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 JFileChooser (javax.swing.JFileChooser)1 FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)1 AbuseFilter (org.wikipediacleaner.api.data.AbuseFilter)1 PageElementInternalLink (org.wikipediacleaner.api.data.PageElementInternalLink)1