Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » How to use CellPainterDecorator class
How to use CellPainterDecorator class [message #1798158] Tue, 13 November 2018 13:23 Go to next message
Lalit Solanki is currently offline Lalit SolankiFriend
Messages: 152
Registered: April 2015
Senior Member
Hi Friends,

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

Thank & Regards,
Lalit



Lalit
Re: How to use CellPainterDecorator class [message #1798159 is a reply to message #1798158] Tue, 13 November 2018 13:34 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2702
Registered: July 2012
Senior Member
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] Wed, 14 November 2018 03:31 Go to previous messageGo to next message
Lalit Solanki is currently offline Lalit SolankiFriend
Messages: 152
Registered: April 2015
Senior Member
Thanks Dirk for your help.

Lalit
Re: How to use CellPainterDecorator class [message #1798194 is a reply to message #1798192] Wed, 14 November 2018 03:42 Go to previous messageGo to next message
Lalit Solanki is currently offline Lalit SolankiFriend
Messages: 152
Registered: April 2015
Senior Member
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.


Lalit
Re: How to use CellPainterDecorator class [message #1798196 is a reply to message #1798194] Wed, 14 November 2018 06:12 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2702
Registered: July 2012
Senior Member
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] Thu, 15 November 2018 04:01 Go to previous messageGo to next message
Lalit Solanki is currently offline Lalit SolankiFriend
Messages: 152
Registered: April 2015
Senior Member
Thanks for your replay Dirk.

Lalit
Re: How to use CellPainterDecorator class [message #1798505 is a reply to message #1798158] Tue, 20 November 2018 04:05 Go to previous messageGo to next message
Lalit Solanki is currently offline Lalit SolankiFriend
Messages: 152
Registered: April 2015
Senior Member
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.


Lalit
Re: How to use CellPainterDecorator class [message #1798520 is a reply to message #1798505] Tue, 20 November 2018 06:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2702
Registered: July 2012
Senior Member
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 09:33 Go to previous messageGo to next message
Lalit Solanki is currently offline Lalit SolankiFriend
Messages: 152
Registered: April 2015
Senior Member
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.


Lalit
Re: How to use CellPainterDecorator class [message #1798542 is a reply to message #1798538] Tue, 20 November 2018 10:11 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2702
Registered: July 2012
Senior Member
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: Sun Aug 18 10:56:26 GMT 2019

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

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

Back to the top