Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot cannot copy/paste on tree items using keyboard shortcuts
SWTBot cannot copy/paste on tree items using keyboard shortcuts [message #1384853] Mon, 02 June 2014 10:16 Go to next message
David CHAUDET is currently offline David CHAUDET
Messages: 3
Registered: June 2014
Junior Member
Hi,

I want to copy/paste between two SWTBotTreeItem using CTRL+C/CTRL+V. Using copy/paste with the context menu works well, but I am required to use keyboard shortcuts too. The following code doesn't work: I can't copy the first node.

SWTBotTreeItem node1 = parentNode.getNode(name1);
SWTBotTreeItem node2 = parentNode.getNode(name2);
node1.select().pressShortcut(SWT.CTRL, 'C');
node2.select().pressShortcut(SWT.CTRL, 'V');

Even if I use 'copy' on node1 via the contextMenu, pressing CTRL+V on node2 does nothing.

I would like to understand what mistake I've done when using the pressShortcut.
Re: SWTBot cannot copy/paste on tree items using keyboard shortcuts [message #1384945 is a reply to message #1384853] Tue, 03 June 2014 05:06 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1305
Registered: July 2009
Senior Member
On 02/06/2014 16:38, David CHAUDET wrote:
> Hi,
>
> I want to copy/paste between two SWTBotTreeItem using CTRL+C/CTRL+V.
> Using copy/paste with the context menu works well, but I am required to
> use keyboard shortcuts too. The following code doesn't work: I can't
> copy the first node.
>
> SWTBotTreeItem node1 = parentNode.getNode(name1);
> SWTBotTreeItem node2 = parentNode.getNode(name2);
> node1.select().pressShortcut(SWT.CTRL, 'C');
> node2.select().pressShortcut(SWT.CTRL, 'V');
>
> Even if I use 'copy' on node1 via the contextMenu, pressing CTRL+V on
> node2 does nothing.
>
> I would like to understand what mistake I've done when using the
> pressShortcut.
>

Which operating system are you using? I have a few problems with
testing keyboard shortcuts in Linux KDE: to avoid these issues I run
swtbot tests on another display (see the wiki) and use metacity as the
window manager in the other display.

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: SWTBot cannot copy/paste on tree items using keyboard shortcuts [message #1385182 is a reply to message #1384945] Wed, 04 June 2014 15:56 Go to previous messageGo to next message
David CHAUDET is currently offline David CHAUDET
Messages: 3
Registered: June 2014
Junior Member
Thanks for your answer.

I'm in Windows XP.
I don't understand when you talking about the wiki.

David
Re: SWTBot cannot copy/paste on tree items using keyboard shortcuts [message #1385261 is a reply to message #1385182] Thu, 05 June 2014 05:08 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1305
Registered: July 2009
Senior Member
On 04/06/2014 21:56, David CHAUDET wrote:
> Thanks for your answer.
>
> I'm in Windows XP.
> I don't understand when you talking about the wiki.
>
> David

The wiki part I was referring deals with Linux I'm afraid :)

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: SWTBot cannot copy/paste on tree items using keyboard shortcuts [message #1386240 is a reply to message #1385261] Sun, 15 June 2014 17:29 Go to previous message
David CHAUDET is currently offline David CHAUDET
Messages: 3
Registered: June 2014
Junior Member
Shame...
Thank you anyway!
Previous Topic:SWTBot Headless/Commandline Execution Failed
Next Topic:How to test collaboration/concurrency between two RCP application instances ?
Goto Forum:
  


Current Time: Thu Jul 24 19:11:33 EDT 2014

Powered by FUDForum. Page generated in 0.02190 seconds