Skip to main content



      Home
Home » Eclipse Projects » NatTable » How to use CellPainterDecorator class
How to use CellPainterDecorator class [message #1798158] Tue, 13 November 2018 08:23 Go to next message
Eclipse UserFriend
Hi Friends,

How to set particular cell inside Image with Text with attached file in blue color round is my image.

Thank & Regards,
Lalit

Re: How to use CellPainterDecorator class [message #1798159 is a reply to message #1798158] Tue, 13 November 2018 08:34 Go to previous messageGo to next message
Eclipse UserFriend
I hope I understand your question correctly. You want to show an image inside a cell, not a cell inside an image, right?

Please have a look at the CellPainterDecorator_Example that should include several examples how this can be done.
Re: How to use CellPainterDecorator class [message #1798192 is a reply to message #1798159] Tue, 13 November 2018 22:31 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Dirk for your help.
Re: How to use CellPainterDecorator class [message #1798194 is a reply to message #1798192] Tue, 13 November 2018 22:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dirk,

My requirement like not show image in calumn all cell but base on my condition only particulate cell inside show images.

Please help me dirk.
Re: How to use CellPainterDecorator class [message #1798196 is a reply to message #1798194] Wed, 14 November 2018 01:12 Go to previous messageGo to next message
Eclipse UserFriend
You do this the same way you do it in general in NatTable. Use labels per condition and register painters per label. If the images are quite static, that is the simplest way to do. If the images are dynamic based on some condition, you could also register a customized ImagePainter that identifies the image to render based on your dynamic condition or a label. We use this in NatTable internally for example in the SortIconImagePainter.
Re: How to use CellPainterDecorator class [message #1798293 is a reply to message #1798196] Wed, 14 November 2018 23:01 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for your replay Dirk.
Re: How to use CellPainterDecorator class [message #1798505 is a reply to message #1798158] Mon, 19 November 2018 23:05 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dirk,

Thanks it is working but some other issue coming when I try to column sort but image not sort with text so please help me how to fix it.
Re: How to use CellPainterDecorator class [message #1798520 is a reply to message #1798505] Tue, 20 November 2018 01:28 Go to previous messageGo to next message
Eclipse UserFriend
You need to get better in asking for help. How should anybody help you without seeing the code and even without explaining what is not working. With one vague sentence nobody can ever help you with your problems!
Re: How to use CellPainterDecorator class [message #1798538 is a reply to message #1798520] Tue, 20 November 2018 04:33 Go to previous messageGo to next message
Eclipse UserFriend
Hello Dirk,

Previously show image with text and then click to sort on column header but that time not show correct result now i have added attachment files and code.

columnxyz.setCellPainter(new CellPainterDecorator(new TextPainter(), CellEdgeEnum.LEFT, 9, new ImagePainter() {

            @Override
            protected Image getImage(ILayerCell cell, IConfigRegistry configRegistry) {

                return imagepath;

            }

        }));


Please help me.
Re: How to use CellPainterDecorator class [message #1798542 is a reply to message #1798538] Tue, 20 November 2018 05:11 Go to previous message
Eclipse UserFriend
It seems you are missing some basic concepts in NatTable. Styling is done via labels and the ConfigRegistry. The method setCellPainter() you are showing is not a NatTable method, and IMHO it is wrong to have such a method and violates our concepts.

Please read some of our spare documentations to deal with your problem. I am not able to help here.

https://www.eclipse.org/nattable/documentation.php?page=styling
http://www.vogella.com/tutorials/NatTable/article.html#architecture_labels
Previous Topic:How to configure the borderline of ColumnGroups
Next Topic:how to add a new row in the filter list, if rows are already filttered.
Goto Forum:
  


Current Time: Wed May 14 11:44:26 EDT 2025

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

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

Back to the top