Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » NatTable does not fit to empty space
icon5.gif  NatTable does not fit to empty space [message #986356] Tue, 20 November 2012 08:46 Go to next message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
Hi,

I am trying to use NatTable inside an RCP application in an editor. This works fine so far, but NatTable does not take the empty space or renders empty rows to fit the free space.

Is there an easy way to tell NatTable to render additional columns or expand the existing columns automatically to to fit free space?

With the normal SWT Table this is not a problem...

Regards,
Björn
Re: NatTable does not fit to empty space [message #986364 is a reply to message #986356] Tue, 20 November 2012 09:06 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi Björn,

there are currently two options for this:

1. Use the NatGridLayerPainter which paints the grid lines in the remaining space. Unfortunately the column header isn't painted this way and therefore it looks strange IMHO. You can use it like this
NatGridLayerPainter layerPainter = new NatGridLayerPainter(natTable);
natTable.setLayerPainter(layerPainter);


2. Use the percentage sizing feature of the NatTable. You can configure your DataLayer to use percentage sizing, so the column sizes will be calculated taking the available space into account. You can use it like this
dataLayer.setColumnPercentageSizing(true);
dataLayer.setColumnWidthByPosition(0, 40);
dataLayer.setColumnWidthByPosition(2, 40);


If you don't feel comfortable with these solutions, feel free to open a bug on this.

Greez,
Dirk
Re: NatTable does not fit to empty space [message #986876 is a reply to message #986364] Thu, 22 November 2012 08:42 Go to previous messageGo to next message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
Hi Dirk,

thanks for your reply.
Both solutions are not the best way solving the problem:
1. Rendering only the Grid looks like the Grid is missing data.

2. Setting percentage size per column, means you have to set a data layer depending on the data you want to display

I think it is not a bug, more a requested Feature. Smile

I will investigate some time and maybe post a quick fix soon.

Regards,
Björn
Re: NatTable does not fit to empty space [message #986884 is a reply to message #986876] Thu, 22 November 2012 09:14 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi Björn,

we really appreciate any help on such features. And of course you are right, it is not a bug, it's a feature. But as we are tracking every bug and enhancement in bugzilla now, it should be a bug entry there. You can categorize it as enhancement in the Importance section.

If you like, you can create a bug (enhancement) for this and contribute via patch. Smile This way it is tracked for the release notes correctly.

Greez,
Dirk
Previous Topic:Default Nattable, how to edit a cell
Next Topic:MouseOver, MouseOut listeners for Tablecells possible?
Goto Forum:
  


Current Time: Fri Apr 19 04:41:00 GMT 2024

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

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

Back to the top