Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » CTab Item double click
CTab Item double click [message #540720] Thu, 17 June 2010 07:54 Go to next message
Marko Tomljenovic is currently offline Marko Tomljenovic
Messages: 62
Registered: July 2009
Member
Hello all,
I need to double click on a CTabItem. SWTBot does not support this feature. But I could work around if I could double click on a certain x,y location.

Is this possible with SWTBot? I could not find it in the Bot classes.

Thank you in advance

Greets Marko
Re: CTab Item double click [message #540759 is a reply to message #540720] Thu, 17 June 2010 09:37 Go to previous messageGo to next message
ashitha shetty is currently offline ashitha shetty
Messages: 17
Registered: March 2010
Junior Member
Hi Marko,

In case you need to just activate the CTab item, you could look at this thread: http:// www.eclipse.org/forums/index.php?t=msg&th=170069&sta rt=0&
Re: CTab Item double click [message #540777 is a reply to message #540720] Thu, 17 June 2010 11:10 Go to previous messageGo to next message
Marko Tomljenovic is currently offline Marko Tomljenovic
Messages: 62
Registered: July 2009
Member
Hi ashitha,
activating it is not the problem.

I need to double click on the tab since this is used as a sort of activation action.

Thank you anyway.

Greets Marko
Re: CTab Item double click [message #541944 is a reply to message #540720] Wed, 23 June 2010 10:32 Go to previous message
Marko Tomljenovic is currently offline Marko Tomljenovic
Messages: 62
Registered: July 2009
Member
Hi,
I found a solution using the AWT Robot:

    final Point[] p = new Point[1];
    PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {

      @Override
      public void run() {
        Object o = bot.cTabItem("Dummy").widget.getControl().toDisplay(5, -10);
        p[0] = (Point) o;
      }
    });
    Robot r = new Robot();
    r.mouseMove(p[0].x, p[0].y);
    r.mousePress(InputEvent.BUTTON1_MASK);
    r.mouseRelease(InputEvent.BUTTON1_MASK);
    r.mousePress(InputEvent.BUTTON1_MASK);
    r.mouseRelease(InputEvent.BUTTON1_MASK);
Previous Topic:Simulate the enter key
Next Topic:Detect exceptions throws during test
Goto Forum:
  


Current Time: Thu Sep 18 05:46:40 GMT 2014

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

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