/**
* @return Links components.
*/
private Component createLinksComponents() {
JPanel panel = new JPanel(new GridBagLayout());
Configuration configuration = Configuration.getConfiguration();
listLinks = new JList(modelLinks);
// Initialize constraints
GridBagConstraints constraints = new GridBagConstraints();
constraints.fill = GridBagConstraints.HORIZONTAL;
constraints.gridheight = 1;
constraints.gridwidth = 1;
constraints.gridx = 0;
constraints.gridy = 0;
constraints.insets = new Insets(0, 0, 0, 0);
constraints.ipadx = 0;
constraints.ipady = 0;
constraints.weightx = 1;
constraints.weighty = 0;
// Select next links button
buttonSelectNextLinks = Utilities.createJButton(GT._("Select &next links"), null);
buttonSelectNextLinks.addActionListener(EventHandler.create(
ActionListener.class, this, "actionSelectNextLinks"));
constraints.fill = GridBagConstraints.HORIZONTAL;
constraints.weightx = 1;
panel.add(buttonSelectNextLinks, constraints);
constraints.gridy++;
// Automatic fixing
buttonAutomaticFixing = Utilities.createJButton(GT._("Automatic fixing"), null);
buttonAutomaticFixing.addActionListener(EventHandler.create(
ActionListener.class, this, "actionRunAutomaticFixing"));
panel.add(buttonAutomaticFixing, constraints);
constraints.gridy++;
// Button toolbar
JToolBar toolbar = new JToolBar(SwingConstants.HORIZONTAL);
toolbar.setFloatable(false);
toolbar.setBorderPainted(false);
buttonFullAnalysisLink = ActionFullAnalysis.addButton(
getParentComponent(), toolbar, getWikipedia(), listLinks, knownPages, true, true);
ActionDisambiguationAnalysis.addButton(
getParentComponent(), toolbar, getWikipedia(), listLinks, true, true);
buttonMarkNormal = Utilities.createJButton(
"wpc-mark-normal.png", EnumImageSize.NORMAL,
GT._("Mark backlink as normal"), false, null);
buttonMarkNormal.addActionListener(EventHandler.create(
ActionListener.class, this, "actionMarkBacklinkNormal"));
toolbar.add(buttonMarkNormal);
buttonMarkNeedHelp = Utilities.createJButton(
"wpc-mark-need-help.png", EnumImageSize.NORMAL,
GT._("Mark backlink as needing help"), false, null);
buttonMarkNeedHelp.addActionListener(EventHandler.create(
ActionListener.class, this, "actionMarkBacklinkHelpNeeded"));
toolbar.add(buttonMarkNeedHelp);
buttonViewLink = ActionExternalViewer.addButton(
toolbar, getWikipedia(), listLinks, false, true, true);
toolbar.addSeparator();
linkCount = new JLabel(GT._("Link count"));
toolbar.add(linkCount);
constraints.fill = GridBagConstraints.HORIZONTAL;
constraints.weightx = 1;
constraints.weighty = 0;
panel.add(toolbar, constraints);
constraints.gridy++;
// Links
listCellRenderer = new PageListCellRenderer();
listCellRenderer.showRedirect(true);
listCellRenderer.showRedirectBacklinks(true);
if (getPage() != null) {
listCellRenderer.setPageProperties(configuration.getSubProperties(
getWikipedia(), Configuration.PROPERTIES_BACKLINKS, getPage().getTitle()));
}
listLinks.setCellRenderer(listCellRenderer);
popupListenerLinks = new DisambiguationPageListPopupListener(
getWikipedia(), getTextContents(), listLinks, this);