Ketan Padegaonkar wrote:
> I've always been having thoughts about having a better api to access
> menus and trees. This is currently what most people do:
> bot.menu("file").menu("new").menu("other").click(); and similar stuff
> for trees as well.
>
> How about: bot.menu("file>new>other").click() instead ?
>
> This api would mean better and more concise API for most users. In
> case you have the character ">" as part of the menu/tree item's text,
> an override would be nice so you could do something like:
> bot.menu("file/new/other", '/').click() instead.
>
> This should be trivial to implement since it merely involves splitting
> the string and chaining the call in a loop, but may break things for
> some users, so I'm contemplating this only for 2.0.
>
> Feel free to drop in any ideas or suggestions that you may have around
> this API.
I you change to Java 5 for SWTBot 2.0, why not using Java 5 varargs? In
my project I created a utils method to select items in a tree:
public static SWTBotTreeItem select(final SWTEclipseBot bot, final
SWTBotTree tree, final String... path)
Then I could just call
SWTBotUtils.select(bot, tree, "Root", "One", "Two", "Three");
Regards,
Stefan
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse