gTable.addRows(dataSet.getRowCount());
int columnIndex = 0;
List<DisplayerSettingsColumn> displayerSettingsColumns = displayerSettings.getColumnList();
for (int i = 0; i < displayerSettingsColumns.size(); i++) {
DisplayerSettingsColumn displayerSettingsColumn = displayerSettingsColumns.get(i);
DataColumn dataColumn = null;
if (displayerSettingsColumn.getColumnId() != null) dataColumn = dataSet.getColumnById(displayerSettingsColumn.getColumnId());
else dataColumn = dataSet.getColumnByIndex(columnIndex++);
if (dataColumn == null) {
throw new RuntimeException("Displayer column not found in the data set: " + displayerSettingsColumn.getDisplayName());
}
ColumnType columnType = dataColumn.getColumnType();
List columnValues = dataColumn.getValues();
gTable.addColumn(getColumnType(dataColumn), displayerSettingsColumn.getDisplayName(), dataColumn.getId());
for (int j = 0; j < columnValues.size(); j++) {
Object value = columnValues.get(j);
setTableValue(gTable, columnType, value, j, i);
}
}