From 477345eeb93ebf5f404c1fdaa2cad8ab8bc44cf4 Mon Sep 17 00:00:00 2001 From: Dirk Fauth Date: Fri, 25 Apr 2025 07:12:51 +0200 Subject: [PATCH] Fixes #151 - [Group] dimensions not updated if all grouped are hidden Signed-off-by: Dirk Fauth --- .../ColumnGroupHeaderLayerTest.java | 47 ++++++++++++++- .../group/performance/GroupModelTest.java | 22 ++++++- .../performance/RowGroupHeaderLayerTest.java | 47 ++++++++++++++- .../TwoLevelColumnGroupHeaderLayerTest.java | 57 ++++++++++++++++++- .../TwoLevelRowGroupHeaderLayerTest.java | 57 ++++++++++++++++++- .../performance/ColumnGroupHeaderLayer.java | 8 +-- .../group/performance/GroupModel.java | 20 ++++++- .../performance/RowGroupHeaderLayer.java | 8 +-- 8 files changed, 252 insertions(+), 14 deletions(-) diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayerTest.java index 93b85f697..ba35e9867 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayerTest.java +++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Dirk Fauth. + * Copyright (c) 2019, 2025 Dirk Fauth. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -14731,4 +14731,49 @@ public void shouldLoadStateWithCollapsedNonConsecutive() { verifyCleanState(); } + + @Test + public void shouldUpdateHeightOnHidingGroupedColumns() { + Group nameGroup = this.columnGroupHeaderLayer.getGroupByName("Person"); + Group addressGroup = this.columnGroupHeaderLayer.getGroupByName("Address"); + + // remove facts and personal group + this.gridLayer.doCommand(new RemoveColumnGroupCommand(8)); + this.gridLayer.doCommand(new RemoveColumnGroupCommand(11)); + + this.columnGroupHeaderLayer.setCalculateHeight(true); + + assertTrue(this.columnGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(40, this.columnGroupHeaderLayer.getHeight()); + assertEquals(2, this.columnGroupHeaderLayer.getRowCount()); + + // hide columns in Person group + this.gridLayer.doCommand(new MultiColumnHideCommand(this.gridLayer, 1, 2, 3, 4)); + + assertTrue(this.columnGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(0, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(40, this.columnGroupHeaderLayer.getHeight()); + assertEquals(2, this.columnGroupHeaderLayer.getRowCount()); + + // hide columns in Address group + this.gridLayer.doCommand(new MultiColumnHideCommand(this.gridLayer, 1, 2, 3, 4)); + + assertFalse(this.columnGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(0, nameGroup.getVisibleSpan()); + assertEquals(0, addressGroup.getVisibleSpan()); + assertEquals(20, this.columnGroupHeaderLayer.getHeight()); + assertEquals(2, this.columnGroupHeaderLayer.getRowCount()); + + // show all columns again + this.gridLayer.doCommand(new ShowAllColumnsCommand()); + + assertTrue(this.columnGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(40, this.columnGroupHeaderLayer.getHeight()); + assertEquals(2, this.columnGroupHeaderLayer.getRowCount()); + } } diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/GroupModelTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/GroupModelTest.java index 456d102fd..abbef72dd 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/GroupModelTest.java +++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/GroupModelTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2023 Dirk Fauth. + * Copyright (c) 2019, 2025 Dirk Fauth. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -1359,4 +1359,24 @@ public void shouldLoadStateWithSpecialCharactersInGroupName() { assertTrue(group3.hasMember(13)); assertTrue(group3.hasMember(14)); } + + @Test + public void shouldProvideVisibleState() { + assertTrue(this.model.isVisible()); + + // remove all indexes from group 1 + this.model.removePositionsFromGroup(0, 1, 2, 3); + // still visible because other groups are not empty + assertTrue(this.model.isVisible()); + + // remove all indexes from group 2 + this.model.removePositionsFromGroup(5, 6, 7); + // still visible because other groups are not empty + assertTrue(this.model.isVisible()); + + // remove all indexes from group 3 + this.model.removePositionsFromGroup(12, 13); + // all groups are empty, so group model is not visible anymore + assertFalse(this.model.isVisible()); + } } diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayerTest.java index 66aa545f7..0bb0b54a7 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayerTest.java +++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Dirk Fauth. + * Copyright (c) 2019, 2025 Dirk Fauth. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -14708,4 +14708,49 @@ public void shouldLoadStateWithCollapsedNonConsecutive() { verifyCleanState(); } + @Test + public void shouldUpdateWidthOnHidingGroupedColumns() { + Group nameGroup = this.rowGroupHeaderLayer.getGroupByName("Person"); + Group addressGroup = this.rowGroupHeaderLayer.getGroupByName("Address"); + + // remove facts and personal group + this.gridLayer.doCommand(new RemoveRowGroupCommand(8)); + this.gridLayer.doCommand(new RemoveRowGroupCommand(11)); + + this.rowGroupHeaderLayer.setCalculateWidth(true); + + assertTrue(this.rowGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(60, this.rowGroupHeaderLayer.getWidth()); + assertEquals(2, this.rowGroupHeaderLayer.getColumnCount()); + + // hide columns in Person group + this.gridLayer.doCommand(new MultiRowHideCommand(this.gridLayer, 1, 2, 3, 4)); + + assertTrue(this.rowGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(0, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(60, this.rowGroupHeaderLayer.getWidth()); + assertEquals(2, this.rowGroupHeaderLayer.getColumnCount()); + + // hide columns in Address group + this.gridLayer.doCommand(new MultiRowHideCommand(this.gridLayer, 1, 2, 3, 4)); + + assertFalse(this.rowGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(0, nameGroup.getVisibleSpan()); + assertEquals(0, addressGroup.getVisibleSpan()); + assertEquals(40, this.rowGroupHeaderLayer.getWidth()); + assertEquals(2, this.rowGroupHeaderLayer.getColumnCount()); + + // show all columns again + this.gridLayer.doCommand(new ShowAllRowsCommand()); + + assertTrue(this.rowGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(60, this.rowGroupHeaderLayer.getWidth()); + assertEquals(2, this.rowGroupHeaderLayer.getColumnCount()); + } + } diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/TwoLevelColumnGroupHeaderLayerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/TwoLevelColumnGroupHeaderLayerTest.java index 59c91b2c0..a183fa4d1 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/TwoLevelColumnGroupHeaderLayerTest.java +++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/TwoLevelColumnGroupHeaderLayerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2020 Dirk Fauth. + * Copyright (c) 2019, 2025 Dirk Fauth. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -40,6 +40,7 @@ import org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer; import org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer; import org.eclipse.nebula.widgets.nattable.group.command.ColumnGroupExpandCollapseCommand; +import org.eclipse.nebula.widgets.nattable.group.command.RemoveColumnGroupCommand; import org.eclipse.nebula.widgets.nattable.group.performance.GroupModel.Group; import org.eclipse.nebula.widgets.nattable.group.performance.command.ColumnGroupReorderCommand; import org.eclipse.nebula.widgets.nattable.group.performance.command.ColumnGroupReorderEndCommand; @@ -2497,4 +2498,58 @@ public void shouldNotBreakUnbreakableGroupOnReorderUngroupedToEndWithHiddenLastS assertNull(this.columnGroupHeaderLayer.getGroupByPosition(1, 7)); } + + @Test + public void shouldUpdateHeightOnHidingGroupedColumns() { + Group nameGroup = this.columnGroupHeaderLayer.getGroupByName("Person"); + Group addressGroup = this.columnGroupHeaderLayer.getGroupByName("Address"); + + // remove facts and personal group + this.gridLayer.doCommand(new RemoveColumnGroupCommand(8)); + this.gridLayer.doCommand(new RemoveColumnGroupCommand(11)); + + // change second level group to only include Address group + Group testGroup = this.columnGroupHeaderLayer.getGroupModel(1).getGroupByName("Test"); + this.columnGroupHeaderLayer.removePositionsFromGroup(1, 8, 9, 10); + + this.columnGroupHeaderLayer.setCalculateHeight(true); + + assertTrue(this.columnGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(4, testGroup.getVisibleSpan()); + assertEquals(60, this.columnGroupHeaderLayer.getHeight()); + assertEquals(3, this.columnGroupHeaderLayer.getRowCount()); + + // hide columns in Address group + this.gridLayer.doCommand(new MultiColumnHideCommand(this.gridLayer, 5, 6, 7, 8)); + + // this hides Test group in level 1, so height is reduced by one line + assertTrue(this.columnGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(0, addressGroup.getVisibleSpan()); + assertEquals(0, testGroup.getVisibleSpan()); + assertEquals(40, this.columnGroupHeaderLayer.getHeight()); + assertEquals(3, this.columnGroupHeaderLayer.getRowCount()); + + // hide columns in Person group + this.gridLayer.doCommand(new MultiColumnHideCommand(this.gridLayer, 1, 2, 3, 4)); + + assertFalse(this.columnGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(0, nameGroup.getVisibleSpan()); + assertEquals(0, addressGroup.getVisibleSpan()); + assertEquals(0, testGroup.getVisibleSpan()); + assertEquals(20, this.columnGroupHeaderLayer.getHeight()); + assertEquals(3, this.columnGroupHeaderLayer.getRowCount()); + + // show all columns again + this.gridLayer.doCommand(new ShowAllColumnsCommand()); + + assertTrue(this.columnGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(4, testGroup.getVisibleSpan()); + assertEquals(60, this.columnGroupHeaderLayer.getHeight()); + assertEquals(3, this.columnGroupHeaderLayer.getRowCount()); + } } diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/TwoLevelRowGroupHeaderLayerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/TwoLevelRowGroupHeaderLayerTest.java index 422f20d7b..4b3c274f8 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/TwoLevelRowGroupHeaderLayerTest.java +++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/TwoLevelRowGroupHeaderLayerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2020 Dirk Fauth. + * Copyright (c) 2019, 2025 Dirk Fauth. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -39,6 +39,7 @@ import org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer; import org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer; import org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer; +import org.eclipse.nebula.widgets.nattable.group.command.RemoveRowGroupCommand; import org.eclipse.nebula.widgets.nattable.group.command.RowGroupExpandCollapseCommand; import org.eclipse.nebula.widgets.nattable.group.performance.GroupModel.Group; import org.eclipse.nebula.widgets.nattable.group.performance.command.RowGroupReorderCommand; @@ -2491,4 +2492,58 @@ public void shouldNotBreakUnbreakableGroupOnReorderUngroupedToEndWithHiddenLastS assertNull(this.rowGroupHeaderLayer.getGroupByPosition(1, 7)); } + @Test + public void shouldUpdateWidthOnHidingGroupedRows() { + Group nameGroup = this.rowGroupHeaderLayer.getGroupByName("Person"); + Group addressGroup = this.rowGroupHeaderLayer.getGroupByName("Address"); + + // remove facts and personal group + this.gridLayer.doCommand(new RemoveRowGroupCommand(8)); + this.gridLayer.doCommand(new RemoveRowGroupCommand(11)); + + // change second level group to only include Address group + Group testGroup = this.rowGroupHeaderLayer.getGroupModel(1).getGroupByName("Test"); + this.rowGroupHeaderLayer.removePositionsFromGroup(1, 8, 9, 10); + + this.rowGroupHeaderLayer.setCalculateWidth(true); + + assertTrue(this.rowGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(4, testGroup.getVisibleSpan()); + assertEquals(80, this.rowGroupHeaderLayer.getWidth()); + assertEquals(3, this.rowGroupHeaderLayer.getColumnCount()); + + // hide columns in Address group + this.gridLayer.doCommand(new MultiRowHideCommand(this.gridLayer, 5, 6, 7, 8)); + + // this hides Test group in level 1, so height is reduced by one line + assertTrue(this.rowGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(0, addressGroup.getVisibleSpan()); + assertEquals(0, testGroup.getVisibleSpan()); + assertEquals(60, this.rowGroupHeaderLayer.getWidth()); + assertEquals(3, this.rowGroupHeaderLayer.getColumnCount()); + + // hide columns in Person group + this.gridLayer.doCommand(new MultiRowHideCommand(this.gridLayer, 1, 2, 3, 4)); + + assertFalse(this.rowGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(0, nameGroup.getVisibleSpan()); + assertEquals(0, addressGroup.getVisibleSpan()); + assertEquals(0, testGroup.getVisibleSpan()); + assertEquals(40, this.rowGroupHeaderLayer.getWidth()); + assertEquals(3, this.rowGroupHeaderLayer.getColumnCount()); + + // show all columns again + this.gridLayer.doCommand(new ShowAllRowsCommand()); + + assertTrue(this.rowGroupHeaderLayer.getGroupModel().isVisible()); + assertEquals(4, nameGroup.getVisibleSpan()); + assertEquals(4, addressGroup.getVisibleSpan()); + assertEquals(4, testGroup.getVisibleSpan()); + assertEquals(80, this.rowGroupHeaderLayer.getWidth()); + assertEquals(3, this.rowGroupHeaderLayer.getColumnCount()); + } + } diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayer.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayer.java index 80aa74e77..7d663ddb5 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayer.java +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Dirk Fauth. + * Copyright (c) 2019, 2025 Dirk Fauth. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -730,7 +730,7 @@ private int getGroupingHeight() { int height = 0; for (int i = 0; i < this.model.size(); i++) { GroupModel groupModel = this.model.get(i); - if (!groupModel.isEmpty()) { + if (groupModel.isVisible()) { height += this.rowHeightConfig.getSize(getRowPositionForLevel(i)); } } @@ -755,7 +755,7 @@ public int getRowHeightByPosition(int rowPosition) { return this.rowHeightConfig.getSize(rowPosition); } else { int level = getLevelForRowPosition(rowPosition); - return getGroupModel(level).isEmpty() ? 0 : this.rowHeightConfig.getSize(rowPosition); + return !getGroupModel(level).isVisible() ? 0 : this.rowHeightConfig.getSize(rowPosition); } } else { return this.underlyingLayer.getRowHeightByPosition(rowPosition - rowCount); @@ -855,7 +855,7 @@ public int getStartYOfRowPosition(int rowPosition) { int startY = 0; for (int i = 0; i < rowPosition; i++) { GroupModel groupModel = this.model.get(i); - if (!groupModel.isEmpty()) { + if (groupModel.isVisible()) { startY += this.rowHeightConfig.getSize(getRowPositionForLevel(i)); } } diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/GroupModel.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/GroupModel.java index 5b1f3e5d8..da40f61ea 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/GroupModel.java +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/GroupModel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Dirk Fauth. + * Copyright (c) 2019, 2025 Dirk Fauth. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -756,6 +756,24 @@ public boolean isEmpty() { return this.groups.isEmpty(); } + /** + * + * @return true if there is at least one group with a visible + * span > 0, false if there are no groups configured or + * all groups have a visible span == 0. + * @since 2.6 + */ + public boolean isVisible() { + if (!isEmpty()) { + for (Group group : this.groups) { + if (group.getVisibleSpan() > 0) { + return true; + } + } + } + return false; + } + /** * Checks if the given position is configured to be static in one of the * groups. diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayer.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayer.java index 5065034fd..1ff54023b 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayer.java +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Dirk Fauth. + * Copyright (c) 2019, 2025 Dirk Fauth. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -723,7 +723,7 @@ private int getGroupingWidth() { int width = 0; for (int i = 0; i < this.model.size(); i++) { GroupModel groupModel = this.model.get(i); - if (!groupModel.isEmpty()) { + if (groupModel.isVisible()) { width += this.columnWidthConfig.getSize(getColumnPositionForLevel(i)); } } @@ -748,7 +748,7 @@ public int getColumnWidthByPosition(int columnPosition) { return this.columnWidthConfig.getSize(columnPosition); } else { int level = getLevelForColumnPosition(columnPosition); - return getGroupModel(level).isEmpty() ? 0 : this.columnWidthConfig.getSize(columnPosition); + return !getGroupModel(level).isVisible() ? 0 : this.columnWidthConfig.getSize(columnPosition); } } else { return this.underlyingLayer.getColumnWidthByPosition(columnPosition - columnCount); @@ -848,7 +848,7 @@ public int getStartXOfColumnPosition(int columnPosition) { int startX = 0; for (int i = 0; i < columnPosition; i++) { GroupModel groupModel = this.model.get(i); - if (!groupModel.isEmpty()) { + if (groupModel.isVisible()) { startX += this.columnWidthConfig.getSize(getColumnPositionForLevel(i)); } }