pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Möbius <dmoeb...@scoop-gmbh.de>
Subject Re: Displaying a button in a TableView
Date Mon, 12 Apr 2010 09:36:38 GMT
Hi Greg,

thanks for your answer.

> 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.

*sigh* and I thought I'd finally found a GUI toolkit that makes GUI  
creation easy. Why is thinlet.com the only toolkit that allows that?!?

> 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.

I didn't thought of a popup. I'll try that. Thanks for the hint.

> 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.

Meaning: repeat all of the behavior and paint logic that is already  
there in LinkButton. Not a good option IMHO.

Regards,
Dirk.


>
> 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
>>
>>
>
>



-- 
Dirk Möbius

SCOOP GmbH
Am Kielshof 29
D-51105 Köln
Fon   +49 221 801916-0
Fax   +49 221 801916-17
Mobil +49 170 7363035
www.scoop-gmbh.de
Sitz der Gesellschaft: Köln
Handelsregister: Köln
Handelsregisternummer: HRB 36623
Geschäftsführer:
Dr. Oleg Balovnev
Frank Heinen
Dr. Wolfgang Reddig
Roland Scheel



Mime
View raw message