Bug 61273 RTF-styles no longer copied in java editor
I20040506-0200 Copying text from the java editor used to copy the selected source range also in RTF format. This no longer works - the only type in the clipboard is text.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClipboardOperationAction.java
ISelection selection= editor.getSelectionProvider().getSelection();
		
		Object clipboardData= null;
		if (inputElement != null && selection instanceof ITextSelection && !selection.isEmpty()) {
			ITextSelection textSelection= (ITextSelection) selection;
			if (isNonTrivialSelection(textSelection)) {
				clipboardData= getClipboardData(inputElement, textSelection.getOffset(), textSelection.getLength());
			}
		}
		
		fOperationTarget.doOperation(fOperationCode);
		
		if (clipboardData != null) {
			Clipboard clipboard= new Clipboard(getDisplay());
			Object textData= clipboard.getContents(TextTransfer.getInstance());
			
			Transfer[] dataTypes= new Transfer[] { TextTransfer.getInstance(),  fgTransferInstance};
			Object[] data= new Object[] { textData,  clipboardData};
			clipboard.setContents(data, dataTypes);
		}
	}
	
	private boolean isNonTrivialSelection(ITextSelection selection) {
		if (selection.getLength() < 30) {
			String text= selection.getText();
			for (int i= 0; i < text.length(); i++) {
				if (!Character.isJavaIdentifierPart(text.charAt(i))) {
					return true;
				}
			}