// Walk the list of all columns used by the report, adding the table
// to the sorted set of tables.
report.withFieldsDo(new FieldWalker() {
public void step(Field f) {
if (f instanceof ColumnField) {
Column col = ((ColumnField)f).getColumn();
Table t = col.getTable();
if (t == null)
noTableCols.add(col);
else
tables.add(t);
}
}
});
// Add tables and columns under tables
for (Iterator iter = tables.iterator(); iter.hasNext(); )
addTableNode(categoryNode, (Table)iter.next());
// Add colums that have no table
for (Iterator iter = noTableCols.iterator(); iter.hasNext(); ) {
Column column = (Column)iter.next();
ColumnInfo info = new ColumnInfo(column, designer);
categoryNode.add(new DefaultMutableTreeNode(info, false));
}
}