Skip to main content


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 14:16 Go to next message
David CHAUDET is currently offline David CHAUDETFriend
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 09:06 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
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 19:56 Go to previous messageGo to next message
David CHAUDET is currently offline David CHAUDETFriend
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 09:08 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
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 21:29 Go to previous message
David CHAUDET is currently offline David CHAUDETFriend
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 Mar 28 15:59:09 GMT 2024

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

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

Back to the top