Printing is incorrect when setting vertical painting style in Column Headers [message #1712230] |
Thu, 22 October 2015 05:37  |
Eclipse User |
|
|
|
Hello,
I have a requirement to set some vertical painters on few column headers. And then I want to print this Nattable. The problem is, when I print this Nattable, the output is very wierd. If I remove these vertical painters, the printing works perfect.
To make sure if this was the case, I used the example from Nattable.
_801_VerticalCompositionWithFeaturesExample
I set the ConfigLabelAccumulator to the existing columnHeaderLayer like this:
IDataProvider columnHeaderDataProvider =
new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabelMap);
DataLayer columnHeaderDataLayer =
new DataLayer(columnHeaderDataProvider);
ILayer columnHeaderLayer =
new ColumnHeaderLayer(columnHeaderDataLayer, viewportLayer, selectionLayer);
// DataLayer headerDataLayer = (DataLayer) ((DimensionallyDependentLayer) columnHeaderLayer).getBaseLayer();
// create Header Accumulator
ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
columnHeaderDataLayer);
columnHeaderDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
// Set Vertical Header Columns
columnLabelAccumulator.registerColumnOverrides(3, "VERT");
columnLabelAccumulator.registerColumnOverrides(4, "VERT");
Then, in the Nattable configuration, I added this vertical configuration:
// Header Style Vertical
ICellPainter vertTextPainter = new LineBorderDecorator(new VerticalTextPainter(false,true,0,true));
Style cellStyleHeaderVertical = new Style();
cellStyleHeaderVertical.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, HorizontalAlignmentEnum.CENTER);
cellStyleHeaderVertical.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, VerticalAlignmentEnum.MIDDLE);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,cellStyleHeaderVertical,DisplayMode.NORMAL,"VERT");
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE,IEditableRule.NEVER_EDITABLE,DisplayMode.NORMAL,"VERT");
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,vertTextPainter,DisplayMode.NORMAL,"VERT");
Could you please check what is wrong with the printing? And how do I work around it?
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.22369 seconds