01: package org.swingml.treetablebrowser.ext;
02:
03: import javax.swing.table.*;
04:
05: public class TreeTableBrowserCellIconDecorator {
06: public TreeTableBrowserCellIconDecorator(
07: TreeTableComponent aTreeTable) {
08: super ();
09: TreeTableBrowserModelAdapter theTreeTableModel = (TreeTableBrowserModelAdapter) aTreeTable
10: .getModel();
11: for (int columnIndex = 0; columnIndex < theTreeTableModel
12: .getColumnCount(); columnIndex++) {
13: TableCellRenderer originalRenderer = aTreeTable
14: .getDefaultRenderer(theTreeTableModel
15: .getColumnClass(columnIndex));
16: if (!(originalRenderer instanceof TreeTableBrowserCellIconRenderer)) {
17: aTreeTable.setDefaultRenderer(theTreeTableModel
18: .getColumnClass(columnIndex),
19: new TreeTableBrowserCellIconRenderer(
20: originalRenderer));
21: }
22: }
23: }
24: }
|