Skip to content

Commit

Permalink
Merge pull request eclipse-vorto#182 from bsinno/feature/single_project
Browse files Browse the repository at this point in the history
Support for a single project containing many vorto models + Perspective
  • Loading branch information
aedelmann committed May 24, 2016
2 parents 6100932 + 6501baa commit d96d631
Show file tree
Hide file tree
Showing 131 changed files with 2,203 additions and 3,726 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
import org.eclipse.vorto.codegen.ui.utils.PlatformUtils;
import org.eclipse.vorto.core.api.model.informationmodel.InformationModel;
import org.eclipse.vorto.core.api.model.mapping.MappingModel;
import org.eclipse.vorto.core.model.IModelProject;
import org.eclipse.vorto.core.service.ModelProjectServiceFactory;
import org.eclipse.vorto.core.ui.model.IModelElement;
import org.eclipse.vorto.core.ui.model.IModelProject;
import org.eclipse.vorto.core.ui.model.ModelProjectFactory;

/**
*
Expand Down Expand Up @@ -55,9 +56,11 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
private void evaluate(String generatorName) {

final IConfigurationElement[] configElements = getUserSelectedGenerators(generatorName);
IModelProject selectedProject = ModelProjectServiceFactory.getDefault().getProjectFromSelection();


IModelElement selectedElement = ModelProjectFactory.getInstance().getModelElementFromSelection();

InformationModel informationModel = (InformationModel) selectedProject.getModel();
InformationModel informationModel = (InformationModel) selectedElement.getModel();

for (IConfigurationElement e : configElements) {
try {
Expand All @@ -71,7 +74,7 @@ private void evaluate(String generatorName) {
IVortoCodeGenerator informationModelCodeGenerator = (IVortoCodeGenerator) codeGenerator;

CodeGeneratorTaskExecutor.execute(informationModel, informationModelCodeGenerator,
createMappingContext(selectedProject, informationModelCodeGenerator.getServiceKey()));
createMappingContext(selectedElement.getProject(), informationModelCodeGenerator.getServiceKey()));

} catch (Exception e1) {
MessageDisplayFactory.getMessageDisplay().displayError(e1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class PopulateGeneratorsMenu extends CompoundContributionItem {
private static final String CLASS = "class";
private static final String MENU_LABEL = "menuLabel";


public PopulateGeneratorsMenu() {
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d96d631

Please sign in to comment.