0

「ComboBoxFilterRowHeaderComposite」で nattable を実装しようとしています。

フィルタリングは正常に機能していますが、グループ化しようとすると行をフィルタリングした後、次の例外がスローされます

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.remove(ArrayList.java:492) at ca.odell.glazedlists.FunctionList.listChanged(FunctionList.java:283) at ca.odell.glazedlists.event.ListEventAssembler$ListEventFormat.fire(ListEventAssembler.java:424) at ca.odell.glazedlists.event.ListEventAssembler$ListEventFormat.fire(ListEventAssembler.java:421) at ca.odell.glazedlists.event.SequenceDependenciesEventPublisher$SubjectAndListener.firePendingEvent(SequenceDependenciesEventPublisher.java:445) at ca.odell.glazedlists.event.SequenceDependenciesEventPublisher.fireEvent(SequenceDependenciesEventPublisher.java:344) at ca.odell.glazedlists.event.ListEventAssembler.commitEvent(ListEventAssembler.java:317) at ca.odell.glazedlists.TransformedList.clear(TransformedList.java:98) at org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByDataLayer$1.run(GroupByDataLayer.java:286) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByDataLayer.updateTree(GroupByDataLayer.java:272) at org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByDataLayer.update(GroupByDataLayer.java:313) at java.util.Observable.notifyObservers(Observable.java:159) at java.util.Observable.notifyObservers(Observable.java:115) at org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByModel.update(GroupByModel.java:124) at org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByModel.addGroupByColumnIndex(GroupByModel.java:44)


ComboBoxFilterRowHeaderComposite の構造は次のとおりです。

filterRowHeaderLayer = new ComboBoxFilterRowHeaderComposite<T>( bodyLayerStack.getFilterList(), bodyLayerStack.getGlazedListsEventLayer(), bodyLayerStack.getSortedList(), columnAccessor, columnHeaderLayer, dataProvider, configRegistry);

どこ、

columnAccessor = new ReflectiveColumnPropertyAccessor(propertyNames);

columnGroupHeaderLayer = new DynamicColumnGroupHeaderLayer(sortHeaderLayerStack, bodyLayerStack.getSelectionLayer(), bodyLayerStack.getColumnGroupModel(), tr);

DataProvider は com.vanguard.tip.epm.platform.ui.grid.next.DynamicColumnHeaderDataProvider です。

その後

CornerLayerStack cornerLayerStack = new CornerLayerStack(rowHeaderLayerStack, filterRowHeaderLayer);

CompositeLayer gridLayer = new GridLayer(bodyLayerStack, filterRowHeaderLayer, rowHeaderLayerStack, cornerLayerStack);

次に、GroupByHeaderLayer に gridLayer を追加します。

groupByHeaderLayer = new GroupByHeaderLayer(bodyLayerStack.getGroupByModel(), gridLayer, columnHeaderLayerStack.getDataProvider(), new GroupByHeaderConfigurationWrapper(bodyLayerStack.getGroupByModel(), columnHeaderLayerStack.getDataProvider(), bodyLayerStack.getColumnGroupModel()));

CompositeLayer groupByComposite = new CompositeLayer(1, 2);

groupByComposite.setChildLayer(GroupByHeaderLayer.GROUP_BY_REGION, groupByHeaderLayer, 0, 0);

groupByComposite.setChildLayer("Grid", gridLayer, 0, 1);

これにより、私の Nattable の使用法が明確になることを願っています。

同じ構造のテキストベースフィルターを使用すると、グループ化は正常に機能します:

filterStrategy = new DefaultGlazedListsFilterStrategy<T>(bodyLayerStack.getFilterList(), columnAccessor, configRegistry);

this.filterRowHeaderLayer = new FilterRowHeaderComposite<T>(filterStrategy, columnHeaderLayer, dataProvider, configRegistry);

さらに情報が必要な場合はお知らせください。

4

1 に答える 1