Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:50 Go to next message
Andy N is currently offline Andy NFriend
Messages: 3
Registered: August 2010
Junior Member
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 14:20]

Report message to a moderator

Re: MultiPageEditor with Tabs(GEF Editor) and SWTBot [message #554451 is a reply to message #554314] Mon, 23 August 2010 08:39 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
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 09:10 Go to previous message
Andy N is currently offline Andy NFriend
Messages: 3
Registered: August 2010
Junior Member
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: Mon Dec 22 05:51:13 GMT 2014

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

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