Package org.wikipediacleaner.gui.swing.basic

Examples of org.wikipediacleaner.gui.swing.basic.ProgressPanel


  /* (non-Javadoc)
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) {
    ProgressPanel progressPanel = (window != null) ? window.getGlassPane() : null;
    try {
      if (progressPanel != null) {
        progressPanel.start();
        progressPanel.setText(GT._("Retrieving MediaWiki API"));
      }
      API api = APIFactory.getAPI();
      if (progressPanel != null) {
        progressPanel.setText(GT._("Analyzing links for redirect pages"));
      }
      ArrayList<Page> pages = new ArrayList<Page>();
      pages.add(page);
      api.initializeRedirect(wikipedia, pages);
      if (progressPanel != null) {
        progressPanel.setText(GT._("Analyzing links for disambiguation pages"));
      }
      api.initializeDisambiguationStatus(wikipedia, pages, false);
      Iterator<Page> iter = page.getRedirectIteratorWithPage();
      while (iter.hasNext()) {
        Page tmp = iter.next();
        if (progressPanel != null) {
          progressPanel.setText(GT._(
              "Retrieving possible disambiguations for {0}",
              new Object[] { tmp.getTitle() } ));
        }
        api.retrieveLinks(wikipedia, Collections.singletonList(tmp));
      }
    } catch (APIException ex) {
      //
    } finally {
      if (progressPanel != null) {
        progressPanel.stop();
      }
    }
  }
View Full Code Here


  /* (non-Javadoc)
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) {
    ProgressPanel progressPanel = (window != null) ? window.getGlassPane() : null;
    try {
      if (progressPanel != null) {
        progressPanel.start();
        progressPanel.setText(GT._("Retrieving MediaWiki API"));
      }
      API api = APIFactory.getAPI();
      if (progressPanel != null) {
        progressPanel.setText(GT._("Purging page cache"));
      }
      api.purgePageCache(wikipedia, page);
    } catch (APIException ex) {
      //
    } finally {
      if (progressPanel != null) {
        progressPanel.stop();
      }
    }
  }
View Full Code Here

  /* (non-Javadoc)
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) {
    ProgressPanel progressPanel = (window != null) ? window.getGlassPane() : null;
    try {
      if (progressPanel != null) {
        progressPanel.start();
        progressPanel.setText(GT._("Retrieving MediaWiki API"));
      }
      API api = APIFactory.getAPI();
      if (progressPanel != null) {
        progressPanel.setText(GT._("Retrieving members of a category"));
      }
      api.retrieveCategoryMembers(wiki, category, 0, true);
    } catch (APIException ex) {
      //
    } finally {
      if (progressPanel != null) {
        progressPanel.stop();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.gui.swing.basic.ProgressPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.