Skip to main content



      Home
Home » Eclipse Projects » SWTBot » MultiPageEditor with Tabs(GEF Editor) and SWTBot
MultiPageEditor with Tabs(GEF Editor) and SWTBot [message #554314] Sat, 21 August 2010 08:50 Go to next message
Eclipse UserFriend
Hello,
is it possible to get a SWTBotGefEditor from a MultipageEditor or how can I access the GEF Editor with SWTBot in a MultipageEditor? I tried and searched, but I found no solution. I have a Multipage Editor with several tab pages each of them contains a GEF GraphicalViewer. The current SVN Version(998) of SWTBot includes a SWTBotMultiPageEditor including some tests but I don`t know how to get the SWTBotGefEditor.

Any idea?
Thanks,
Andy

[Updated on: Sat, 21 August 2010 10:20] by Moderator

Re: MultiPageEditor with Tabs(GEF Editor) and SWTBot [message #554451 is a reply to message #554314] Mon, 23 August 2010 04:39 Go to previous messageGo to next message
Eclipse UserFriend
Hi Andy,

bot.gefEditor("label of your part") should works with a GEF multipage editor. However there is currently no method to switch between tab pages
and reinitialize the graphical viewer. You could try to extend SWTBotGefEditor and add a method which does the following :

public void activatePage {

/*copy paste the code to activate a page from SWTBotMultiPageEditor*/
...

/* the following code get the canvas, viewer, and edit domain from the new selected tab page */
graphicalViewer = (GraphicalViewer) editor.getAdapter(GraphicalViewer.class);
final Control control = graphicalViewer.getControl();
if (control instanceof FigureCanvas) {
canvas = new SWTBotGefFigureCanvas((FigureCanvas) control);
}
editDomain = graphicalViewer.getEditDomain();
}

Best regards,

Mariot


Andy N a écrit :
> Hello, is it possible to get a SWTBotGefEditor from a MultipageEditor or
> how can I access the GEF Editor with SWTBot in a MultipageEditor? I
> tried and searched, but I found no solution. I have a Multipage Editor
> with several tab pages each of them contains a GEF GraphicalViewer. The
> current SVN Version(998) of SWTBot includes a SWTBotMultiPageEditor
> including some tests but I don`t know how to get the SWTBotGefEditor.
>
> Andy idea? Thanks,
> Andy
Re: MultiPageEditor with Tabs(GEF Editor) and SWTBot [message #556189 is a reply to message #554451] Tue, 31 August 2010 05:10 Go to previous message
Eclipse UserFriend
Thank you for your answer, I have not been sure whether it works in general. Following your hint I found my mistake in the getAdapter method of my editorpart !

Regards, andy
Previous Topic:Tests not executing in specified order
Next Topic:Strategy to have SWTBot test cases working accross different windowing systems
Goto Forum:
  


Current Time: Thu Jul 10 08:42:25 EDT 2025

Powered by FUDForum. Page generated in 0.24166 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top