diff --git a/parent/.project b/parent/.project index 6836c3e..072e15a 100644 --- a/parent/.project +++ b/parent/.project @@ -23,12 +23,12 @@ github 2 - $%7BPARENT-1-PROJECT_LOC%7D/.github + PARENT-1-PROJECT_LOC/.github readme.adoc 1 - $%7BPARENT-1-PROJECT_LOC%7D/readme.adoc + PARENT-1-PROJECT_LOC/readme.adoc diff --git a/parent/tpd/build.target b/parent/tpd/build.target index d54aa97..b996b9c 100644 --- a/parent/tpd/build.target +++ b/parent/tpd/build.target @@ -1,44 +1,49 @@ - + - - + + - - - + + + - - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -46,7 +51,8 @@ - + + diff --git a/plugins/com.obeonetwork.mbse.capella.vpx.design/src/com/obeonetwork/mbse/capella/vpx/design/LoopholeGeneratorOperation.java b/plugins/com.obeonetwork.mbse.capella.vpx.design/src/com/obeonetwork/mbse/capella/vpx/design/LoopholeGeneratorOperation.java index 9ddb56b..eb28143 100644 --- a/plugins/com.obeonetwork.mbse.capella.vpx.design/src/com/obeonetwork/mbse/capella/vpx/design/LoopholeGeneratorOperation.java +++ b/plugins/com.obeonetwork.mbse.capella.vpx.design/src/com/obeonetwork/mbse/capella/vpx/design/LoopholeGeneratorOperation.java @@ -4,10 +4,9 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: - * Obeo - initial API and implementation - */ + * Obeo - initial API and implementation */ package com.obeonetwork.mbse.capella.vpx.design; import java.lang.reflect.InvocationTargetException; @@ -30,42 +29,46 @@ import org.eclipselabs.emf.loophole.internal.model.GenGapModel; /** - * Copy from : mbarbero/emf-loophole - * - bundles/org.eclipselabs.emf.loophole.ui/src/ + * Copy from : (Github) mbarbero/emf-loophole + * bundles/org.eclipselabs.emf.loophole.ui/src/ * org/eclipselabs/emf/loophole/ui/internal/model/editor/LoopholeGeneratorOperation *

* To solve compilation issue. *

+ * * @author nperansin * */ -@SuppressWarnings("restriction") +@SuppressWarnings("restriction") public class LoopholeGeneratorOperation extends GeneratorOperation { - // Index + // Index private static final int PROJECT_TYPE_INDEX = 2; private static final int GENMODEL_INDEX = 4; - public LoopholeGeneratorOperation(Shell arg0) { - super(arg0); - } - - public void addGeneratorAndArguments(Generator generator, Object object, Object projectType, String projectTypeName, GenGapModel genGapModel) - { - if (generatorAndArgumentsList == null) - { - generatorAndArgumentsList = new ArrayList(); - } - Object[] info = { - generator, object, - /*2*/projectType, projectTypeName, - /*4*/genGapModel - }; - - generatorAndArgumentsList.add(info); + public LoopholeGeneratorOperation(Shell arg0) { + super(arg0); + } + + public void addGeneratorAndArguments( + Generator generator, Object object, Object projectType, String projectTypeName, + GenGapModel genGapModel) { + if (generatorAndArgumentsList == null) { + generatorAndArgumentsList = new ArrayList<>(); + } + Object[] info = { + generator, + object, + /*2*/projectType, + projectTypeName, + /*4*/genGapModel + }; + + generatorAndArgumentsList.add(info); } - - private IFolder prepareDirectory(Object[] genArgs, IProgressMonitor monitor) throws CoreException { + + private IFolder prepareDirectory(Object[] genArgs, IProgressMonitor monitor) + throws CoreException { if (!(GENMODEL_INDEX < genArgs.length)) { return null; } @@ -73,11 +76,11 @@ private IFolder prepareDirectory(Object[] genArgs, IProgressMonitor monitor) thr GenModel genModel = genGapModel.getGenModel(); String directory = null; boolean clean = false; - String projectType = genArgs[PROJECT_TYPE_INDEX] instanceof String - ? (String) genArgs[PROJECT_TYPE_INDEX] - : ""; - - switch(projectType) { + String projectType = genArgs[PROJECT_TYPE_INDEX] instanceof String + ? (String) genArgs[PROJECT_TYPE_INDEX] + : ""; + + switch (projectType) { case GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE: directory = genModel.getModelDirectory(); clean = genGapModel.isCleanModelDirectory(); @@ -102,24 +105,26 @@ private IFolder prepareDirectory(Object[] genArgs, IProgressMonitor monitor) thr } return srcFolder; } - - @Override - protected void execute(IProgressMonitor progressMonitor) throws CoreException, InvocationTargetException, InterruptedException { - SubMonitor subMonitor = SubMonitor.convert(progressMonitor, 80 + 15 * generatorAndArgumentsList.size()); - - List genProjets = new ArrayList<>(); - for (Object[] generatorAndArguments : generatorAndArgumentsList) { - IFolder srcFolder = prepareDirectory(generatorAndArguments, subMonitor.newChild(10)); - if (srcFolder != null) { - genProjets.add(srcFolder.getProject()); - } + + @Override + protected void execute(IProgressMonitor progressMonitor) + throws CoreException, InvocationTargetException, InterruptedException { + SubMonitor subMonitor = + SubMonitor.convert(progressMonitor, 80 + 15 * generatorAndArgumentsList.size()); + + List genProjets = new ArrayList<>(); + for (Object[] generatorAndArguments : generatorAndArgumentsList) { + IFolder srcFolder = prepareDirectory(generatorAndArguments, subMonitor.newChild(10)); + if (srcFolder != null) { + genProjets.add(srcFolder.getProject()); + } } - super.execute(subMonitor.newChild(80)); - - // Refresh containers. - for (IProject target : genProjets) { - target.refreshLocal(IResource.DEPTH_INFINITE, subMonitor.newChild(5)); - } - } - + super.execute(subMonitor.newChild(80)); + + // Refresh containers. + for (IProject target : genProjets) { + target.refreshLocal(IResource.DEPTH_INFINITE, subMonitor.newChild(5)); + } + } + }