int paramInt, boolean paramBoolean1, boolean paramBoolean2) {
Component renderer =
super.getListCellRendererComponent(paramJList, paramObject, paramInt, paramBoolean1,
paramBoolean2);
if (renderer instanceof JLabel && paramObject instanceof FieldNode) {
FieldNode fn = (FieldNode) paramObject;
((JLabel) renderer).setText(fn.name + ' ' + fn.desc);
}
return renderer;
}
});
fieldModel = new DefaultListModel<FieldNode>();
for (FieldNode fn : (List<FieldNode>) cNode.fields) {
fieldModel.addElement(fn);
}
list.setModel(fieldModel);
list.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent paramListSelectionEvent) {
onSelected(list.getSelectedValue());
}
});
panelFieldListings.add(list);
JPanel panelFieldInfo = new JPanel();
splitPane.setRightComponent(panelFieldInfo);
panelFieldInfo.setLayout(new BorderLayout(0, 0));
JPanel panelListControls = new JPanel();
panelListControls.setBorder(new LineBorder(new Color(0, 0, 0)));
panelFieldInfo.add(panelListControls, BorderLayout.NORTH);
panelListControls.setLayout(new WrapLayout());
JButton btnAddField = new JButton("Add Field...");
panelListControls.add(btnAddField);
JButton btnRemoveField = new JButton("Remove Field");
btnRemoveField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent paramActionEvent) {
FieldNode fn = list.getSelectedValue();
if (fn != null) {
fieldModel.removeElement(fn);
cNode.fields.remove(fn);
}
}