Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Lazy cell Style(s), registered after input has been set(Can a Style pick up a color from the row value?)
Lazy cell Style(s), registered after input has been set [message #1547263] Mon, 05 January 2015 10:20 Go to next message
Georgian Grec is currently offline Georgian GrecFriend
Messages: 5
Registered: July 2014
Junior Member
I understand that the whole label accumulator mechanism is flexible enough. You register your styles at build time, and then you accumulate the labels at runtime.

What would be the correct approach if the colors come along with the input? Say that each row from my input carries a certain color, and those are the ones I'd like to display in my cells.


Hacky alternatives:

1. Walk the input before it is passed to the nattable. Register the config attributes based on row values. Accumulate desired labels afterwards.

2. Register config attributes in the label accumulator, while checking if a certain style has already been registered.
Re: Lazy cell Style(s), registered after input has been set [message #1547337 is a reply to message #1547263] Mon, 05 January 2015 11:17 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
You can also register styles at runtime via ConfigRegistry manually. But nevertheless, both values seem to fullfill your requirements. Not sure why you call them "hacky alternatives" since I don't know another way to create a connection between data model and presentation in an architecture that seperates them.
Re: Lazy cell Style(s), registered after input has been set [message #1547382 is a reply to message #1547337] Mon, 05 January 2015 11:46 Go to previous messageGo to next message
Georgian Grec is currently offline Georgian GrecFriend
Messages: 5
Registered: July 2014
Junior Member
My main concern is that the
accumulateLabels
gets A LOT of calls in short intervals of time (e.g. when a cell is simply clicked on). Isn't it heavy to constantly register these styles?
Re: Lazy cell Style(s), registered after input has been set [message #1547462 is a reply to message #1547382] Mon, 05 January 2015 12:48 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Technically the registering is putting a value into a map. Sure not a simple map, but a map. Try it out to see if it has an impact.

But again, since you are trying to keep style information in your data model, I don't know a better way.
Previous Topic:Autosizing row height for multiline text
Next Topic:Nebula NatTable - Getting Started Tutorial
Goto Forum:
  


Current Time: Mon Mar 01 13:47:30 GMT 2021

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

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

Back to the top