+ // If a pre(-defined list of columns has been injected, we use it,
+ // otherwise we display all results of the resultSet
+ if (!displayAllColumns && columnProperties != null) {
+ int i = 0;
+
+ Iterator<String> it = columnProperties.iterator();
+ while (it.hasNext()) {
+ String columnName = it.next();
+
+ TableViewerColumn tvc = new TableViewerColumn(viewer,
+ SWT.NONE);
+ tableConfigurer.configureColumn(columnName, tvc, i);
+ tvc.setLabelProvider(tableConfigurer
+ .getLabelProvider(columnName));
+ tableViewerColumns.add(tvc);
+ i++;
+ }
+ } else {
+ int i = 0;
+ for (final String columnName : qr.getColumnNames()) {
+ TableViewerColumn tvc = new TableViewerColumn(viewer,
+ SWT.NONE);
+ // Small hack to remove prefix from the column name
+ // String tmpStr = columnName.substring(columnName
+ // .lastIndexOf(".") + 1);
+ tableConfigurer.configureColumn(columnName, tvc, i);
+ tvc.setLabelProvider(tableConfigurer
+ .getLabelProvider(columnName));
+ tableViewerColumns.add(tvc);
+ i++;
+ }
+ }