* by letting the widget handle the copy operation in this special case.
*/
textWidget.copy();
} else if (copyText != null) {
Clipboard clipboard= new Clipboard(textWidget.getDisplay());
try {
Transfer[] dataTypes= new Transfer[] { TextTransfer.getInstance() };
Object[] data= new Object[] { copyText };
try {
clipboard.setContents(data, dataTypes);
} catch (SWTError e) {
if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD)
throw e;
/*
* TODO see https://bugs.eclipse.org/bugs/show_bug.cgi?id=59459
* we should either log and/or inform the user
* silently fail for now.
*/
return;
}
} finally {
clipboard.dispose();
}
}
if (delete) {
try {