Skip to main content



      Home
Home » Eclipse Projects » NatTable » Printing is incorrect when setting vertical painting style in Column Headers
Printing is incorrect when setting vertical painting style in Column Headers [message #1712230] Thu, 22 October 2015 05:37 Go to next message
Eclipse UserFriend
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?

Re: Printing is incorrect when setting vertical painting style in Column Headers [message #1712244 is a reply to message #1712230] Thu, 22 October 2015 06:56 Go to previous messageGo to next message
Eclipse UserFriend
I assume "output is very weird" means, the printed result is really small. At least that is my observation.

I'm not sure what is causing this. Maybe the automatic height calculation causes that mess. You might want to try use a fixed height to validate if that causes the issue.

Please file a ticket for that issue so we can have a look at it sometime.
Re: Printing is incorrect when setting vertical painting style in Column Headers [message #1712251 is a reply to message #1712244] Thu, 22 October 2015 07:36 Go to previous messageGo to next message
Eclipse UserFriend
Filed a bug at https://bugs.eclipse.org/bugs/show_bug.cgi?id=480408

Also, fixed height solution did not work. When can I expect any quickfix/workaround ?
Re: Printing is incorrect when setting vertical painting style in Column Headers [message #1712252 is a reply to message #1712251] Thu, 22 October 2015 07:40 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
When can I expect any quickfix/workaround ?


I don't know

Re: Printing is incorrect when setting vertical painting style in Column Headers [message #1712253 is a reply to message #1712252] Thu, 22 October 2015 07:50 Go to previous messageGo to next message
Eclipse UserFriend
One more thing: the BackgroundImagePainter registered in a headercolumn is also not visible in printed output when vertical painters are registered in some columns.
We need printing to work for a project. Its very urgent.
Re: Printing is incorrect when setting vertical painting style in Column Headers [message #1712260 is a reply to message #1712253] Thu, 22 October 2015 09:16 Go to previous message
Eclipse UserFriend
Quote:
We need printing to work for a project. Its very urgent.


The code to look at is org.eclipse.nebula.widgets.nattable.print.LayerPrinter - https://github.com/eclipse/nebula.widgets.nattable/blob/master/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/print/LayerPrinter.java

As we are a open source project, feel free to fix the issue and contribute back to the project.
Previous Topic:Refresh NatTable
Next Topic:Nattable
Goto Forum:
  


Current Time: Tue Jun 24 10:22:18 EDT 2025

Powered by FUDForum. Page generated in 0.22369 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top