Search in sources :

Example 1 with IProjectContext

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

the class VortoProjectCreationTask method run.

@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
    try {
        EclipseProjectGenerator<IProjectContext> generator = new EclipseProjectGenerator<IProjectContext>(new LocationWrapper(workspaceLocation, projectName));
        generator.addNature(XTEXT_NATURE);
        generator.addNature(VortoProjectNature.VORTO_NATURE);
        for (String folder : ALL_MODEL_FOLDERS) {
            generator.addFolder(folder);
        }
        generator.generate(context, InvocationContext.simpleInvocationContext(), monitor);
        IProject iProject = generator.getProject();
        iProject.refreshLocal(IResource.DEPTH_ONE, monitor);
    } catch (CoreException e) {
        errorMessage = e.getMessage();
        throw new RuntimeException(ERROR_MESSAGE + e.getMessage(), e);
    } finally {
        monitor.done();
    }
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) IProjectContext(org.eclipse.vorto.codegen.ui.context.IProjectContext) EclipseProjectGenerator(org.eclipse.vorto.codegen.ui.tasks.EclipseProjectGenerator) LocationWrapper(org.eclipse.vorto.codegen.ui.tasks.LocationWrapper) IProject(org.eclipse.core.resources.IProject)

Aggregations

IProject (org.eclipse.core.resources.IProject)1 CoreException (org.eclipse.core.runtime.CoreException)1 IProjectContext (org.eclipse.vorto.codegen.ui.context.IProjectContext)1 EclipseProjectGenerator (org.eclipse.vorto.codegen.ui.tasks.EclipseProjectGenerator)1 LocationWrapper (org.eclipse.vorto.codegen.ui.tasks.LocationWrapper)1