When it pops up in devmode, I get this in the GWT Console:
Code:
00:18:19.856 [ERROR] Line 57: Native methods require a JavaScript implementation enclosed with /*-{ and }-*/
Also, window needs to be referenced via the gwt var $wnd.
So, try something like this:
Code:
private static native void copyToClipBoard (final String text) /*-{
if ($wnd.clipboardData) {
// Internet Explorer
$wnd.clipboardData.setData("Text", text);
}
else {
$wnd.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
clipboardHelper.copyString(text);
}
}-*/;
Please post your solution when you have it...
Leave a comment: