Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » RowHeaderLayer and CompositeLayer
RowHeaderLayer and CompositeLayer [message #1016721] Thu, 07 March 2013 13:33 Go to next message
Alex Kipling is currently offline Alex KiplingFriend
Messages: 260
Registered: July 2012
Senior Member
I have a CompositeLayer with two, verticaly aligned layers.

[TOPLayer ]
[BOTTOMLayer]

On top of the CompositeLayer I am using a DefaultRowHeaderDataLayer, with a default
DefaultRowHeaderDataProvider - which just returns the rowNumber when it is asked to get the row label.

		final IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(this.bodyStack.dataProvider);
		final AbstractLayer rowHeaderLayer = new RowHeaderLayer(new DefaultRowHeaderDataLayer(rowHeaderDataProvider), bodyStack.underlyingLayer, bodyStack.selectionLayer);
	    


For the TOPlayer - DefaultRowHeaderDataProvider displays label 0,1,..., n
but for the BOTTOMlayer it SURPRISINGLY does not go on as n+1, n+2.. but starts from zero again.

Result, how the composed layer is displayed:
0 TOProw1
1 TOProw2
2 TOProw3
3 TOProw4
4 TOProw5
0 BOTTOM1
1 BOTTOM2
2 BOTTOM3
3 BOTTOM4
4 BOTTOM5


Question:
Why does the RowHeaderLayer starts by 0 at the bottom layer?

[Updated on: Thu, 07 March 2013 13:34]

Report message to a moderator

Re: RowHeaderLayer and CompositeLayer [message #1016748 is a reply to message #1016721] Thu, 07 March 2013 14:46 Go to previous message
Alex Kipling is currently offline Alex KiplingFriend
Messages: 260
Registered: July 2012
Senior Member
The CompositeLayer maps the rowPosition onto the ChildLayer's rowPosition by default, in mehtod:
CompositeLayer#getRowIndexByPosition()


The retrieved rowPosition is then used to trigger the DefaultRowHeaderDataProvider
Previous Topic:Auto resize column does not always work correctly
Next Topic:Move Row in nattable
Goto Forum:
  


Current Time: Fri Apr 19 20:33:49 GMT 2024

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

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

Back to the top