| 
| Help with Monkey script (IllegalArgumentException calling Eclipse API method) [message #2799] | Wed, 07 November 2007 21:12  |  | 
| Eclipse User  |  |  |  |  | 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
 |  |  |  | 
|  | 
|  | 
Powered by 
FUDForum. Page generated in 0.04812 seconds