/** * This returned a primitive {@link org.eclipse.emf.edit.command.SetCommand}, but it has been replaced, since this * command can now take an index. The replacement method still calls this method when invoked with {@link * CommandParameter#NO_INDEX no index}, to provide backwards compatibility. * * <p>This method will soon be deprecated. New code should use or override the {@link * #createSetCommand(EditingDomain, EObject, EStructuralFeature, Object, int) new form}, instead. */ protected Command createSetCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value) { return new SetCommand(domain, owner, feature, value); }
/** * This creates a primitive {@link org.eclipse.emf.edit.command.SetCommand}. */ protected Command createSetCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value, int index) { if (index == CommandParameter.NO_INDEX) { return createSetCommand(domain, owner, feature, value); } return new SetCommand(domain, owner, feature, value, index); }
for (EObject newValueObject : newValues) compoundCommand.appendIfCanExecute(new SetCommand(domain, newValueObject, eOtherEnd, UNSET_VALUE)); EObject otherEObject = (EObject)newValueObject.eGet(eOtherEnd); if (otherEObject != null) new SetCommand(domain, newValueObject, eOtherEnd, UNSET_VALUE) : new RemoveCommand(domain, otherEObject, eReference, newValueObject)); new SetCommand(domain, eObject, eOtherEnd, UNSET_VALUE) : new SetCommand(domain, otherEObject, eReference, UNSET_VALUE);