public static boolean copy(String text) {
        final BodyElement body = Document.get().getBody();
        final TextArea textArea = new TextArea();
        final Element textAreaElement = textArea.getElement();

        body.appendChild(textAreaElement);
        textArea.setStyleName("clipboardCopy");
        textArea.setText(text);

        final boolean result = copy();
        body.removeChild(textAreaElement);

        return result;
    }
Copies the provided text to the clipboard via an invisible textarea
@return Whether the copy was successful
stroom-core-client/src/main/java/stroom/util/client/ClipboardUtil.java