I want to implement text wrapping in heading titles.I also have group by layer added on top column header layer Text wrapping is not working in group by header region with below configuration.How to implement text wrapping in this scenario
// Column header layer
this.colGrpModel = new ColumnGroupModel();
this.colHeaderLayr =
new ColumnHeaderLayer(this.colHeaderDataLayr, this.bodyLayr, this.bodyLayr.getSelectionLayer());
this.colGrpHeaderLayer =
new ColumnGroupHeaderLayer(this.colHeaderLayr,
this.bodyLayr.getSelectionLayer(), this.colGrpModel, false);
this.colGrpHeaderLayer.setCalculateHeight(true);
// Composite layer
CompositeLayer compositeGridLayer = new CompositeLayer(1, 2);
//Group by header layer
this.groupByHeaderLayer = new GroupByHeaderLayer(groupByModel, this.paramFilterGridLayer,
this.filterGridLayer.getColumnHeaderDataProvider());
compositeGridLayer.setChildLayer(GroupByHeaderLayer.GROUP_BY_REGION, this.groupByHeaderLayer, 0, 0);
compositeGridLayer.setChildLayer("Grid", this.filterGridLayer, 0, 1);
This is the groupBy configuration:
configRegstry.registerConfigAttribute(
GroupByConfigAttributes.GROUP_BY_CHILD_COUNT_PATTERN, "[{0}] - ({1})");
configRegstry.registerConfigAttribute(
GroupByConfigAttributes.GROUP_BY_HINT, "Drag columns here");
// To implement text wrapping in group by header region
configRegstry.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER,
new TextPainter(true, true, 2),
DisplayMode.NORMAL,
GroupByHeaderLayer.GROUP_BY_REGION);
Short answer: This is currently not supported.
Long answer: You are misunderstanding several things.
GroupByHeaderis actually one cell that spans the whole width, the cell width will never exceed to force text wrapping.TextPainteris aICellPainter, so it is used to render cells.GroupByHeader(although a spanned cell) does not use the default cell painter. It uses the specialGroupByHeaderPainteras it needs to inspect theGroupByModeland render fragments for each entry. That painter does currently not support line wrapping. And it does not use otherICellPainterinternally.That means, if you need to support line wrapping in the
GroupByHeaderyou need to extend theGroupByHeaderPainter. As an open source project we like contributions. :)If you want to add some sort of text wrapping in the
GroupByHeader, you somehow need to specify when a text should be wrapped.