// *************************************************************************
// Private methods and classes
// *************************************************************************
private void buildTable() {
DcObject dco = module.getItem();
getDcModel().setColumnCount(dco.getFields().size());
int counter = 0;
for (DcField field : dco.getFields()) {
TableColumn columnNew = getColumnModel().getColumn(counter);
columnNew.setIdentifier(field.getIndex());
columnNew.setHeaderValue(field.getLabel());
columnNew.setPreferredWidth(getPreferredWidth(field.getIndex()));
if ( field.getIndex() == DcObject._ID
|| field.getIndex() == DcObject._SYS_LENDBY
|| field.getIndex() == DcObject._SYS_LOANDURATION
|| field.getIndex() == DcObject._SYS_CREATED
|| field.getIndex() == DcObject._SYS_MODIFIED) {
DcShortTextField text = ComponentFactory.getTextFieldDisabled();
columnNew.setCellEditor(new DefaultCellEditor(text));
DcTableCellRenderer renderer = DcTableCellRenderer.getInstance();
renderer.setFont(ComponentFactory.getSystemFont());
columnNew.setCellRenderer(renderer);
} else if (field.getFieldType() == ComponentFactory._REFERENCESFIELD) {
columnNew.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
columnNew.setCellRenderer(ReferencesTableCellRenderer.getInstance());
} else if (field.getIndex() == DcObject._SYS_MODULE) {
DcShortTextField text = ComponentFactory.getTextFieldDisabled();
columnNew.setCellEditor(new DefaultCellEditor(text));
columnNew.setCellRenderer(ModuleTableCellRenderer.getInstance());
} else if (dco.getModule().getIndex() == DcModules._LOAN &&
field.getIndex() == Loan._C_CONTACTPERSONID) {
DcShortTextField text = ComponentFactory.getTextFieldDisabled();
columnNew.setCellEditor(new DefaultCellEditor(text));
columnNew.setCellRenderer(ContactPersonTableCellRenderer.getInstance());
} else {