Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Bug in assigning converters
Bug in assigning converters [message #1031935] Tue, 02 April 2013 11:37 Go to next message
Clemens Bartz is currently offline Clemens BartzFriend
Messages: 5
Registered: December 2012
Junior Member
Hello,

I am using NatTable version 0.9.0 and I want to use my own converter as shown in the documentation. There is, however a bug in the code.

For this reason, I have created a new converter:
public class NewBigDecimalConverter extends DefaultDisplayConverter {
	@Override
	public Object canonicalToDisplayValue(ILayerCell cell,
			IConfigRegistry configRegistry, Object canonicalValue) {
		return "Test";
	}
}


I am also adding the converter to every cell. There are no other converters in the application:
configRegistry.registerConfigAttribute(
	CellConfigAttributes.DISPLAY_CONVERTER, 
	new NewBigDecimalConverter(),
	"BODY"
	);


I have also checked the cells. They have the required labels (255255255 is another label):
Labels:
255255255
EVEN_BODY
BODY


However, my converter is not called. Every cell shows the original value (a big decimal number) and not my converted value. Any chance to debug this one even further?

Regards,
Clemens
Re: Bug in assigning converters [message #1031944 is a reply to message #1031935] Tue, 02 April 2013 11:50 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1434
Registered: July 2012
Senior Member
I don't think there is a bug. Otherwise everybody who uses NatTable wouldn't ever be able to use converters.

Usually this is caused because you either register your special configuration too late or not at all. Where and when do you add the configuration that registers your converter?
Re: Bug in assigning converters [message #1032103 is a reply to message #1031944] Tue, 02 April 2013 15:15 Go to previous messageGo to next message
Clemens Bartz is currently offline Clemens BartzFriend
Messages: 5
Registered: December 2012
Junior Member
You are completely right. The configuration took place after the table had been shown once. Since there was no refresh, the converter could not work.
I am very sorry for the hassle!
Re: Bug in assigning converters [message #1032109 is a reply to message #1032103] Tue, 02 April 2013 15:21 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1434
Registered: July 2012
Senior Member
Quote:
I am very sorry for the hassle!


No problem. Using NatTable is not as easy as we would like it to be. At least for now. Wink

You should just be careful using the word bug unless you are really sure that it is a bug. Such a nasty word causes developers to lose hair. Wink
Previous Topic:Row selection when right clicking row header
Next Topic:Using NatTable freezeSelectionCommand not working
Goto Forum:
  


Current Time: Tue Dec 23 00:08:13 GMT 2014

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

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