if (columnIndex == 0) {
return new JLabel(row.getLabel());
} else {
if (currentEditor != null) currentEditor.transferFocus();
Component editor = row.getEditor(parent);
if (editor instanceof JComboBox) {
((JComboBox) editor).addActionListener(this);
editor.addFocusListener(this);
} else if (editor instanceof JInputComponent) {
JInputComponent input = (JInputComponent) editor;
MyDialog dlog;
Window parent = AttrTable.this.parent;
if (parent instanceof Frame) {
dlog = new MyDialog((Frame) parent, input);
} else {
dlog = new MyDialog((Dialog) parent, input);
}
dlog.setVisible(true);
Object retval = dlog.getValue();
try {
row.setValue(retval);
} catch (AttrTableSetException e) {
JOptionPane.showMessageDialog(parent, e.getMessage(),
Strings.get("attributeChangeInvalidTitle"),
JOptionPane.WARNING_MESSAGE);
}
editor = new JLabel(row.getValue());
} else {
editor.addFocusListener(this);
}
currentRow = row;
currentEditor = editor;
return editor;
}