Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package edelta.refactorings.lib;
import edelta.lib.EdeltaDefaultRuntime;
import edelta.lib.EdeltaEcoreUtil;
import edelta.lib.EdeltaModelMigrator;
import edelta.lib.EdeltaRuntime;
import edelta.refactorings.lib.helper.EdeltaEObjectHelper;
import edelta.refactorings.lib.helper.EdeltaPromptHelper;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.xtext.xbase.lib.Conversions;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
@SuppressWarnings("all")
public class EdeltaRefactoringsWithPrompt extends EdeltaDefaultRuntime {
private EdeltaRefactorings refactorings;
public EdeltaRefactoringsWithPrompt(final EdeltaRuntime other) {
super(other);
refactorings = new EdeltaRefactorings(this);
}
/**
* Creates the classes with the given names as subclasses of the passed
* superClass, which will then be made abstract; For model migration it
* prompts the user on the console.
*
* @see EdeltaRefactorings#introduceSubclasses(EClass, Collection, edelta.lib.EdeltaModelMigrator.EObjectFunction)
*
* @param superClass
* @param name
*/
public Collection introduceSubclassesInteractive(final EClass superClass, final List names) {
final EdeltaModelMigrator.EObjectFunction _function = (EObject oldObj) -> {
final EdeltaEObjectHelper helper = new EdeltaEObjectHelper();
String _represent = helper.represent(oldObj);
String _plus = ("Migrating " + _represent);
EdeltaPromptHelper.show(_plus);
EdeltaPromptHelper.show(helper.positionInContainter(oldObj));
final String choice = EdeltaPromptHelper.choice(names);
return EdeltaEcoreUtil.createInstance(this.getEClass(superClass.getEPackage(), choice));
};
return this.refactorings.introduceSubclasses(superClass, names, _function);
}
/**
* Merges the given attributes, expected to be of type EString,
* into a single new attribute in the containing class; For model migration it
* prompts the user on the console.
*
* @see EdeltaRefactorings#mergeAttributes(String, Collection, Function)
*
* @param newAttributeName
* @param attributes
*/
public EAttribute mergeStringAttributes(final String newAttributeName, final Collection attributes) {
EAttribute _xblockexpression = null;
{
EAttribute _head = IterableExtensions.head(attributes);
this.refactorings.checkType(_head, getEDataType("ecore", "EString"));
final Function, Object> _function = (Collection