[SWTBotTest] How to retrieve/check exists of a context menu [message #1597141] |
Sun, 01 February 2015 23:56  |
Eclipse User |
|
|
|
Hello,
I wrote a test to check an context menu not available as expected.
I've found no api support it. What i can do is using try..catch(WidgetNotFoundException) which is not a good solution since it take time till timeout happen, increase test time execution.
Do we have better answer for the issue?
Thanks.
Thanh Huy LE
[Updated on: Mon, 02 February 2015 00:57] by Moderator
|
|
|
|
|
Re: [SWTBotTest] How to retrieve/check exists of a context menu [message #1610020 is a reply to message #1607974] |
Tue, 10 February 2015 08:51  |
Eclipse User |
|
|
|
Hello,
To access the Control using the SWTBotGetEditor, you need to recover the
EditPart of the Diagram and then its viewer. Therefore you should use
the following expression:
editor.getDiagramEditPart().getViewer().getControl().
Regards,
Steve
Le 09/02/2015 08:24, Huy Le a écrit :
> Thanks,
>
> However, SWTBotUtils.hasContextMenu() applied to TreeItem. The method
> requires two objects: Display and Control where we can retrieve them by
> call treeItem.display and treeItem.widget.getParent()
>
> How can we do same thing via SWTBotGefEditor when a node selected?
> As I know, editor.getWidget().getDisplay() return Display. What proper
> method return the Control?
>
> (I expect editor.getSWTBotGefViewer().getControl() but the method is
> protected)
>
> Thanh Huy LE
>
>
>
>
>
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03260 seconds