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 #560455] Thu, 08 November 2007 02:12
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
Previous Topic:Tables, Views and Objects
Next Topic:Help with Monkey script (IllegalArgumentException calling Eclipse API method)
Goto Forum:
  


Current Time: Sat Dec 20 23:12:17 GMT 2014

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

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