Hi Dirk,

You are correct - Pivot's table rendering model is very similar to Swing's and 
does not allow you to actually embed other components within a TableView. 

However, I had a similar requirement in a recent app - my solution was to put a 
row of push buttons in a popup window that I show and hide depending on the 
mouse position over the table view. I use getRowAt() and getColumnAt() to 
determine what cell the mouse is currently over. 

You could also have your renderer paint a "hover" state if you find that the 
mouse moves over (or out of) one of your link button cells. You could do 
something similar in mouseDown() or mouseClick() to trigger the click action.

Sorry there isn't an easier way. Hope this helps.

Greg

On Apr 9, 2010, at 6:06 AM, Dirk Möbius wrote:

> In my applications it is a _very frequent_ requirement to display detail info 
> when the user clicks a certain table cell. Somewhat like master/detail, but 
> the details shouldn't show up if the whole table _row_ is selected but a 
> particular _cell_. If the user clicks another cell, other details should be 
> shown. Also, the user should get some visual feedback that some of the cells 
> are "clickable", while others are not.
> 
> So I would preferably use a LinkButton for those kind of cells, but it seems 
> there's no easy way to display a LinkButton as a cell in a TableView. I can 
> write a custom CellRenderer that extends LinkButton and it displays 
> correctly, but there is no behaviour: the button doesn't "hover" on 
> mouse-over, and actions attached to it do not fire.
> 
> Apparently, Pivot is following the "rubber stamp" cell renderer approach of 
> Swing, which is good for performance, but makes it hard to embed real 
> components inside a TableView.
> 
> I already tried the common Swing trick to set the LinkButton as cell editor 
> and to enter edit mode automatically when the mouse enters the table (and to 
> cancel the edit when the mouse leaves the LinkButton). But this doesn't work 
> very well. Is there an easier way?
> 
> Thanks in advance.
> -- 
> Regards,
> Dirk Möbius
> 
> 

Reply via email to