Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Run SWTBot as plugin
Run SWTBot as plugin [message #879192] Wed, 30 May 2012 17:53 Go to next message
Akres Willer is currently offline Akres WillerFriend
Messages: 2
Registered: May 2012
Junior Member
Hi guys,

I'm quite new to SWTBot, I started using it about a week ago. However, I have quite a specific task and I can't seem to find anything about it anywhere.

The thing is: I need to write a plugin to eclipse ( It's somewhat customized version, but SWTBot works more or less ), that would execute SWTBot code.

For example: I need to write a plugin which you can run from the menu and which creates many projects automatically.
The problem I'm running into is synchronization. When I create a project, I need to wait for some jobs to finish ( creating project and creating one of the customized parts of project ), which are quite time consuming ( they take about 10 seconds, but sometimes they take 20 and sometimes just 5 ).
Now.. I figured out how to wait for a job to finish, but it blocks the UI and makes the whole IDE even slower.

So the question is: How do you properly run a SWTBot code ( I do not use a test case ) as a plugin which doesn't block the UI? I tried running the whole code in separate thread but then I had to put join() method in the execute() method of the plugin handler so I was screwed anyway.
I'm quite desperate about this as I'm really out of ideas.
Re: Run SWTBot as plugin [message #879934 is a reply to message #879192] Fri, 01 June 2012 06:44 Go to previous message
Akres Willer is currently offline Akres WillerFriend
Messages: 2
Registered: May 2012
Junior Member
Never mind guys, figured it out.

If anyone ran into the same problem: The trick is you need to run the whole SWTBot code in a new thread and if you need to interract with the UI, you have to do so in a thread, that you execute with Display.getDefault().(a)syncExec( Runnable )
Previous Topic:SWTBotViewMenu's click is not working
Next Topic:test JVM exiting unexpectedly
Goto Forum:
  


Current Time: Thu Mar 28 11:39:48 GMT 2024

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

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

Back to the top