Yes, that is exactly what I was thinking. You can register a mouse button 
listener on the header and call getHeaderAt() to determine which header was 
pressed. Then you can call getHeaderBounds() to get that header's bounding 
area. Finally, you can call mapPointToAncestor() on the TableViewHeader to 
convert the header bounds to display coordinates for displaying the context 
menu (you can call getDisplay() on the header to get the display).

Let me know how it goes.
 
On Jan 5, 2011, at 3:26 PM, anton dos santos wrote:

> Yes you are right :)
> To do this I think I need a context menu as described here: 
> http://pivot.apache.org/tutorials/context-menus.html
> 
> Regards
> Anton
> On 05/01/2011 21:06, Greg Brown wrote:
>> Well, a ListButton displays a popup, so I think we are probably describing 
>> the same thing.  :-)  I have written a similar UI where right-clicking on 
>> the table header makes a menu popup appear immediately below the header. The 
>> user can then select one of the values from the menu to filter the table 
>> contents.
>> G
>> 
>> On Jan 5, 2011, at 3:00 PM, anton dos santos wrote:
>> 
>>> not exactly
>>> I want to implement a filter feature: when in a column there are multiple 
>>> distinct values then a ListButton with these distinct values is displayed 
>>> in the header and when user select one of the values, only the 
>>> corresponding rows will be displayed in the table.
>>> I am not sure a popup is user friendly in this case
>>> 
>>> Regards
>>> Anton
>>> 
>>> On 05/01/2011 20:34, Greg Brown wrote:
>>>> You are correct - renderers do not support user interaction because they 
>>>> aren't really there - they are just painted by the skin.
>>>> 
>>>> Are you trying to display a popup when the user clicks on the table 
>>>> header? If so, there are other ways to do this. I can try to put together 
>>>> a quick example if it would help.
>>>> 
>>>> G
>>>> 
>>>> On Jan 5, 2011, at 2:30 PM, anton dos santos wrote:
>>>> 
>>>>> Hi
>>>>> I  have a  TableViewHeader that displays a ListButton, but the ListButon 
>>>>> is not usable.
>>>>> I assume it is because the header is drawn by a "renderer" and not an 
>>>>> "editor". Right?
>>>>> 
>>>>> Is it possible to have a working button or checkbox in a column's header ?
>>>>> 
>>>>> Regards
>>>>> Anton
>>>> 
>> 
>> 
> 

Reply via email to