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 08:11 Go to next message
Junior Lekane Nimpa is currently offline Junior Lekane Nimpa
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 05:04 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
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 05:07 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael Istria
Messages: 738
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 05:09 Go to previous message
Mickael Istria is currently offline Mickael Istria
Messages: 738
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: Sat Aug 02 00:44:46 EDT 2014

Powered by FUDForum. Page generated in 0.02576 seconds