- /**
- * Cell cenderer for the node combo box.
- *
- * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
- */
- private static class NodeComboBoxCellRenderer extends DefaultListCellRenderer {
-
- /**
- * Empty constructor.
- */
- public NodeComboBoxCellRenderer() {
- super();
- }
-
- /**
- * @see javax.swing.DefaultListCellRenderer#getListCellRendererComponent(javax.swing.JList,
- * java.lang.Object, int, boolean, boolean)
- */
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- if (value == null) {
- return super.getListCellRendererComponent(list, "\u00a0", index, isSelected, cellHasFocus);
- }
- return super.getListCellRendererComponent(list, ((Node) value).getName(), index, isSelected, cellHasFocus);
- }
-
- }
-