Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Howto render row as header.
Howto render row as header. [message #1015170] Wed, 27 February 2013 16:12
Alex Kipling is currently offline Alex Kipling
Messages: 257
Registered: July 2012
Senior Member
I am trying to render a row as a header.
I am doing it manually, since I do not have any SelectionLayer to create a RowHeaderLayer.

I came up with the following code, but the row is still not rendered as a header - the Data in DefaultRowHeaderLayerConfiguration are not used.

Do I miss something?

		
DataLayer headerLayer = new DataLayer(emptyOneCellHeaderDataProvider, 50, 20);

//just adding the 	Configuration does not work. Try overriding and using labels: add GridRegion.ROW_HEADER
ColumnLabelAccumulator overrideLabelAccumulator = new ColumnLabelAccumulator(){
	@Override
	public void accumulateConfigLabels(LabelStack configLabels,
			int columnPosition, int rowPosition) {
		super.accumulateConfigLabels(configLabels, columnPosition, rowPosition);
		configLabels.addLabel(GridRegion.ROW_HEADER); //add GridRegion.ROW_HEADER, so that DefaultRowHeaderLayerConfiguration starts to work
	}
};
headerLayer.setConfigLabelAccumulator(overrideLabelAccumulator);

//reuse the default configurations. This makes the row header look like a header.
DefaultRowHeaderLayerConfiguration configuration = new DefaultRowHeaderLayerConfiguration();

//add to layer
headerLayer.addConfiguration(configuration);

[Updated on: Wed, 27 February 2013 16:13]

Report message to a moderator

Previous Topic:KeyEvents not getting registered on WizardDialog
Next Topic:Release 1.0 date
Goto Forum:
  


Current Time: Sat Oct 25 16:14:37 GMT 2014

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

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