}
}
}
public void addColumn(TableColumn tc) {
tc.setHeaderRenderer(new SpreadSheetColumnHeaderRenderer());
if (columnIndex == 0) {
Field field = (Field) originalFieldArray.get(columnIndex);
tc.setIdentifier(field); // store the field with the column
// tc.setIdentifier(null); // store the field with the column
tc.setPreferredWidth(0);
colWidth = 0;
// nothing
} else {
super.addColumn(tc);
Field field = (Field) originalFieldArray.get(columnIndex);
tc.setIdentifier(field); // store the field with the column
// System.out.println("setting column " + columnIndex + " to field " + field + " ok = " + (field == getFieldInColumn(columnIndex)));
if (field.isNameField()) {
tc.setPreferredWidth((svg)?170:150);
tc.setCellRenderer(new SpreadSheetNameCellRenderer());
// tc.setCellEditor(new SpreadSheetNameCellEditor(new SimpleEditor(String.class)));
tc.setCellEditor(new SpreadSheetCellEditorAdapter(new SimpleEditor(String.class)));
} else if (field == Configuration.getFieldFromId("Field.indicators")) {
tc.setPreferredWidth(50);
tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new IndicatorsRenderer()));
tc.setHeaderRenderer(new SpreadSheetColumnHeaderRenderer(IndicatorsRenderer.getCellHeader()));
} else if (field.getLookupTypes() != null) {
tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new LookupRenderer()));
} else {
tc.setPreferredWidth(150);
if (field.hasOptions()) {