public static void copyToClipboard ( String content ) { if ( content == null ) { return ; } Clipboard cb = null ; try { cb = new Clipboard ( Display . getDefault ( ) ) ; cb . setContents ( new String [ ] { content } , new TextTransfer [ ] { TextTransfer . getInstance ( ) } ) ; } finally { if ( cb != null ) { cb . dispose ( ) ; } } }
Copies given string to the system clipboard