/* (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();
}
}
}