final ISelection sel = event.getSelection();
if (sel == null || sel.isEmpty()) {
return;
}
final TreeSelection tsel = (TreeSelection) sel;
final AbstractResultTreeObject selection = (AbstractResultTreeObject) tsel
.getFirstElement();
copyGeneralisedToClipboard.setText(selection.getSuggestedCode());
if (selection instanceof DuplicatedCodeInstanceElement) {
final DuplicatedCodeInstanceElement dcie = (DuplicatedCodeInstanceElement) selection;
copyFunCallToClipboard.setText(dcie.getReplicationFunction());
}