Skip to main content


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 17:07 Go to next message
Clemens Bartz is currently offline Clemens BartzFriend
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 07:57 Go to previous message
Dirk Fauth is currently online Dirk FauthFriend
Messages: 2902
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:NatTable is not refreshed correctly
Next Topic:not able to combine Text Painter and TreeCheckBoxPainter in a cell which spans multiple rows
Goto Forum:
  


Current Time: Thu Mar 28 18:02:33 GMT 2024

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

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

Back to the top