Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » ColumnOverrideLabelAccumulator - addLabel for entire row to set row border
ColumnOverrideLabelAccumulator - addLabel for entire row to set row border [message #1779169] Wed, 03 January 2018 12:34 Go to next message
Bartosz Szczypien is currently offline Bartosz SzczypienFriend
Messages: 7
Registered: January 2017
Junior Member
I want to achieve visual feedback that shows row border when at least one cell in the row is selected. I try to do it by using custom ColumnOverrideLabelAccumulator in function accumulateConfigLabels
but as LabelStack there represent one cell my question is how to get LabelStack of another cells in this row to add there custom label? Or maybe it can be achieved simplier?
Re: ColumnOverrideLabelAccumulator - addLabel for entire row to set row border [message #1779203 is a reply to message #1779169] Wed, 03 January 2018 18:58 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
The ColumnOverrideLabelAccumulator is a special implementation intended to apply labels to all cells in a column.

I would implement a custom IConfigLabelAccumulator that has a reference to the SelectionLayer. Then register it on the SelectionLayer and check for the row position if it is selected. The SelectionLayer should provide api for this.

Maybe our getting started tutorial helps. There is an example http://www.vogella.com/tutorials/NatTable/article.html

Also in our examples app there should be an example for this.
Re: ColumnOverrideLabelAccumulator - addLabel for entire row to set row border [message #1779324 is a reply to message #1779203] Fri, 05 January 2018 11:49 Go to previous message
Bartosz Szczypien is currently offline Bartosz SzczypienFriend
Messages: 7
Registered: January 2017
Junior Member
Ok done. For those who are looking for solution:
1. add custom ColumnOverrideLabelAccumulator with code like this:
@Override
	public void accumulateConfigLabels(LabelStack pConfigLabels, int pColumnPosition, int pRowPosition) {
		super.accumulateConfigLabels(pConfigLabels, pColumnPosition, pRowPosition);
		if(_table.getGridLayer().getBaseBodyLayer().getSelectionLayer().isRowPositionSelected(pRowPosition))
			pConfigLabels.addLabel("TEST");
	}


and add custom theme based on "TEST" - label something in Your custom implementation of AbstractRegistryConfiguration, like this:
Style lCellStyle = new Style();
lCellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, new Color(Display.getCurrent(), 100, 100, 100));
pConfigRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, lCellStyle, DisplayMode.NORMAL, "TEST");
Previous Topic:Reset to original order (PopupMenuBuilder)
Next Topic:Layer type to stack type mapping
Goto Forum:
  


Current Time: Wed Sep 19 18:14:34 GMT 2018

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

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

Back to the top