Search in sources :

Example 1 with IModelProjectContext

use of org.eclipse.vorto.codegen.ui.context.IModelProjectContext in project vorto by eclipse.

the class ProjectCreationTask method run.

@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
    try {
        EclipseProjectGenerator<IModelProjectContext> generator = new EclipseProjectGenerator<IModelProjectContext>(new LocationWrapper(workspaceLocation, projectName));
        generator.addNature(XTEXT_NATURE);
        for (String nature : getProjectNature()) {
            generator.addNature(nature);
        }
        generator.addTask(getCodeGeneratorTask());
        generator.generate(context, InvocationContext.simpleInvocationContext(), monitor);
        setIproject(generator.getProject());
        IModelProject modelProject = getIotproject(generator.getProject());
        modelProject.refresh(monitor);
        fireRefreshEvent(modelProject);
    } finally {
        monitor.done();
    }
}
Also used : IModelProjectContext(org.eclipse.vorto.codegen.ui.context.IModelProjectContext) IModelProject(org.eclipse.vorto.core.ui.model.IModelProject) EclipseProjectGenerator(org.eclipse.vorto.codegen.ui.tasks.EclipseProjectGenerator) LocationWrapper(org.eclipse.vorto.codegen.ui.tasks.LocationWrapper)

Aggregations

IModelProjectContext (org.eclipse.vorto.codegen.ui.context.IModelProjectContext)1 EclipseProjectGenerator (org.eclipse.vorto.codegen.ui.tasks.EclipseProjectGenerator)1 LocationWrapper (org.eclipse.vorto.codegen.ui.tasks.LocationWrapper)1 IModelProject (org.eclipse.vorto.core.ui.model.IModelProject)1