From ae50ac96fd791f1c808bf87198a34c21f47ffbc5 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 22 Jan 2024 10:30:52 +0100 Subject: [PATCH] Remove ``TextRenderer`` case as it behaves exactly the same as in the if above --- .../xdev/vaadin/grid_exporter/grid/GridDataExtractor.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/vaadin-grid-exporter/src/main/java/software/xdev/vaadin/grid_exporter/grid/GridDataExtractor.java b/vaadin-grid-exporter/src/main/java/software/xdev/vaadin/grid_exporter/grid/GridDataExtractor.java index ee2a925..8101be9 100644 --- a/vaadin-grid-exporter/src/main/java/software/xdev/vaadin/grid_exporter/grid/GridDataExtractor.java +++ b/vaadin-grid-exporter/src/main/java/software/xdev/vaadin/grid_exporter/grid/GridDataExtractor.java @@ -22,13 +22,11 @@ import java.util.Objects; import java.util.stream.Stream; -import com.vaadin.flow.component.ItemLabelGenerator; import com.vaadin.flow.component.grid.ColumnPathRenderer; import com.vaadin.flow.component.grid.Grid; import com.vaadin.flow.data.provider.Query; import com.vaadin.flow.data.renderer.BasicRenderer; import com.vaadin.flow.data.renderer.Renderer; -import com.vaadin.flow.data.renderer.TextRenderer; import com.vaadin.flow.function.ValueProvider; import software.xdev.vaadin.grid_exporter.column.ColumnConfiguration; @@ -74,12 +72,6 @@ protected String getFormattedValue(final Grid.Column column, final T item) return (String)getValueFormatter.invoke(renderer, value); } } - else if(renderer instanceof TextRenderer) - { - final Field itemLabelGenerator = TextRenderer.class.getDeclaredField("itemLabelGenerator"); - itemLabelGenerator.setAccessible(true); - return ((ItemLabelGenerator)itemLabelGenerator.get(renderer)).apply(item); - } else if(renderer instanceof ColumnPathRenderer) { final Field provider = ColumnPathRenderer.class.getDeclaredField("provider");