Skip to main content



      Home
Home » Archived » Jubula » Retrieve a word from a clipboard
Retrieve a word from a clipboard [message #1703364] Fri, 31 July 2015 02:22 Go to next message
Eclipse UserFriend
Hello everybody,

during my process, I need to retrieve a word from a text component and put it in a String variable.
I made this :

m_aut.execute(textfield.selectAll(), null);
Clipboard clpbrd= Toolkit.getDefaultToolkit().getSystemClipboard();

From this moment, how can I put the selected word in the clipboard ?
Like this : clpbrd.setContents(new StringSelection(textfield.selectAll().toString()), null); ?

And then, how can I retrieve the word from the clipboard and put it in a String variable ?


Thanks for your time.
Romain
Re: Retrieve a word from a clipboard [message #1703368 is a reply to message #1703364] Fri, 31 July 2015 03:25 Go to previous messageGo to next message
Eclipse UserFriend
I found a way to get the content from the clipboard. But I don't know how to put the selected word in the clipboard.
If you have any idea, let me know.

Best regards,
Romain.

[Updated on: Fri, 31 July 2015 07:00] by Moderator

Re: Retrieve a word from a clipboard [message #1703803 is a reply to message #1703368] Wed, 05 August 2015 02:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Romain,

I'm not a developer, but I think that you can just use the "normal" Java methods for this. A quick google gave me:
http://stackoverflow.com/questions/3591945/copying-to-clipboard-in-java
http://www.avajava.com/tutorials/lessons/how-do-i-copy-a-string-to-the-clipboard.html

The Jubula action for the ITE "copy to clipboard" isn't a part of the client API as far as I'm aware, since there are Java methods available for doing it which can be used when you're in the Java context of the client API.

Hope that helps.
Alex
Re: Retrieve a word from a clipboard [message #1703830 is a reply to message #1703803] Wed, 05 August 2015 05:04 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

Thanks for your answer. I already used these methods of the clipboard.

What I wanted, it was to give a String variable to the clipboard but not directly in Java, like I'm doing now. I guess it's a little difficult to represent but my method has two parts :
1 : click on component, selectAll (selected word) and copy in the clipboard
2 : get the content from the clipboard and put it in the String variable.
I already have the second part. I'm still working on the first part.

Thanks for your time.
Romain.
Re: Retrieve a word from a clipboard [message #1703972 is a reply to message #1703830] Thu, 06 August 2015 05:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi Romain,

is this question related to this one: https://www.eclipse.org/forums/index.php/t/1069060/?

Best regards,
Alex
Re: Retrieve a word from a clipboard [message #1703986 is a reply to message #1703972] Thu, 06 August 2015 08:00 Go to previous messageGo to next message
Eclipse UserFriend
Yes.
This question is global and I already have a part of the solution (second part). And the first part is related to the other topic. I think this topic can be considered as closed.

Best Regards,
Romain.
Re: Retrieve a word from a clipboard [message #1703989 is a reply to message #1703986] Thu, 06 August 2015 08:31 Go to previous message
Eclipse UserFriend
Thanks for the update!
Previous Topic:Some controls are not mappable in Jubula for javafx
Next Topic:Socket write error when launching a java swing aut
Goto Forum:
  


Current Time: Mon Jul 14 07:39:07 EDT 2025

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

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

Back to the top