Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » How to change the font?
How to change the font? [message #989549] Thu, 06 December 2012 12:07 Go to next message
Clemens Bartz is currently offline Clemens Bartz
Messages: 5
Registered: December 2012
Junior Member
Hi,

this might be a bug: when I call natTable.setFont(aFont) it does not change anything in the NatTable itself. I would expect NatTable to a least throw an error if this behavior was not supported.
Is there a way to change the font in general and specifically for each layer?

Kind regards,
Clemens
Re: How to change the font? [message #989645 is a reply to message #989549] Fri, 07 December 2012 02:57 Go to previous message
Dirk Fauth is currently online Dirk Fauth
Messages: 1066
Registered: July 2012
Senior Member
Hi Clemens,

no this is not a bug. Styling in NatTable is done differently. As you are completely free to choose the font to use for every cell if you like to. It doesn't make sense to set the font on NatTable itself, which becomes clear after you understand how styling in NatTable works.

Quote:
Is there a way to change the font in general and specifically for each layer?


Yes, this is one of the features of the NatTable. And this is also the cause why setFont() doesn't work. To get familiar with this, feel free to read the documentation http://eclipse.org/nattable/documentation.php?page=styling
In the documentation section you will also find links to articles (only German) that describe it in a slightly different way.

Quote:
I would expect NatTable to a least throw an error if this behavior was not supported.


Well that's worth a discussion. And I personally disagree with that statement. Of course we could check every public API that finds its way to the NatTable because of subclassing. NatTable is a Canvas, which is a Composite, which is a Scrollable ... and so on. We would have some hard time determining which public API is working and which needs to be overwritten by simply throwing an UnsupportedOperationException or something like that. IMHO this is too much work for to little benefit as it only affects developers that are not familiar with the NatTable architecture yet. But as I said before, that's worth a discussion.

Greez,
Dirk
Previous Topic:Display value different than data value in editing cells
Next Topic:Weird issue with FilterRow and Scrollbars
Goto Forum:
  


Current Time: Thu Apr 17 11:27:49 EDT 2014

Powered by FUDForum. Page generated in 0.01471 seconds