@Override public void doExecute() { // Create the copy // EClass metaObject = owner.eClass(); EPackage ePackage = metaObject.getEPackage(); EFactory eFactory = ePackage.getEFactoryInstance(); copy = eFactory.create(metaObject); copyHelper.put(owner, copy); }
public void execute() { // Get the corresponding type. // EClass outputType = (EClass)mappingDomain.getOutputMetaObject(owner.eClass()); if (outputType != null) { // Create the copy from this corresponding type. // copy = outputType.getEPackage().getEFactoryInstance().create(outputType); copyHelper.put(owner, copy); MappingRoot mappingRoot = mappingDomain.getMappingRoot(); if (mappingRoot.isInputObject(owner)) { // This is done to ensure that this new copy is treated as an output by the domain. // The CreateMappingCommand will rely on this setting. // MappedObjectState mappedObjectState = mappingRoot.getMappedObjectState(copy); if (mappedObjectState != null) { mappedObjectState.setOriginatingInput(owner); } } } }
public void execute() { // Get the corresponding type. // EClass outputType = (EClass)mappingDomain.getOutputMetaObject(owner.eClass()); if (outputType != null) { // Create the copy from this corresponding type. // copy = outputType.getEPackage().getEFactoryInstance().create(outputType); copyHelper.put(owner, copy); MappingRoot mappingRoot = mappingDomain.getMappingRoot(); if (mappingRoot.isInputObject(owner)) { // This is done to ensure that this new copy is treated as an output by the domain. // The CreateMappingCommand will rely on this setting. // MappedObjectState mappedObjectState = mappingRoot.getMappedObjectState(copy); if (mappedObjectState != null) { mappedObjectState.setOriginatingInput(owner); } } } }
public void redo() { copyHelper.put(owner, copy); }
public void redo() { copyHelper.put(owner, copy); }
@Override public void doRedo() { copyHelper.put(owner, copy); }