ここから例を試しています
rowHeaderLayer、ColumnHeaderLayer、CornerLayer、GridLayer にコメントし、viewPortLayer を nattable に直接設定しました。ツリーが表示されますが、rowHideShowLayer があるにもかかわらず、ツリーを展開および折りたたむことができません。
コード スニペットは次のとおりです。
EventList<Datum> eventList = GlazedLists.eventList(datums.values());
SortedList<Datum> sortedList = new SortedList<Datum>(eventList, null);
String[] propertyNames = new String[] { "self", "bar" };
IColumnPropertyAccessor<Datum> columnPropertyAccessor = new ReflectiveColumnPropertyAccessor<Datum>(propertyNames);
// Column header layer
IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(propertyNames);
DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(columnHeaderDataProvider);
ISortModel sortModel = new GlazedListsSortModel<Datum>(
sortedList,
columnPropertyAccessor,
configRegistry,
columnHeaderDataLayer);
final TreeList <Datum> treeList = new TreeList<Datum>(sortedList, new DatumTreeFormat(sortModel), new DatumExpansionModel());
GlazedListTreeData <Datum> treeData = new DatumTreeData(treeList);
GlazedListsDataProvider<Datum> bodyDataProvider = new GlazedListsDataProvider<Datum>(treeList, columnPropertyAccessor);
final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
// Body layer
ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(bodyDataLayer);
ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
SelectionLayer selectionLayer = new SelectionLayer(columnHideShowLayer);
RowHideShowLayer rowHideShowLayer = new RowHideShowLayer(selectionLayer);
final TreeLayer treeLayer = new TreeLayer(rowHideShowLayer, new GlazedListTreeRowModel<Datum>(treeData));
ViewportLayer viewportLayer = new ViewportLayer(treeLayer);
NatTable natTable = new NatTable(parent, viewportLayer, false);`