public JComponent getChildInCell(int pRow, int pColumn, boolean getEditor) {
pRow -= 1;
pColumn -=1;
ArrayColumnModel model = (ArrayColumnModel)this.table.getColumnModel();
TableCellEditor editor = model.getRealColumn(pColumn).getCellEditor();
TableCellRenderer renderer = model.getRealColumn(pColumn).getCellRenderer();
if (editor instanceof ArrayFieldCellEditor) {
editor = ((ArrayFieldCellEditor)editor).getEditor();
}
if (renderer instanceof ArrayFieldCellRenderer) {
renderer = ((ArrayFieldCellRenderer)renderer).getRenderer();
}
JComponent c;
if (getEditor) {
// Not used anymore. CraigM: 27/02/2008
// if (editor instanceof ComponentCellEditor) {
// c = (JComponent)((ComponentCellEditor)editor).getComponent();
// }
// else if (editor instanceof DefaultCellEditor) {
if (editor instanceof DefaultCellEditor) {
c = (JComponent)((DefaultCellEditor)editor).getComponent();
}
else {
//c = (JComponent)editor.getTableCellEditorComponent(this.table, this.table.getValueAt(pRow, pColumn), false, pRow, pColumn);
c = (JComponent)editor.getTableCellEditorComponent(this.table, this.table.getModel().getValueAt(pRow, pColumn), false, pRow, pColumn);
}
} else {
// Not used anymore. CraigM: 27/02/2008
// if (renderer instanceof ComponentCellRenderer) {
// c = (JComponent)((ComponentCellRenderer)renderer).getTableColumnTemplate();
// }
// else {
//c = (JComponent)renderer.getTableCellRendererComponent(this.table, this.table.getValueAt(pRow, pColumn), false, false, pRow, pColumn);
c = (JComponent)renderer.getTableCellRendererComponent(this.table, this.table.getModel().getValueAt(pRow, pColumn), false, false, pRow, pColumn);
// }
}
BodyGridCell cell = this.getCell(pRow, pColumn, true);
cell.setTemplate(c);
return c;