How to change the font? [message #989549] |
Thu, 06 December 2012 12:07  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03690 seconds