Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » CellPainter painting outside of NatTable?(How to create a fancy tooltip?)
CellPainter painting outside of NatTable? [message #1123456] Wed, 02 October 2013 11:31 Go to next message
Joachim Fuchs is currently offline Joachim Fuchs
Messages: 34
Registered: February 2013
Member
Hi there,

is it possible to force a cell's cell painter to paint on a component other than the NatTable itself? The goal is to have the cell's content drawn on an overlay shell which acts as a tooltip.

Any hints are appreciated. Thanks in advance

J
Re: CellPainter painting outside of NatTable? [message #1123579 is a reply to message #1123456] Wed, 02 October 2013 14:18 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1066
Registered: July 2012
Senior Member
You can use an IOverlayPainter to add painting on top of the NatTable.

For tooltip purposes, doesn't the NatTableContentTooltip fit your needs?
Re: CellPainter painting outside of NatTable? [message #1123628 is a reply to message #1123579] Wed, 02 October 2013 15:30 Go to previous messageGo to next message
Joachim Fuchs is currently offline Joachim Fuchs
Messages: 34
Registered: February 2013
Member
Hi Dirk, thanks for your quick response. Unfortunately both suggestions are limited to the NatTable client area but I am looking for a tooltip that comes into play when the table cell is not fully displayed like in an expanded tree, where the content would reach over the table's border.

The idea is to hover over that node and then have a little shell there reusing the cell's painter for cell rendering. So far I have the shell and the cellpainter but all what's happening so far is, that some backgroundpainter fills the shell with a light gray (this seems to work since I set the bg color of the shell to red before). But all the tree cell painters do not paint so far.

Do you have an idea where to look for a solution?

J

BTW: We observed a little issue with the NatTableContentTooltip: If the tooltip comes up in an empty area (only grid lines) and going away then, the gridlines are not redrawn immediately. The table looks a little ragged then.
Re: CellPainter painting outside of NatTable? [message #1123652 is a reply to message #1123628] Wed, 02 October 2013 15:56 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1066
Registered: July 2012
Senior Member
I guess they do not paint because of the rectangle that is set via client area.

I thought I implemented an IOverlayPainter that renders an arrow left of the table. But I would need to search for an example. Technically you could create a new shell in the IOverlayPainter that extends the client area of the NatTable. And to use the painter you need to check the bounds.

About the tooltip, well that's a rendering issue I guess. When the tooltip disappears there seems to be no rerendering triggered. Not sure why or if it is worth spending time in searching for this as the tooltip is afaik based on swt standards.
Re: CellPainter painting outside of NatTable? [message #1123768 is a reply to message #1123652] Wed, 02 October 2013 18:34 Go to previous message
Joachim Fuchs is currently offline Joachim Fuchs
Messages: 34
Registered: February 2013
Member
At last... It was all about the cellBounds that are passed to the cellpainter for drawing. They need to be modified to fit (x and y). There is still a way to go but the rest seems to be not too hard to do.

Thanks anyway.

J
Previous Topic:[SOLVED] CellEditor in a column header?
Next Topic:Row headers column vertical resize possibility
Goto Forum:
  


Current Time: Sun Apr 20 02:59:35 EDT 2014

Powered by FUDForum. Page generated in 0.01643 seconds