Bug PaddingDecorator? [message #1042558] |
Tue, 16 April 2013 11:17  |
Eclipse User |
|
|
|
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);
}
};
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08212 seconds