Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » activate a tab in the properties view
activate a tab in the properties view [message #953641] Mon, 22 October 2012 12:11 Go to next message
Junior Lekane Nimpa is currently offline Junior Lekane NimpaFriend
Messages: 23
Registered: September 2012
Junior Member
Hello all,
i am quite new to SWTBot. I implemented custom properties sheet and i want to test them.
But i don't know how to click on a tab so that the properties sections get displayed.
Can someone tell me how to do that with SWTBot?
I use Eclipse 4.2 on Windows.

Many thanks
Junior
Re: activate a tab in the properties view [message #981293 is a reply to message #953641] Mon, 12 November 2012 10:04 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

I created some code that clicks on a properties tab with a given name. For this I copied some SWTBot code for clicking into this class http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.mlm.tests.core.ui/src/de/uni_mannheim/informatik/swt/mlm/tests/core/ui/SWTUtilsEx.java

and created a method which takes a String and clicks on the tab. You can find the method selectTabbedProperiesPage(final String name, final SWTBot bot) here: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.mlm.tests.core.ui/src/de/uni_mannheim/informatik/swt/mlm/tests/core/ui/GMFTestUtil.java

Hope this helps you!

Ralph
Re: activate a tab in the properties view [message #981302 is a reply to message #953641] Mon, 12 November 2012 10:07 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

On 10/22/2012 02:11 PM, Junior Lekane Nimpa wrote:
> Hello all,
> i am quite new to SWTBot. I implemented custom properties sheet and i
> want to test them.
> But i don't know how to click on a tab so that the properties sections
> get displayed.
> Can someone tell me how to do that with SWTBot?
> I use Eclipse 4.2 on Windows.

Do you mean you're using a MultiTab property view like this one:
http://wiki.eclipse.org/images/b/b1/Jwt_we_multitabproperties_addtab.gif
? If yes, this concept is not (yet) supported by SWTBot. You should open
a feature request for it and suggest a patch. As an
implementation/workaround, you should rely on underlying JFace code in a
UIThreadRunnable. See what BonitaSoft guys did as an example (beware,
it's GPL, so act accordingly)
http://www.bonitasoft.org/websvn/filedetails.php?repname=Bonita+Open+Solution&path=%2Fbonita-studio%2Ftags%2Fbonita-studio-5.8%2Ftests%2Forg.bonitasoft.studio.diagram.test%2Fsrc%2Forg%2Fbonitasoft%2Fstudio%2Fdiagram%2Ftest%2FSWTBotTestUtil.java

If your request is just about enabling an open View, then use bot.view
and then activate() or select() or enable() or setFocus() or any method
whose name seems to do what you expect ;)

HTH

--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: activate a tab in the properties view [message #981303 is a reply to message #981293] Mon, 12 November 2012 10:09 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

On 11/12/2012 11:04 AM, Ralph Gerbig wrote:
> Hi,
>
> I created some code that clicks on a properties tab with a given name.
> For this I copied some SWTBot code for clicking into this class
> http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.mlm.tests.core.ui/src/de/uni_mannheim/informatik/swt/mlm/tests/core/ui/SWTUtilsEx.java
>
>
> and created a method which takes a String and clicks on the tab. You can
> find the method selectTabbedProperiesPage(final String name, final
> SWTBot bot) here:
> http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.mlm.tests.core.ui/src/de/uni_mannheim/informatik/swt/mlm/tests/core/ui/GMFTestUtil.java
>
>
> Hope this helps you!
>
> Ralph

Hi Ralph,

If you could turn it into a SWTBot patch, I'd be glad to integrate it!
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Previous Topic:How to maximize the eclipse runtime using SWTBot?
Next Topic:SWTBot for RAD 8.0
Goto Forum:
  


Current Time: Wed Apr 24 23:22:37 GMT 2024

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

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

Back to the top