Skip to content

Commit

Permalink
Remove TextRenderer case as it behaves exactly the same as in the…
Browse files Browse the repository at this point in the history
… if above
  • Loading branch information
AB-xdev committed Jan 22, 2024
1 parent 8aa398d commit ae50ac9
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -74,12 +72,6 @@ protected String getFormattedValue(final Grid.Column<T> 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<T>)itemLabelGenerator.get(renderer)).apply(item);
}
else if(renderer instanceof ColumnPathRenderer)
{
final Field provider = ColumnPathRenderer.class.getDeclaredField("provider");
Expand Down

0 comments on commit ae50ac9

Please sign in to comment.