popups

Glen Schrader Glen.Schrader at Entero.com
Wed Mar 28 15:32:07 PDT 2012


FEST uses right click, i.e. in BasicRobot.showPopupMenu

    click(invoker, location, RIGHT_BUTTON, 1);

So I would vote to just use right click for now.

I was playing around with the source and hacked in what I think is right for setting the popup value in the MouseEvent.  We noticed a problem in CTCRobotPeer.mouseRelease where it was using the wrong values to set currentModifiers and also moved where it was setting that value to after the event was sent.

Attached is the patch file along with some tests.

Thanks,
Glen



-----Original Message-----
From: Roman Kennke [mailto:roman at kennke.org] 
Sent: March-28-12 2:25 PM
To: Glen Schrader
Cc: caciocavallo-dev at openjdk.java.net
Subject: Re: popups

Hi Glen,


> Hi I’m trying to utilize this project for running FEST tests headless 
> (great work btw!).

Good to hear! Glad you like it. We are about to make a release of Cacio (the first one!), and I'll be happy to fix that little issue before doing it.

>   I think I’m getting close however one thing that I’ve hit is an 
> issue with right click popups. I think the issue might be with the way 
> the MouseEvent is created in the EventData class:
> 
>  
> 
>             return new MouseEvent((Component) source, id, time, 
> modifiers,
> 
>                                   x, y, clickCount, false,
> 
>                                   getButton(modifierChange));
> 
>  
> 
> The false is for the popupTrigger parameter. I’m thinking this has to 
> be true when right clicking.  Am I correct or am I missing something?

This seems to be correct. There are desktop environments where the popup trigger is something else (like MacOS, CTRL+leftclick AFAIK), but right click seems right for most others. Several ways to handle it come to
mind:

- We could provide support for emulating different environments, depending on some setting (sysproperty?).
- We could declare that for the Cacio environment (heh) right-click is it :-)

I lean towards the latter solution, at least until somebody really needs more flexibility (e.g. when testing for MacOS environment).

What do you (and others) think?

Cheers,
Roman


-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnamed.patch
Type: application/octet-stream
Size: 14656 bytes
Desc: unnamed.patch
Url : http://mail.openjdk.java.net/pipermail/caciocavallo-dev/attachments/20120328/e1e67c0e/unnamed.patch 


More information about the caciocavallo-dev mailing list