Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dash » Help with Monkey script (IllegalArgumentException calling Eclipse API method)
Help with Monkey script (IllegalArgumentException calling Eclipse API method) [message #2799] Thu, 08 November 2007 02:12 Go to next message
Phillip Rhodes is currently offline Phillip RhodesFriend
Messages: 12
Registered: July 2009
Junior Member
Hi all, I'm working on a simple Monkey script, the intent
of which is to generate a UUID and put it on the clipboard.
I have this so far, which at first blush looks like
it should work. But line 18 blows up with an IllegalArgumentExeption.

Any thoughts?

/*
* Menu: Gen > UUID
* Kudos: Whoever
* Key: CTRL+ALT+U
* License: EPL 1.0
*/

function main() {

clipboard = new
Packages.org.eclipse.swt.dnd.Clipboard(Packages.org.eclipse. swt.widgets.Display.getCurrent());

transfers = java.lang.reflect.Array.newInstance(
Packages.org.eclipse.swt.dnd.Transfer, 1);
transfers[0] = Packages.org.eclipse.swt.dnd.TextTransfer.getInstance();

data = java.lang.reflect.Array.newInstance(java.lang.Object, 1);
data[0] = java.util.UUID.randomUUID();

clipboard.setContents(data, transfers); /* THIS LINE BLOWS UP */
clipboard.dispose();

Packages.org.eclipse.jface.dialogs.MessageDialog.openInforma tion(
window.getShell(),
"Your new UUID",
textData
)

}


Thanks,


Phil
Re: Help with Monkey script (IllegalArgumentException calling Eclipse API method) [message #2818 is a reply to message #2799] Thu, 08 November 2007 02:17 Go to previous message
Phillip Rhodes is currently offline Phillip RhodesFriend
Messages: 12
Registered: July 2009
Junior Member
Never mind, figured it out. I was putting a UUID object in
the data array instead of a String.


> data[0] = java.util.UUID.randomUUID();

should be: data[0] = java.util.UUID.randomUUID().toString();


Thanks,


Phil
Re: Help with Monkey script (IllegalArgumentException calling Eclipse API method) [message #560462 is a reply to message #2799] Thu, 08 November 2007 02:17 Go to previous message
Phillip Rhodes is currently offline Phillip RhodesFriend
Messages: 12
Registered: July 2009
Junior Member
Never mind, figured it out. I was putting a UUID object in
the data array instead of a String.


> data[0] = java.util.UUID.randomUUID();

should be: data[0] = java.util.UUID.randomUUID().toString();


Thanks,


Phil
Previous Topic:Help with Monkey script (IllegalArgumentException calling Eclipse API method)
Next Topic:Examples, examples.
Goto Forum:
  


Current Time: Fri Dec 19 08:41:12 GMT 2014

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

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