On 08-Oct-08, at 8:25 PM, Bob Mattei wrote:

> When entering data into a text field I sometimes need to send a  
> notify event to indicate the enter key has been pressed:
>     text.typeText(message);
>     text.notifyKeyboardEvent(SWT.KeyDown, (char) 0, SWT.CR);
>
> Is there another way to do this and if not how do I do it for a  
> combobox?

No there's no other way around it. There's a fundamental problem with  
providing too much of convenience API that most users would not need  
it, but the developers need to maintain it. Someone may ask for say  
TAB and SHIFT+TAB or ESC, for e.g.

The approach SWTBot has taken so far is to provide enough support and  
infrastructure in the basic version for users to be able to do the  
additional stuff.

In you case I would recommend a utility class that'd take in an  
AbstractSWTBotWidget do this:

public static void carriageReturn(AbstractSWTBot widget){
   w.notifyKeyboardEvent(SWT.KeyDown, 0, SWT.CR);
}

-- Ketan



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
SWTBot-users mailing list
SWTBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

Reply via email to