/*
  * (non-Javadoc)
  *
  * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getSemanticCommand(org.eclipse.emf.edit.domain.EditingDomain,
  * org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard)
  */
 @Override
 public org.eclipse.emf.common.command.Command getSemanticCommand(
     EditingDomain domain, EObject targetOwner, PapyrusClipboard<Object> papyrusClipboard) {
   CompoundCommand compoundCommand =
       new CompoundCommand("Rename root paste elements"); // $NON-NLS-1$
   List<EObject> filterDescendants = EcoreUtil.filterDescendants(papyrusClipboard.getTarget());
   for (Iterator<EObject> iterator = filterDescendants.iterator(); iterator.hasNext(); ) {
     EObject target = iterator.next();
     if (target instanceof NamedElement) {
       NamedElement namedElement = (NamedElement) target;
       if (namedElement.getName() != null) {
         String defaultCopyNameWithIncrement =
             NamedElementUtil.getDefaultCopyNameWithIncrement(
                 namedElement, targetOwner.eContents());
         RenameElementCommand renameElementCommand =
             new RenameElementCommand(
                 (TransactionalEditingDomain) domain, namedElement, defaultCopyNameWithIncrement);
         compoundCommand.append(renameElementCommand);
       }
     }
   }
   // An empty can't be executed
   if (compoundCommand.getCommandList().isEmpty()) {
     return null;
   }
   return compoundCommand;
 }