}
private JComponent getLicensingPanel() {
final String dcLicense = getLicense("lgpl");
final DCLabel licenseHeader = DCLabel.dark("");
licenseHeader.setFont(WidgetUtils.FONT_HEADER1);
final DCLabel licenseLabel = DCLabel.darkMultiLine("");
licenseLabel.setBackground(WidgetUtils.BG_COLOR_BRIGHTEST);
licenseLabel.setFont(WidgetUtils.FONT_MONOSPACE);
licenseLabel.setOpaque(true);
final JButton dcLicenseButton = WidgetFactory.createSmallButton("images/menu/license.png");
dcLicenseButton.setToolTipText("DataCleaner's license: GNU LGPL");
dcLicenseButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
licenseHeader.setText("Displaying license of DataCleaner");
licenseLabel.setText(dcLicense);
}
});
final JComboBox librariesComboBox = new JComboBox();
final JButton visitProjectButton = WidgetFactory.createSmallButton("images/actions/website.png");
librariesComboBox.setRenderer(new DefaultListCellRenderer() {
private static final long serialVersionUID = 1L;
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
if (value instanceof LicensedProject) {
LicensedProject project = (LicensedProject) value;
String name = project.name;
return super.getListCellRendererComponent(list, name, index, isSelected, cellHasFocus);
} else if (value instanceof String) {
return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
}
throw new UnsupportedOperationException();
}
});
librariesComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
Object item = e.getItem();
if (item instanceof LicensedProject) {
visitProjectButton.setEnabled(true);
LicensedProject project = (LicensedProject) item;
licenseLabel.setText(project.license);
licenseHeader.setText("Displaying license of " + project.name + "");
} else {
visitProjectButton.setEnabled(false);
licenseHeader.setText("Displaying license of DataCleaner");
licenseLabel.setText(dcLicense);
}
}
});
visitProjectButton.addActionListener(new ActionListener() {