} else if (focusControl instanceof StyledText) {
((StyledText) focusControl).paste();
return;
}
EOModelObject selectedObject = (EOModelObject) getSelectedObject();
ISelection pastedSelection = LocalSelectionTransfer.getTransfer().getSelection();
if (pastedSelection != null) {
Object[] clipboardObjects = ((IStructuredSelection) pastedSelection).toArray();
Arrays.sort(clipboardObjects, new PasteOrderComparator());
SimpleCompositeOperation pasteOperation = new SimpleCompositeOperation(EOModelUtils.getOperationLabel("Paste", Arrays.asList(clipboardObjects)));
for (Object clipboardObject : clipboardObjects) {
if (clipboardObject instanceof EOModelObject) {
EOModelObject eoModelObject = (EOModelObject) clipboardObject;
Class<EOModelObject> modelParentClass = eoModelObject._getModelParentType();
EOModelObject pasteIntoObject = EOModelUtils.getRelated(modelParentClass, selectedObject);
if (pasteIntoObject != null) {
EOModelObject clonedPasteObject = eoModelObject._cloneModelObject();
pasteOperation.add(new AddOperation(pasteIntoObject, clonedPasteObject));
}
}
}