Commit c7237d35 authored by Marco Konersmann's avatar Marco Konersmann

The UI now has explicit debug functions for implementation migrations

parent a3a33fee
......@@ -36,6 +36,13 @@
id="org.codeling.ui.commands.ilModuleTransformationToADL"
name="IL Module Transformations To ADL">
</command>
<command
categoryId="org.codeling.transformationmanager.commands.category"
defaultHandler="org.codeling.ui.handlers.ILProfileTransformationToCode_ImplementationMigrationHandler"
description="Intermodule Transformations To Code during Implementation Migration"
id="org.codeling.ui.commands.ilModuleTransformationToCode_migration"
name="IL Module Transformations To Code during Implementation Migration">
</command>
<command
categoryId="org.codeling.transformationmanager.commands.category"
defaultHandler="org.codeling.ui.handlers.IL2ADLHandler"
......@@ -122,7 +129,7 @@
</command>
<menu
icon="icons/change_obj.png"
label="Codeling Debugging Tools">
label="Codeling Debugging Tools (Impl &lt;-&gt; Spec)">
<command
commandId="org.codeling.ui.commands.code2cm"
icon="icons/change_obj.png"
......@@ -168,31 +175,65 @@
<command
commandId="org.codeling.ui.commands.il2cm"
icon="icons/change_obj.png"
label="6.1 (a) Translation Model to Implementation Model"
label="6.1 Translation Model to Implementation Model"
style="push">
</command>
<command
commandId="org.codeling.ui.commands.il2cm_ImplementationMigration"
commandId="org.codeling.ui.commands.cm2code"
icon="icons/change_obj.png"
label="6.1 (b) Translation Model to Implementation Model during Implementation Migration"
label="6.2 Implementation Model to Code"
style="push">
</command>
<command
commandId="org.codeling.ui.commands.cm2code"
commandId="org.codeling.ui.commands.ilAndCm2Code"
icon="icons/change_obj.png"
label="6.3 Translation Model to Code (additions)"
style="push">
</command>
</menu>
<menu
icon="icons/change_obj.png"
label="Codeling Debugging Tools (Code Migration)">
<command
commandId="org.codeling.ui.commands.code2cm"
icon="icons/change_obj.png"
label="6.2 (a) Implementation Model to Code"
label="1.1 Code to Implementation Model"
style="push">
</command>
<command
commandId="org.codeling.ui.commands.cm2il"
icon="icons/change_obj.png"
label="1.2 Implementation to Translation Model"
style="push">
</command>
<command
commandId="org.codeling.ui.commands.codeAndCM2IL"
icon="icons/change_obj.png"
label="1.3 Code to Translation Model (additions)"
style="push">
</command>
<command
commandId="org.codeling.ui.commands.ilModuleTransformationToCode_migration"
icon="icons/change_obj.png"
label="2. Profile Transformations"
style="push">
</command>
<command
commandId="org.codeling.ui.commands.il2cm_ImplementationMigration"
icon="icons/change_obj.png"
label="3.1 Translation Model to Implementation Model"
style="push">
</command>
<command
commandId="org.codeling.ui.commands.cm2code_implementationMigration"
icon="icons/change_obj.png"
label="6.2 (b) Implementation Model to Code during Implementation Migration"
label="3.2 Implementation Model to Code"
style="push">
</command>
<command
commandId="org.codeling.ui.commands.ilAndCm2Code"
icon="icons/change_obj.png"
label="6.3 Translation Model to Code (additions)"
label="3.3 Translation Model to Code (additions)"
style="push">
</command>
</menu>
......
package org.codeling.ui.handlers;
import java.util.List;
import org.codeling.languageregistry.LanguageDefinition;
import org.codeling.transformationmanager.internal.steps.InterProfileTransformationToImplementationModelTask;
import org.codeling.transformationmanager.internal.steps.ProgramCodeToTranslationModelTask;
import org.codeling.utils.CodelingException;
import org.codeling.utils.IDRegistry;
import org.codeling.utils.Models;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.emf.ecore.EObject;
public class ILProfileTransformationToCode_ImplementationMigrationHandler extends AbstractSteppedHandler {
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
executedAsSingleStep = true;
LanguageDefinition[] languageDefinitions;
try {
languageDefinitions = requestLanguagesFromUser();
} catch (final CodelingException e) {
throw new ExecutionException("Could not get languages from the user.", e);
}
final IDRegistry priorIdRegistry = IDRegistry.load(ProgramCodeToTranslationModelTask.ID_FILEPATH);
final List<EObject> priorModelRoots = Models.loadFrom(ProgramCodeToTranslationModelTask.MODEL_FILEPATH);
final Job job = new InterProfileTransformationToImplementationModelTask(languageDefinitions[0], languageDefinitions[1],
priorIdRegistry, priorModelRoots, true);
job.setUser(true);
job.schedule();
return Status.OK_STATUS;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment