/** * For a copy command, creates a {@link WrapperItemProvider.WrappingCopyCommand}, which copies the feature map entry * and wrapper along with the entry value; for other commands, the wrapper-substituting command wrapper supplied by * the base implementation is used. This method is only called for non-null reference values to wrap a command * returned by the delegate item provider. */ @Override protected Command wrapCommand(Command command, Class<? extends Command> commandClass) { if (commandClass == CopyCommand.class) { return new WrappingCopyCommand(command) { @Override public IWrapperItemProvider copy() { Iterator<?> i = getCommand().getResult().iterator(); return new FeatureMapEntryWrapperItemProvider (FeatureMapUtil.createEntry(getEntryFeature(), i.next()), (EObject)owner, (EAttribute)feature, index, adapterFactory, resourceLocator); } }; } return super.wrapCommand(command, commandClass); }
result = ((IEditingDomainItemProvider)delegateItemProvider).createCommand(commandOwner, domain, commandClass, commandParameter); return wrapCommand(result, commandClass);