AbstractMultiGridPresenter extends AbstractScreenListPresenter<T> { public ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter) { String labelValue = columnFilter.toString(); if (columnFilter instanceof CoreFunctionFilter) { labelValue = ((CoreFunctionFilter) columnFilter).getLabelValue(); if (labelValue == null || labelValue.isEmpty()) { labelValue = columnFilter.toString(); } } return new ActiveFilterItem<>(columnFilter.getColumnId(), labelValue, null, null, v -> removeActiveFilter(columnFilter)); }  @Inject void setErrorHandlerBuilder(final ManagedInstance<ErrorHandlerBuilder> errorHandlerBuilder); @Inject void setAuthorizationManager(final AuthorizationManager authorizationManager); @Inject void setDataSetQueryHelper(final DataSetQueryHelper dataSetQueryHelper); @Inject void setClearAllActiveFiltersEvent(Event<ClearAllActiveFiltersEvent> clearAllActiveFiltersEvent); void setFilterSettingsManager(final FilterSettingsManager filterSettingsManager); DataSetQueryHelper getDataSetQueryHelper(); @WorkbenchPartView UberView<T> getView(); @Inject void setView(V view); abstract void setupActiveSearchFilters(); abstract boolean existActiveSearchFilters(); @PostConstruct void init(); @Override @OnOpen void onOpen(); Predicate<String> getFilterEventPredicate(); void onBasicFilterAddEvent(@Observes final BasicFilterAddEvent event); void onBasicFilterRemoveEvent(@Observes final BasicFilterRemoveEvent event); ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter); @Override void getData(final Range visibleRange); void saveSearchFilterSettings(final String filterName,
                                         final Consumer<String> callback); boolean isUserAuthorizedForPerspective(final String perspectiveId); void openErrorView(final String parameterId); Predicate<T> getViewErrorsActionCondition();  }
@Test public void testActiveFiltersLabel() { ColumnFilter testColumnFilter = equalsTo("test_columnId", 1); ((CoreFunctionFilter) testColumnFilter).setLabelValue("test_lable"); ActiveFilterItem activeFilterItemOne = presenter.getActiveFilterFromColumnFilter(testColumnFilter); assertEquals(((CoreFunctionFilter) testColumnFilter).getLabelValue(), activeFilterItemOne.getLabelValue()); LogicalExprFilter logicalExprFilter = new LogicalExprFilter("test_columnId", LogicalExprType.OR, Arrays.asList(testColumnFilter)); ActiveFilterItem activeFilterItemTwo = presenter.getActiveFilterFromColumnFilter(logicalExprFilter); assertEquals(logicalExprFilter.toString(), activeFilterItemTwo.getLabelValue()); ColumnFilter testColumnFilterEmpty = equalsTo("test_columnId", 1); ((CoreFunctionFilter) testColumnFilterEmpty).setLabelValue(""); ActiveFilterItem activeFilterItemThree = presenter.getActiveFilterFromColumnFilter(testColumnFilterEmpty); assertEquals(testColumnFilterEmpty.toString(), activeFilterItemThree.getLabelValue()); }