Iterator<Page> iter = page.getRedirectIteratorWithPage();
while (iter.hasNext()) {
Page pageTmp = iter.next();
menuItem = new JMenuItem(pageTmp.getTitle());
updateFont(menuItem, pageTmp);
action = new ActionFullAnalysis(wiki, pageTmp.getTitle());
menuItem.addActionListener(action);
submenuAnalyze.add(menuItem);
fixedBegin++;
}
if ((links != null) && (links.size() > 0)) {
fixedBegin += addSeparator(submenuAnalyze);
for (Page p : links) {
menuItem = new JMenuItem(p.getTitle());
updateFont(menuItem, p);
action = new ActionFullAnalysis(wiki, p.getTitle());
menuItem.addActionListener(action);
submenuAnalyze.add(menuItem);
}
fixedEnd += addSeparator(submenuAnalyze);
iter = page.getRedirectIteratorWithPage();
while (iter.hasNext()) {
Page pageTmp = iter.next();
menuItem = new JMenuItem(pageTmp.getTitle());
updateFont(menuItem, pageTmp);
action = new ActionFullAnalysis(wiki, pageTmp.getTitle());
menuItem.addActionListener(action);
submenuAnalyze.add(menuItem);
fixedEnd++;
}
}
addSubmenu(popup, submenuAnalyze, fixedBegin, fixedEnd);
} else {
if ((page.getNamespace() != null) &&
(page.getNamespace().intValue() == Namespace.TEMPLATE)) {
menuItem = new JMenuItem(GT._("Analyze template"));
} else {
menuItem = new JMenuItem(GT._("Analyze page"));
}
action = new ActionFullAnalysis(wiki, page.getTitle());
menuItem.addActionListener(action);
popup.add(menuItem);
}
}