Search in sources :

Example 1 with CheckArticleTools

use of org.wikipediacleaner.gui.swing.worker.CheckArticleTools in project wpcleaner by WPCleaner.

the class ActionCheckArticle method checkArticles.

/**
 * @param pages List of pages.
 * @param wiki Wiki.
 */
private static void checkArticles(List<Page> pages, EnumWikipedia wiki) {
    CheckArticleTools tools = new CheckArticleTools(wiki);
    try {
        for (Page page : pages) {
            tools.checkArticle(page, null);
        }
    } catch (APIException e) {
        return;
    }
    String report = tools.getReport();
    InformationWindow.createInformationWindow(GT._T("Analysis"), report, false, wiki);
}
Also used : CheckArticleTools(org.wikipediacleaner.gui.swing.worker.CheckArticleTools) APIException(org.wikipediacleaner.api.APIException) Page(org.wikipediacleaner.api.data.Page)

Example 2 with CheckArticleTools

use of org.wikipediacleaner.gui.swing.worker.CheckArticleTools in project wpcleaner by WPCleaner.

the class ActionCheckArticle method checkArticle.

/**
 * @param page Check an article.
 * @param wiki Wiki.
 */
private static void checkArticle(Page page, EnumWikipedia wiki) {
    CheckArticleTools tools = new CheckArticleTools(wiki);
    try {
        tools.checkArticle(page, null);
    } catch (APIException e) {
        return;
    }
    String report = tools.getReport();
    InformationWindow.createInformationWindow(GT._T("Analysis"), report, false, wiki);
}
Also used : CheckArticleTools(org.wikipediacleaner.gui.swing.worker.CheckArticleTools) APIException(org.wikipediacleaner.api.APIException)

Example 3 with CheckArticleTools

use of org.wikipediacleaner.gui.swing.worker.CheckArticleTools in project wpcleaner by WPCleaner.

the class ActionCheckTemplate method actionPerformed.

/**
 * Check a template.
 *
 * @param e Event triggering this call.
 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
 */
@Override
public void actionPerformed(ActionEvent e) {
    if ((e == null) || (wiki == null) || (template == null)) {
        return;
    }
    CheckArticleTools tools = new CheckArticleTools(wiki);
    try {
        tools.checkTemplate(template);
    } catch (APIException exception) {
        return;
    }
    String report = tools.getReport();
    Utilities.displayWarning(parent, report);
}
Also used : CheckArticleTools(org.wikipediacleaner.gui.swing.worker.CheckArticleTools) APIException(org.wikipediacleaner.api.APIException)

Aggregations

APIException (org.wikipediacleaner.api.APIException)3 CheckArticleTools (org.wikipediacleaner.gui.swing.worker.CheckArticleTools)3 Page (org.wikipediacleaner.api.data.Page)1