/** * This creates a command to set the owner's feature to the specified value. */ public static Command create(EditingDomain domain, final Object owner, Object feature, Object value) { return create(domain, owner, feature, value, CommandParameter.NO_INDEX); }
public void doDispose() { super.doDispose(); if (setTypeCommand != null) { setTypeCommand.dispose(); } } };
public void doRedo() { super.doRedo(); if (setTypeCommand != null) { setTypeCommand.redo(); } }
protected Command createSetOverrideCommand(SetCommand setCommand) { EStructuralFeature feature = setCommand.getFeature(); return feature instanceof EReference && ((EReference)feature).isContainment() && mappingRoot.isOutputObject(setCommand.getOwner()) ? new SetOverrideCommand(this, setCommand) : null; }
public void doExecute() { CMPAttribute cmpAttribute = (CMPAttribute) this.owner; JavaHelpers type = cmpAttribute.getType(); super.doExecute(); if (cmpAttribute.getType() != type) { setTypeCommand = SetCommand.create(this.domain, this.owner, EcorePackage.eINSTANCE.getETypedElement_EType(), type); if (setTypeCommand.canExecute()) { setTypeCommand.execute(); } else { setTypeCommand.dispose(); setTypeCommand = null; } } }
public void execute() setCommand.doExecute(); if (setCommand.getOldValue() != null) Object oldValue = setCommand.getOldValue(); for (Iterator<?> objects = mappingDomain.treeIterator(oldValue); objects.hasNext(); ) if (setCommand.getValue() != null) Object value = setCommand.getValue(); for (Iterator<?> objects = mappingDomain.treeIterator(value); objects.hasNext(); )
@Override public void undo() { if (mapCommand != null) { mapCommand.undo(); } setCommand.doUndo(); }
owners.add(((SetCommand)command).getOwner());
protected boolean analyzeForNonContainment(Command command) { if (command instanceof AddCommand) { return isNonContainment(((AddCommand)command).getFeature()); } else if (command instanceof SetCommand) { return isNonContainment(((SetCommand)command).getFeature()); } else if (command instanceof CommandWrapper) { return analyzeForNonContainment(((CommandWrapper)command).getCommand()); } else if (command instanceof CompoundCommand) { for (Command childCommand : ((CompoundCommand)command).getCommandList()) { if (analyzeForNonContainment(childCommand)) { return true; } } } return false; }
@Override protected boolean prepare() { return setCommand.doCanExecute(); }
public void execute() setCommand.doExecute(); if (setCommand.getOldValue() != null) Object oldValue = setCommand.getOldValue(); for (Iterator<?> objects = mappingDomain.treeIterator(oldValue); objects.hasNext(); ) if (setCommand.getValue() != null) Object value = setCommand.getValue(); for (Iterator<?> objects = mappingDomain.treeIterator(value); objects.hasNext(); )
protected Command createSetOverrideCommand(SetCommand setCommand) { EStructuralFeature feature = setCommand.getFeature(); return feature instanceof EReference && ((EReference)feature).isContainment() && mappingRoot.isOutputObject(setCommand.getOwner()) ? new SetOverrideCommand(this, setCommand) : null; }
public void doUndo() { if (setTypeCommand != null) { setTypeCommand.undo(); } super.doUndo(); }
@Override protected boolean prepare() { return setCommand.doCanExecute(); }
/** * Returns a command that will set the value on the model object. The wrapper is used as the owner of the command, * unless overridden, so that it can specialize the command that eventually gets created. */ protected Command createSetCommand(EditingDomain domain, Object owner, Object feature, Object value) { return SetCommand.create(domain, getCommandOwner(WrapperItemProvider.this), null, value); }
public void redo() { setCommand.doRedo(); if (mapCommand != null) { mapCommand.redo(); } }
@Override public void undo() { if (mapCommand != null) { mapCommand.undo(); } setCommand.doUndo(); }
@Override public void dispose() { if (mapCommand != null) { mapCommand.dispose(); } setCommand.doDispose(); }
@Override protected void doSet(EObject container, EStructuralFeature feature, Object value) throws ModelManipulationException { Command setCommand = SetCommand.create(domain, container, feature, value); executeCommand(setCommand); }
public void redo() { setCommand.doRedo(); if (mapCommand != null) { mapCommand.redo(); } }