Couldn\'t find anything on this with a Google Search.
Does anyone know how to copy some text to the clipboard through GWT Java code? I\'d like to avoid the raw javas
The following code worked fine for me in chrome:
public static native void copyToClipboard() /*-{
var selection = $wnd.getSelection();
var text = $doc.getElementById("myElement");
var range = $doc.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
$doc.execCommand('copy');
selection.removeAllRanges();
}-*/;