Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Bug PaddingDecorator?
Bug PaddingDecorator? [message #1042558] Tue, 16 April 2013 15:17 Go to next message
Ralf Grossklaus is currently offline Ralf Grossklaus
Messages: 20
Registered: July 2009
Location: Stuttgart, Germany
Junior Member
Hi,

I'm using NatTable as a table which is able to display a TreeList. Therefore i used a configuration which is based on the tree example, with the difference, that i wrapped the TreeImagePainter within a PaddingDecorator with a left padding of 5px. The reason for this was, that i thought it would be nicer if the '+' of the tree is not painted directly at the left column border. With this setup i noticed, that clicking the '+' does not expand the tree anymore. Instead, i have to click where the '+' would have been without the padding. After debugging I found out that the PaddingDecorator does not override 'getWrappedPainterBounds()' and thus is not able to determine the clicked TreeImagePainter. I 'fixed' this in my implementation by overriding the method and calling 'getInteriorBounds()' and i was wondering if this is correct or it might have some unexpected side effects...

Regards, Ralf

                final PaddingDecorator paddingDecorator = new PaddingDecorator(indentedTreeImagePainter, 0, 0, 0, 5) {
                    @Override
                    public Rectangle getWrappedPainterBounds(ILayerCell cell, GC gc, Rectangle bounds, IConfigRegistry configRegistry) {
                        return getInteriorBounds(bounds);
                    }
                };
Re: Bug PaddingDecorator? [message #1043045 is a reply to message #1042558] Wed, 17 April 2013 07:44 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1339
Registered: July 2012
Senior Member
Hi,

although I'm not very happy when reading forum topics starting with "Bug", yes you found one. Smile

But your fix goes into the wrong direction and definitely might have side effects. The real issue is that getCellPainterAt() needs to be overriden in PaddingDecorator to take the configured padding into account.

I fixed this and pushed the fix to master.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=405851

So there should be soon an updated SNAPSHOT repository online for 1.0.0 containing that fix.

Thanks for reporting this issue.

Greez,
Dirk
Re: Bug PaddingDecorator? [message #1043073 is a reply to message #1043045] Wed, 17 April 2013 08:32 Go to previous messageGo to next message
Ralf Grossklaus is currently offline Ralf Grossklaus
Messages: 20
Registered: July 2009
Location: Stuttgart, Germany
Junior Member
Hi Dirk,

thanks a lot for the quick reply and for the even quicker fix!

Sorry about the topic headline. I wasn't quite sure if this was really a problem, or if there was something wrong in how i use the decorator (hence the question mark at the end). And since I'm pretty new as a NatTable user, i didn't want to file a bugzilla report for a issue that i was not completely sure about being a bug Smile

Ralf
Re: Bug PaddingDecorator? [message #1043081 is a reply to message #1043073] Wed, 17 April 2013 08:46 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1339
Registered: July 2012
Senior Member
Hi Ralf,

that's ok. In the end it was a bug. And yes it is better to first ask in the forum than just open a bug.

But IMHO headlines containing the B-word is frustrating for a developer. I know, it is just wording, but personally I like headlines more that look like "Issue with ..." as they sound more like, "something is not working as I expect, am I doing things wrong or is there a bug". Containing the B-word in the headline always sound like fingerpointing "You did something wrong!"

But that is just my personal opinion about wording in forum topic headlines. Smile

Nevermind, it is totally ok that you wrote to the forum and pointed to that issue. So please if you have any further issues, feel free to report them here. Smile

Greez,
Dirk
Previous Topic:Sending Events bottom up, over all layers?
Next Topic:Problem with cell selection
Goto Forum:
  


Current Time: Sat Oct 25 23:37:06 GMT 2014

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

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