// personProxy, Person.LAST_NAME);
// String age = getPropertyAsString(
// personProxy, Person.AGE);
//
// String details = firstName + " " + lastName + " - " + age;
Proxy proxy = (Proxy) value;
ProxyRenderer renderer = gui.getRenderers().getRenderer(
proxy);
String details = renderer.render(proxy);
return super.getListCellRendererComponent(
list, details, index, isSelected, cellHasFocus);
}
});
list.addMouseListener(
new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
int index = list.getSelectedIndex();
Proxy itemProxy = listProxy.getItemProxy(index);
openEditDialog(itemProxy);
}
}
});
JPanel listButtonPanel = new JPanel();
listButtonPanel.setBackground(Color.YELLOW);
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = GridBagConstraints.VERTICAL;
add(listButtonPanel);
listButtonPanel.setLayout(new GridLayout(2, 1));
JButton button;
AbstractAction addContactAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
final Proxy itemProxy = listProxy.addItemProxy();
openEditDialog(itemProxy);
}
};
addContactAction.putValue(Action.NAME, "Add");