Merge remote-tracking branch 'origin/master' into newfeat_globalanalysis
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.classpath b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.classpath
new file mode 100644
index 0000000..d97031b
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="output" path="target/classes/"/>
+</classpath>
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.project b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.project
new file mode 100644
index 0000000..3638ddd
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.polarsys.esf.globalanalysis.execution.ui</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.settings/org.eclipse.jdt.core.prefs b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/META-INF/MANIFEST.MF b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..0ebecdd
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: src/main/resources/properties/plugin
+Bundle-SymbolicName: org.polarsys.esf.globalanalysis.execution.ui;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-Activator: org.polarsys.esf.globalanalysis.execution.ui.GlobalAnalysisExecutionUIActivator$Implementation
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.common,
+ org.eclipse.ui.workbench,
+ org.eclipse.core.commands,
+ org.eclipse.jface,
+ org.polarsys.esf.core.utils;bundle-version="0.7.0";visibility:=reexport,
+ org.eclipse.emf.common.ui,
+ org.eclipse.uml2.uml,
+ org.polarsys.esf.analysis.common.ui;bundle-version="0.7.0";visibility:=reexport,
+ org.polarsys.esf.localanalysis.profile;bundle-version="0.7.0";visibility:=reexport,
+ org.polarsys.esf.globalanalysis.execution;bundle-version="0.7.0";visibility:=reexport,
+ org.polarsys.esf.core.common;bundle-version="0.7.0";visibility:=reexport,
+ org.polarsys.esf.core.common.ui;bundle-version="0.7.0";visibility:=reexport,
+ org.polarsys.esf.localanalysis.profile.tools
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/about.html b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/about.html
new file mode 100644
index 0000000..d35d5ae
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 5, 2007</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/build.properties b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/build.properties
new file mode 100644
index 0000000..d32bb2c
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/build.properties
@@ -0,0 +1,7 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               src/main/resources/properties/,\
+               about.html
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/plugin.xml b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/plugin.xml
new file mode 100644
index 0000000..0191188
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/plugin.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         id="org.polarsys.esf.globalanalysis.execution.ui.commands"
+         point="org.eclipse.ui.commands">
+      <command
+            description="%menucontext.execution.ui.new.propagation.description"
+            id="org.polarsys.esf.globalanalysis.execution.ui.new.propagation.command"
+            name="%menucontext.execution.ui.new.propagation.label">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.handlers">
+      <handler
+            class="org.polarsys.esf.globalanalysis.execution.ui.handler.StartNewPropagationHandler"
+            commandId="org.polarsys.esf.globalanalysis.execution.ui.new.propagation.command">
+         <activeWhen>
+            <and>
+               <with
+                     variable="selection">
+                  <iterate>
+                     <adapt
+                           type="org.eclipse.emf.ecore.EObject">
+                        <instanceof
+                              value="org.eclipse.uml2.uml.Package">
+                        </instanceof>
+                     </adapt>
+                  </iterate>
+               </with>
+               <count
+                     value="1">
+               </count>
+            </and>
+         </activeWhen>
+      </handler>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            allPopups="false"
+            locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?before=esf.general.bottom">
+         <menu
+               id="org.polarsys.esf.analysis.common.ui.analysis.tools.modelexplorer.menu"
+               label="%menucontext.analysis.ui.analysis.tools.menu.label">
+            <menu
+                  id="org.polarsys.esf.globalanalysis.execution.ui.menu"
+                  label="%menucontext.execution.ui.menu.label">
+               <command
+                     commandId="org.polarsys.esf.globalanalysis.execution.ui.new.propagation.command"
+                     label="%menucontext.execution.ui.new.propagation.label"
+                     style="push">
+               </command>  
+           </menu>
+         </menu>
+      </menuContribution>
+      
+   </extension>
+</plugin>
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/pom.xml b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/pom.xml
new file mode 100644
index 0000000..ad54b91
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/pom.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
+  http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <parent>
+    <groupId>org.polarsys.esf</groupId>
+    <artifactId>esf-tools.analysis.globalanalysis.execution</artifactId>
+    <version>0.7.0-SNAPSHOT</version>
+  </parent>
+  
+  <groupId>org.polarsys.esf</groupId>
+  <artifactId>org.polarsys.esf.globalanalysis.execution.ui</artifactId>
+  <packaging>eclipse-plugin</packaging>
+  <name>Global Analysis Execution UI</name>
+  <description>Global Analysis Execution UI description.</description>
+
+</project>
\ No newline at end of file
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/GlobalAnalysisExecutionUIActivator.java b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/GlobalAnalysisExecutionUIActivator.java
new file mode 100644
index 0000000..a4037ec
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/GlobalAnalysisExecutionUIActivator.java
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.globalanalysis.execution.ui;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.ui.EclipseUIPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.osgi.framework.BundleContext;
+import org.polarsys.esf.core.common.messages.Messages;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ *
+ * @author $Author: ymunoz $
+ * @version $Revision: 168 $
+ */
+public class GlobalAnalysisExecutionUIActivator extends EMFPlugin {
+
+    /** Keep track of the encapsulating singleton. */
+    public static final GlobalAnalysisExecutionUIActivator INSTANCE = new GlobalAnalysisExecutionUIActivator();
+
+    /** Keep track of the implementation singleton. */
+    private static Implementation sPlugin = null;
+
+    /** Messages class used to find localised string. */
+    private static Messages sMessages = new Messages(ResourceBundle.getBundle(Messages.BUNDLE_NAME));
+
+    /**
+     * Create the instance.
+     */
+    public GlobalAnalysisExecutionUIActivator() {
+        super(new ResourceLocator[] {});
+    }
+
+    /**
+     * Create an Error status with the data given in parameter and log it.
+     *
+     * @param pMessage The message to log
+     * @param pException The exception to log
+     */
+    public static void logError(final String pMessage, final Exception pException) {
+        // Create the Error status
+        IStatus vStatus = new Status(IStatus.ERROR, sPlugin.getSymbolicName(), IStatus.ERROR, pMessage, pException);
+
+        // Log it
+        INSTANCE.log(vStatus);
+    }
+
+    /**
+     * Create a Warning status with the data given in parameter and log it.
+     *
+     * @param pMessage The message to log
+     * @param pException The exception to log
+     */
+    public static void logWarning(final String pMessage, final Exception pException) {
+        // Create the Warning status
+        IStatus vStatus = new Status(IStatus.WARNING, sPlugin.getSymbolicName(), IStatus.WARNING, pMessage, pException);
+
+        // Log it
+        INSTANCE.log(vStatus);
+    }
+
+    /**
+     * Create an Info status with the data given in parameter and log it.
+     *
+     * @param pMessage The message to log
+     * @param pException The exception to log
+     */
+    public static void logInfo(final String pMessage, final Exception pException) {
+        // Create the Info status
+        IStatus vStatus = new Status(IStatus.INFO, sPlugin.getSymbolicName(), IStatus.INFO, pMessage, pException);
+
+        // Log it
+        INSTANCE.log(vStatus);
+    }
+
+    /**
+     * Returns the singleton instance of the Eclipse plugin.
+     *
+     * @return The singleton instance.
+     */
+    @Override
+    public ResourceLocator getPluginResourceLocator() {
+        return sPlugin;
+    }
+
+    /**
+     * @return The messages class used to return localised string
+     */
+    public static Messages getMessages() {
+        return sMessages;
+    }
+
+    /**
+     * If it is possible to adapt the given object to the given type, this
+     * returns the right adapter.
+     *
+     * Performs the following checks:
+     * <ol>
+     * <li>Returns <code>sourceObject</code> if it is an instance of the adapter type.</li>
+     * <li>If sourceObject implements IAdaptable, it is queried for adapters.</li>
+     * <li>If sourceObject is not an instance of PlatformObject, the adapter manager is queried for adapters</li>
+     * </ol>
+     *
+     * Otherwise returns <code>null</code>.
+     *
+     * @param pSourceObject Object to adapt, or null
+     * @param pAdapterClass Type to adapt to
+     * @param pActivatePlugins <code>true</code> if IAdapterManager.loadAdapter should be used
+     *                         (may trigger plugin activation)
+     *
+     * @return A representation of the source object that is assignable to the
+     *         adapter type, or null if no such representation exists
+     *
+     * @see org.eclipse.ui.internal.views.ViewsPlugin.getAdapter
+     */
+    @SuppressWarnings("restriction")
+    public static Object getAdapter(
+        final Object pSourceObject,
+        final Class<?> pAdapterClass,
+        final boolean pActivatePlugins) {
+
+        Object vAdapterObject = null;
+
+        Assert.isNotNull(pAdapterClass);
+        if (pSourceObject != null) {
+
+            // If the source object is already an instance of the target type,
+            // return it directly
+            if (pAdapterClass.isInstance(pSourceObject)) {
+                vAdapterObject = pSourceObject;
+
+            } else {
+                // Check if the source object is adaptable
+                // In this case, use its mechanism directly
+                if (pSourceObject instanceof IAdaptable) {
+                    // Get the adapter using the source object method
+                    vAdapterObject = ((IAdaptable) pSourceObject).getAdapter(pAdapterClass);
+
+                    // Sanity-check
+                    if (vAdapterObject != null) {
+                        Assert.isTrue(pAdapterClass.isInstance(vAdapterObject));
+                    }
+                }
+
+                // Then, if the adapter object is still not found, check
+                // if the source object is an instance of PlatformObject to use
+                // its specific adaptation mechanism
+                if (vAdapterObject == null && !(pSourceObject instanceof PlatformObject)) {
+                    // Try to find the adapter, with or without a load, according
+                    // to the flag value
+                    if (pActivatePlugins) {
+                        vAdapterObject = Platform.getAdapterManager().loadAdapter(
+                            pSourceObject,
+                            pAdapterClass.getName());
+
+                    } else {
+                        vAdapterObject = Platform.getAdapterManager().getAdapter(
+                            pSourceObject,
+                            pAdapterClass);
+                    }
+                }
+            }
+        }
+
+        return vAdapterObject;
+    }
+
+    /**
+     * Returns the singleton instance of the Eclipse plugin.
+     *
+     * @return The singleton instance.
+     */
+    public static Implementation getPlugin() {
+        return sPlugin;
+    }
+
+    /**
+     * The actual implementation of the Eclipse <b>UIPlugin</b>.
+     */
+    public static class Implementation
+        extends EclipseUIPlugin {
+
+        /** Key for run propagation icon. */
+        public static final String ICON_PROPAGATION_KEY = "icon.propagation"; //$NON-NLS-1$
+
+        /** Key for wizard propagation image. */
+        public static final String ICON_WIZARD_PROPAGATION_KEY = "icon.wizard.propagation"; //$NON-NLS-1$
+
+        /**
+         * Creates an instance.
+         */
+        public Implementation() {
+            super();
+
+            // Remember the static instance.
+            sPlugin = this;
+
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public void start(final BundleContext pContext) throws Exception {
+            super.start(pContext);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        protected void initializeImageRegistry(final ImageRegistry pReg) {
+            super.initializeImageRegistry(pReg);
+
+            // Icon paths are not externalised as they are no reason to modify it or to access to it externally
+            String vSymbolicName = getPlugin().getSymbolicName();
+
+            pReg.put(ICON_PROPAGATION_KEY,
+                imageDescriptorFromPlugin(vSymbolicName, "src/main/resources/icons/icon_propagation.png")); //$NON-NLS-1$
+
+            pReg.put(ICON_WIZARD_PROPAGATION_KEY,
+                imageDescriptorFromPlugin(vSymbolicName, "src/main/resources/icons/wizard_propagation.png")); //$NON-NLS-1$
+        }
+
+    }
+
+}
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/handler/StartNewPropagationHandler.java b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/handler/StartNewPropagationHandler.java
new file mode 100644
index 0000000..735f511
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/handler/StartNewPropagationHandler.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.globalanalysis.execution.ui.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.util.UMLUtil;
+import org.polarsys.esf.core.utils.ModelUtil;
+import org.polarsys.esf.esflocalanalysis.ISLocalAnalysis;
+import org.polarsys.esf.globalanalysis.execution.propagation.NewPropagation;
+
+/**
+ * Handler class for starting a new propagation.
+ *
+ * @author $Author: ymunoz $
+ * @version $Revision: 168 $
+ // */
+public final class StartNewPropagationHandler
+    extends AbstractHandler {
+
+    /**
+     * Default constructor.
+     */
+    public StartNewPropagationHandler() { }
+
+    /**
+     * Get the selected element and setup a new Local Analysis.
+     *
+     * {@inheritDoc}
+     */
+    @Override
+    public Object execute(final ExecutionEvent pEvent) throws ExecutionException {
+        ISelection vSelection = HandlerUtil.getCurrentSelection(pEvent);
+
+        final Package vSelectedPackage =
+            (Package) ModelUtil.getSelectedEObjectOfType(vSelection, UMLPackage.eINSTANCE.getPackage());
+
+        if ((vSelectedPackage != null) && (UMLUtil.getStereotypeApplication(vSelectedPackage, ISLocalAnalysis.class) != null)) {
+            NewPropagation.start(UMLUtil.getStereotypeApplication(vSelectedPackage, ISLocalAnalysis.class));
+        }
+        return null;
+    }
+
+}
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/FearedEventsSelectionPage.java b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/FearedEventsSelectionPage.java
new file mode 100644
index 0000000..a39fc58
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/FearedEventsSelectionPage.java
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.globalanalysis.execution.ui.wizard;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.polarsys.esf.core.common.messages.Messages;
+import org.polarsys.esf.core.common.observer.IObserver;
+import org.polarsys.esf.core.common.ui.widget.MultipleChoicesComposite;
+import org.polarsys.esf.esflocalanalysis.IAbstractSLocalAnalysisElement;
+import org.polarsys.esf.globalanalysis.execution.ui.GlobalAnalysisExecutionUIActivator;
+import org.polarsys.esf.localanalysis.profile.tools.util.IFearedEventItemUtils;
+
+/**
+ * Second page of propagation handler, where user select effective hazardous events and their propagations orders.
+ *
+ * @author $Author: jdumont $
+ * @version $Revision: 83 $
+ */
+public final class FearedEventsSelectionPage
+    extends WizardPage
+    implements IObserver {
+
+    /** Name of this page. */
+    public static final String PAGE_NAME = "wizard.propagation.second"; //$NON-NLS-1$
+
+    /** Messages class. */
+    private static final Messages MESSAGES_PROVIDER = GlobalAnalysisExecutionUIActivator.getMessages();
+
+    /** Text for title of available hazardous events list. */
+    private static final String AVAILABLE_TITLE = MESSAGES_PROVIDER
+        .getString("PropagationWizardFearedEventsSelectionPage.description.label.list.available"); //$NON-NLS-1$
+
+    /** Text for title of selected hazardous events list. */
+    private static final String SELECTED_TITLE = MESSAGES_PROVIDER
+        .getString("PropagationWizardFearedEventsSelectionPage.description.label.list.selected"); //$NON-NLS-1$
+
+    /** Title of this page. */
+    private static final String MAIN_TITLE =
+        MESSAGES_PROVIDER.getString("PropagationWizardFearedEventsSelectionPage.description.title"); //$NON-NLS-1$
+
+    /** Description. */
+    private static final String DESCRIPTION =
+        MESSAGES_PROVIDER.getString("PropagationWizardFearedEventsSelectionPage.description.description"); //$NON-NLS-1$
+
+    /** Visual part of this wizard page. */
+    private MultipleChoicesComposite mMultiDialog = null;
+
+    /** Selected feared events list. */
+    private List<IAbstractSLocalAnalysisElement> mSelectedList = new ArrayList<IAbstractSLocalAnalysisElement>();
+
+    /** Available failure mode list. */
+    private List<IAbstractSLocalAnalysisElement> mAvailableList = new ArrayList<IAbstractSLocalAnalysisElement>();
+
+    /** Utility object used to manipulate Model. */
+    private IModelUtils mModelUtils = null;
+
+    /** Utility object used to manipulate feared event items. */
+    private IFearedEventItemUtils mFearedEventUtils = null;
+
+    /**
+     * Default constructor.
+     *
+     */
+    public FearedEventsSelectionPage() {
+        super(PAGE_NAME, MAIN_TITLE, null);
+        setDescription(DESCRIPTION);
+
+        mModelUtils = ModelUtilsFactory.init().getModelUtils();
+        mFearedEventUtils = FearedEventUtilsFactory.init().getFearedEventItemUtils();
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void createControl(final Composite pParent) {
+
+        // Create a label provider
+        ILabelProvider vLabelProvider = new FearedEventsItemLabelProvider();
+
+        // Instantiate composite, and register this page as observer.
+        mMultiDialog =
+            new MultipleChoicesComposite(pParent, vLabelProvider, true, AVAILABLE_TITLE, SELECTED_TITLE, this);
+        mMultiDialog.setInputList(mAvailableList, mSelectedList);
+
+        setPageComplete(checkCompletionPage());
+        setControl(mMultiDialog);
+
+    }
+
+    /**
+     * Create a new list, which is ordered by alphabetical order.
+     *
+     * @param pSelectedList list of failure mode to order.
+     * @return a new list, ordered by rank.
+     */
+    private List<IAbstractSLocalAnalysisElement> orderSelectedList(final List<IAbstractSLocalAnalysisElement> pSelectedList) {
+
+        // Instantiate a new list
+        List<IAbstractSLocalAnalysisElement> vOrderedList = new ArrayList<IAbstractSLocalAnalysisElement>(pSelectedList);
+
+        // Sort it by rank
+        Collections.sort(vOrderedList, new Comparator<IAbstractSLocalAnalysisElement>() {
+
+            /**
+             * {@inheritDoc}
+             */
+            @Override
+            public int compare(
+                final IAbstractSLocalAnalysisElement pFirstElement,
+                final IAbstractSLocalAnalysisElement pSecondElement) {
+
+                return pFirstElement.getName().compareTo(pSecondElement.getName());
+            }
+        });
+
+        return vOrderedList;
+    }
+
+    /**
+     * Initialise list.
+     */
+    public void initSelectionLists() {
+        mSelectedList.clear();
+        mAvailableList.clear();
+
+        // Get selected model
+        PropagationWizard vPropagationWizard = (PropagationWizard) getWizard();
+        IModel vModel = vPropagationWizard.getModel();
+
+        // Split between those already selected and the others
+        for (IAbstractSLocalAnalysisElement vItem : mModelUtils.getAllFearedEventsItemAssociatedInModel(vModel)) {
+            if (mFearedEventUtils.isSelected(vItem)) {
+                mSelectedList.add(vItem);
+            } else {
+                mAvailableList.add(vItem);
+            }
+        }
+
+        // Now order each list by alphabetical order
+        mSelectedList = orderSelectedList(mSelectedList);
+        mAvailableList = orderSelectedList(mAvailableList);
+
+        // When wizard is on other page and input values is updated
+        if (mMultiDialog != null) {
+            mMultiDialog.setInputList(mAvailableList, mSelectedList);
+        }
+
+        setPageComplete(checkCompletionPage());
+    }
+
+    /**
+     * Do not allow user to finish if not events selected.
+     *
+     * @return <code>true</code> if least one failure mode is selected, otherwise <code>false</code>
+     */
+    private boolean checkCompletionPage() {
+        return !mSelectedList.isEmpty();
+    }
+
+    /**
+     * @return ordered list of feared events item selected to propagation.
+     */
+    public List<IAbstractSLocalAnalysisElement> getSelectedList() {
+        List<IAbstractSLocalAnalysisElement> vSelectedList = new ArrayList<IAbstractSLocalAnalysisElement>();
+
+        if (mMultiDialog != null) {
+            for (Object vCurrentObject : mMultiDialog.getResults()) {
+                // Add each item.
+                vSelectedList.add((IAbstractSLocalAnalysisElement) vCurrentObject);
+            }
+        }
+
+        return vSelectedList;
+    }
+
+    /**
+     * @return ordered list of failure mode not selected.
+     */
+    public List<IAbstractSLocalAnalysisElement> getNotSelectedList() {
+        List<IAbstractSLocalAnalysisElement> vNotSelectedList = new ArrayList<IAbstractSLocalAnalysisElement>();
+
+        if (mMultiDialog != null) {
+            for (Object vCurrentObject : mMultiDialog.getAvailableValues()) {
+                // Add each item.
+                vNotSelectedList.add((IAbstractSLocalAnalysisElement) vCurrentObject);
+            }
+        }
+
+        return vNotSelectedList;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void update(final Object pSubject) {
+        if (pSubject instanceof MultipleChoicesComposite) {
+            MultipleChoicesComposite vMultiChoicesDialog = (MultipleChoicesComposite) pSubject;
+            mSelectedList.clear();
+            mSelectedList.addAll((Collection<? extends IAbstractSLocalAnalysisElement>) vMultiChoicesDialog.getResults());
+
+            setPageComplete(checkCompletionPage());
+        }
+    }
+}
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/IPropagationWizardFactory.java b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/IPropagationWizardFactory.java
new file mode 100644
index 0000000..1e94583
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/IPropagationWizardFactory.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.globalanalysis.execution.ui.wizard;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.IWizard;
+
+/**
+ *
+ * Classes able to create wizard for propagation must implemented this interface.
+ *
+ * @author $Author: jdumont $
+ * @version $Revision: 83 $
+ */
+public interface IPropagationWizardFactory {
+
+    /**
+     * Method called to create wizard for propagation.
+     *
+     * @param pSelection selection concerned by wizard
+     * @return Wizard for propagation
+     */
+    IWizard createPropagationWizard(final ISelection pSelection);
+}
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/PropagationWizard.java b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/PropagationWizard.java
new file mode 100644
index 0000000..f1d319d
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/PropagationWizard.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.globalanalysis.execution.ui.wizard;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.polarsys.esf.core.common.ui.selection.SelectAndRevealResourceJob;
+import org.polarsys.esf.core.common.ui.wizard.AbstractGenericWizard;
+import org.polarsys.esf.esflocalanalysis.IAbstractSLocalAnalysisElement;
+import org.polarsys.esf.esflocalanalysis.ISLocalAnalysis;
+import org.polarsys.esf.globalanalysis.execution.ui.GlobalAnalysisExecutionUIActivator;
+import org.polarsys.esf.globalanalysis.execution.ui.GlobalAnalysisExecutionUIActivator.Implementation;
+
+/**
+ *
+ * Concrete propagation Wizard.
+ *
+ * @author $Author: jdumont $
+ * @version $Revision: 83 $
+ */
+public final class PropagationWizard
+    extends AbstractGenericWizard
+    implements IWizard {
+
+    /** Title of wizard window. */
+    private static final String PROPAGATION_WIZARD_TITLE = GlobalAnalysisExecutionUIActivator.getMessages().getString(
+        "PropagationWizard.title"); //$NON-NLS-1$
+
+    /** Propagation success message. */
+    private static final String PROPAGATION_SUCCEED = GlobalAnalysisExecutionUIActivator.getMessages().getString(
+        "PropagationWizard.sentence.succeed"); //$NON-NLS-1$
+
+    /**
+     * Second page of wizard, which allows to select the item to propagate.
+     * NB : Use concrete type to get access to parameter.
+     */
+    private FearedEventsSelectionPage mFearedEventsSelectionPage = null;
+
+    /** Model selected to run wizard on. */
+    private ISLocalAnalysis mSLocalAnalysis = null;
+
+    /** Propagation engine. */
+    private IInternalPropagatorEngine mPropagatorEngine = null;
+
+    /** List of feared event items from which propagate. */
+    private List<IAbstractSLocalAnalysisElement> mPropagatedFearedEventItems = null;
+
+    /** List of not propagated feared event items. */
+    private List<IAbstractSLocalAnalysisElement> mNotPropagatedFearedEventItems = null;
+
+
+    /** Utility object used to manipulate feared event items. */
+    private IFearedEventItemUtils mFearedEventUtils = null;
+
+    /** The selection given when the wizard is created. */
+    private ISelection mSelection = null;
+
+    /**
+     * Default constructor.
+     *
+     * @param pSelection selection concerned by wizard
+     */
+    public PropagationWizard(final ISelection pSelection) {
+        super(PROPAGATION_SUCCEED, false);
+
+        // Add icons
+        setDefaultPageImageDescriptor(GlobalAnalysisExecutionUIActivator.getPlugin().getImageRegistry()
+            .getDescriptor(Implementation.ICON_WIZARD_PROPAGATION_KEY));
+
+        // Set wizard window title
+        setWindowTitle(PROPAGATION_WIZARD_TITLE);
+
+        // Remember of the selection helper
+        mSelection = pSelection;
+
+        // Initialise the utils
+        mFearedEventUtils = FearedEventUtilsFactory.init().getFearedEventItemUtils();
+        mModelUtils = ModelUtilsFactory.init().getModelUtils();
+
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * This will create all the page potentially displayed,
+     * even does which won't be displayed. This is mandatory
+     * to be able to load them after.
+     */
+    @Override
+    public void addPages() {
+        // Call the parent method
+        super.addPages();
+
+        // Create the feared events selection
+        mFearedEventsSelectionPage = new FearedEventsSelectionPage();
+        addPage(mFearedEventsSelectionPage);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void prepareFinish() {
+        // Get parameters
+        readPropagationParameter();
+
+        // Update each feared event item, to modify selected status
+        for (IAbstractSLocalAnalysisElement vItem : mPropagatedFearedEventItems) {
+            mFearedEventUtils.setSelected(vItem, true);
+        }
+
+        for (IAbstractSLocalAnalysisElement vItem : mNotPropagatedFearedEventItems) {
+            mFearedEventUtils.setSelected(vItem, false);
+        }
+
+        // Save library
+        try {
+            IFearedEventsLibrary vLibrary = mModelUtils.getLibraryFromModel(mSLocalAnalysis, FearedEventsLibrary.class);
+
+            vLibrary.eResource().save(null);
+        } catch (final IOException pException) {
+            AnalysisCoreUIActivator.logError(pException.getMessage(), pException);
+        }
+    }
+
+    /**
+     * Read all parameters from wizard pages.
+     */
+    private void readPropagationParameter() {
+
+        // Selected feared event items to propagate
+        mPropagatedFearedEventItems = mFearedEventsSelectionPage.getSelectedList();
+
+        // Not selected feared event items
+        mNotPropagatedFearedEventItems = mFearedEventsSelectionPage.getNotSelectedList();
+
+        // Get the selected propagation engine and read its specific parameters
+        mPropagatorEngine = mEngineSelectionPage.getSelectedEngine();
+        mPropagatorEngine.readSpecificParameters();
+
+
+    }
+
+    /**
+     * Wizard save selected model to share between page and job.
+     *
+     * @param pModel Model to share.
+     */
+    public void setModel(final ISLocalAnalysis pModel) {
+        mSLocalAnalysis = pModel;
+        mFearedEventsSelectionPage.initSelectionLists();
+    }
+
+    /**
+     * @return Current model.
+     */
+    public ISLocalAnalysis getModel() {
+        return mSLocalAnalysis;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected IStatus doFinish(final IProgressMonitor pMonitor) {
+        IStatus vStatus = null;
+
+        vStatus = runPropagation(pMonitor);
+
+        // Finally, run an asynchronous job to show the results
+        // NB : This is voluntary performed even if the propagation failed, or finished with a warning
+        SelectAndRevealResourceJob vSelectJob =
+            new SelectAndRevealResourceJob(mPropagatorEngine.getResultsFolder());
+        vSelectJob.schedule();
+
+        return vStatus;
+    }
+
+    /**
+     * Run the propagation.
+     *
+     * @param pMonitor Used to follow propagation progression
+     * @return A status, according to final results
+     */
+    private IStatus runPropagation(final IProgressMonitor pMonitor) {
+        return mPropagatorEngine.propagateSAModel(mSLocalAnalysis, pMonitor);
+    }
+}
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/PropagationWizardFactory.java b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/PropagationWizardFactory.java
new file mode 100644
index 0000000..d70389f
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/java/org/polarsys/esf/globalanalysis/execution/ui/wizard/PropagationWizardFactory.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.globalanalysis.execution.ui.wizard;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.IWizard;
+
+/**
+ *
+ * Concrete factory for propagation wizard.
+ *
+ * @author $Author: jdumont $
+ * @version $Revision: 83 $
+ */
+public final class PropagationWizardFactory
+    implements IPropagationWizardFactory {
+
+    /**
+     * Default constructor.
+     */
+    public PropagationWizardFactory() {
+        super();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IWizard createPropagationWizard(final ISelection pSelection) {
+        IWizard vPropagationWizard = new PropagationWizard(pSelection);
+
+        return vPropagationWizard;
+    }
+
+}
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/icons/icon_propagation.png b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/icons/icon_propagation.png
new file mode 100644
index 0000000..3f228e7
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/icons/icon_propagation.png
Binary files differ
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/icons/wizard_propagation.png b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/icons/wizard_propagation.png
new file mode 100644
index 0000000..51cbb05
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/icons/wizard_propagation.png
Binary files differ
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/properties/nls/messages.properties b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/properties/nls/messages.properties
new file mode 100644
index 0000000..ccdee37
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/properties/nls/messages.properties
@@ -0,0 +1,12 @@
+PropagationPreferencePage.label.engine     = Default engine : 
+PropagationPreferencePage.label.runcontrol = Run control before propagation by default
+
+PropagationWizard.job.focus                          = Show Info.log
+PropagationWizard.sentence.coherence.failed          = Propagation not done, control of coherence failed.
+PropagationWizard.title                              = Propagation
+PropagationWizard.sentence.succeed					 = Propagation successful
+
+PropagationWizardFearedEventsSelectionPage.description          = Generic propagation options
+PropagationWizardFearedEventsSelectionPage.description.label.list.available = Feared events referenced in local analysis
+PropagationWizardFearedEventsSelectionPage.description.label.list.selected  = Propagated events
+PropagationWizardFearedEventsSelectionPage.description.title                = Common options
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/properties/plugin.properties b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/properties/plugin.properties
new file mode 100644
index 0000000..7c78d77
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution.ui/src/main/resources/properties/plugin.properties
@@ -0,0 +1,9 @@
+#Properties file for org.polarsys.esf.globalanalysis.execution.ui
+Bundle-Name=Global Analysis Execution UI
+Bundle-Vendor=PolarSys
+
+menucontext.analysis.ui.analysis.tools.menu.label = ESF Analysis Tools
+
+menucontext.execution.ui.menu.label = ESF Global Analysis
+menucontext.execution.ui.new.propagation.label = Start new Propagation
+menucontext.execution.ui.new.propagation.description = Start new Progation
\ No newline at end of file
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.classpath b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.classpath
new file mode 100644
index 0000000..d97031b
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="output" path="target/classes/"/>
+</classpath>
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.project b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.project
new file mode 100644
index 0000000..d5aa941
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.polarsys.esf.globalanalysis.execution</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.settings/org.eclipse.jdt.core.prefs b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/META-INF/MANIFEST.MF b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..378423e
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: src/main/resources/properties/plugin
+Bundle-SymbolicName: org.polarsys.esf.globalanalysis.execution;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-Activator: org.polarsys.esf.globalanalysis.execution.GlobalAnalysisExecutionActivator$Implementation
+Require-Bundle: org.eclipse.core.runtime,
+ org.polarsys.esf.core.utils;bundle-version="0.7.0";visibility:=reexport,
+ org.eclipse.uml2.uml,
+ org.polarsys.esf.localanalysis.profile;bundle-version="0.7.0";visibility:=reexport
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Export-Package: org.polarsys.esf.globalanalysis.execution.propagation
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/about.html b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/about.html
new file mode 100644
index 0000000..d35d5ae
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 5, 2007</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/build.properties b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/build.properties
new file mode 100644
index 0000000..04d297d
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/build.properties
@@ -0,0 +1,6 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+               .,\
+               src/main/resources/properties/,\
+               about.html
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/pom.xml b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/pom.xml
new file mode 100644
index 0000000..b77687d
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/pom.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
+  http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <parent>
+    <groupId>org.polarsys.esf</groupId>
+    <artifactId>esf-tools.analysis.globalanalysis.execution</artifactId>
+    <version>0.7.0-SNAPSHOT</version>
+  </parent>
+  
+  <groupId>org.polarsys.esf</groupId>
+  <artifactId>org.polarsys.esf.globalanalysis.execution</artifactId>
+  <packaging>eclipse-plugin</packaging>
+  <name>Global Analysis Execution</name>
+  <description>Global Analysis Execution description.</description>
+
+</project>
\ No newline at end of file
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/java/org/polarsys/esf/globalanalysis/execution/GlobalAnalysisExecutionActivator.java b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/java/org/polarsys/esf/globalanalysis/execution/GlobalAnalysisExecutionActivator.java
new file mode 100644
index 0000000..7d09a79
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/java/org/polarsys/esf/globalanalysis/execution/GlobalAnalysisExecutionActivator.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.globalanalysis.execution;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ *
+ * @author $Author: ymunoz $
+ * @version $Revision: 168 $
+ */
+public class GlobalAnalysisExecutionActivator extends EMFPlugin implements BundleActivator {
+
+    /** Keep track of the encapsulating singleton. */
+    public static final GlobalAnalysisExecutionActivator INSTANCE = new GlobalAnalysisExecutionActivator();
+
+    /** Execution context for the bundle. */
+    private static BundleContext sBundleContext = null;
+
+    /** Keep track of the implementation singleton. */
+    private static Implementation sPlugin = null;
+
+    /**
+     * Create the instance.
+     */
+    public GlobalAnalysisExecutionActivator() {
+        super(new ResourceLocator[] {});
+    }
+
+    /**
+     * Get BundlexContext.
+     *
+     * @return BundleContext
+     */
+    static BundleContext getContext() {
+        return sBundleContext;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * Added to ensure that the activator can work with the profile mechanisms.
+     */
+    @Override
+    public void start(final BundleContext pContext) throws Exception {
+        sBundleContext = pContext;
+
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * Added to ensure that the activator can work with the profile mechanisms.
+     */
+    @Override
+    public void stop(final BundleContext pContext) throws Exception {
+        sBundleContext = null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ResourceLocator getPluginResourceLocator() {
+        return sPlugin;
+    }
+
+    /**
+     * Returns the singleton instance of the Eclipse plugin.
+     *
+     * @return The singleton instance
+     */
+    public static Implementation getPlugin() {
+        return sPlugin;
+    }
+
+    /**
+     * The actual implementation of the Eclipse <b>UIPlugin</b>.
+     */
+    public static class Implementation
+        extends EclipsePlugin {
+
+        /**
+         * Creates an instance.
+         */
+        public Implementation() {
+            super();
+
+            // Remember of the static instance
+            sPlugin = this;
+        }
+    }
+}
\ No newline at end of file
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/java/org/polarsys/esf/globalanalysis/execution/propagation/NewPropagation.java b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/java/org/polarsys/esf/globalanalysis/execution/propagation/NewPropagation.java
new file mode 100644
index 0000000..09295ee
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/java/org/polarsys/esf/globalanalysis/execution/propagation/NewPropagation.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.globalanalysis.execution.propagation;
+
+import org.polarsys.esf.esflocalanalysis.ISLocalAnalysis;
+
+/**
+ * Class for starting a new propagation.
+ *
+ * @author $Author: ymunoz $
+ * @version $Revision: 168 $
+ */
+public final class NewPropagation {
+
+    /**
+     * Default constructorr, private as it's a utility class.
+     */
+    private NewPropagation() {
+    }
+
+    /**
+     * Start a new Propagation.
+     *
+     * @param pSLocalAnalysis The SLocalAnalysis to be analysed
+     */
+    public static void start(final ISLocalAnalysis pSLocalAnalysis) {
+        System.out.println(pSLocalAnalysis.getName());
+    }
+}
diff --git a/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/resources/properties/plugin.properties b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/resources/properties/plugin.properties
new file mode 100644
index 0000000..30d6380
--- /dev/null
+++ b/analysis/globalanalysis/execution/org.polarsys.esf.globalanalysis.execution/src/main/resources/properties/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.polarsys.esf.globalanalysis.execution
+Bundle-Name=Global Analysis Execution
+Bundle-Vendor=PolarSys
\ No newline at end of file
diff --git a/analysis/globalanalysis/execution/pom.xml b/analysis/globalanalysis/execution/pom.xml
new file mode 100644
index 0000000..86966de
--- /dev/null
+++ b/analysis/globalanalysis/execution/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
+  http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <!-- PROJECT DESCRIPTION -->
+  <parent>
+    <groupId>org.polarsys.esf</groupId>
+    <artifactId>esf-tools.analysis.globalanalysis</artifactId>
+    <version>0.7.0-SNAPSHOT</version>
+  </parent>
+  
+  <groupId>org.polarsys.esf</groupId>
+  <artifactId>esf-tools.analysis.globalanalysis.execution</artifactId>
+  <packaging>pom</packaging>
+  <name>ESF Global Analysis Execution</name>
+  <description>ESF Global Analysis Execution description.</description>
+  
+  <!-- MODULES -->  
+  <modules>
+    <module>org.polarsys.esf.globalanalysis.execution</module>
+    <module>org.polarsys.esf.globalanalysis.execution.ui</module>
+  </modules>
+</project>
\ No newline at end of file
diff --git a/analysis/globalanalysis/pom.xml b/analysis/globalanalysis/pom.xml
new file mode 100644
index 0000000..283ae1e
--- /dev/null
+++ b/analysis/globalanalysis/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
+  http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <!-- PROJECT DESCRIPTION -->
+  <parent>
+    <groupId>org.polarsys.esf</groupId>
+    <artifactId>esf-tools.analysis</artifactId>
+    <version>0.7.0-SNAPSHOT</version>
+  </parent>
+  
+  <groupId>org.polarsys.esf</groupId>
+  <artifactId>esf-tools.analysis.globalanalysis</artifactId>
+  <packaging>pom</packaging>
+  <name>ESF Tools Global Analysis</name>
+  <description>ESF Tools Global Analysis description</description>
+  
+  <!-- MODULES -->  
+  <modules>
+	<module>execution</module>
+  </modules>
+  
+</project>
diff --git a/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/FearedEventItemUtils.java b/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/FearedEventItemUtils.java
new file mode 100644
index 0000000..b41dc0a
--- /dev/null
+++ b/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/FearedEventItemUtils.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.localanalysis.profile.tools.util;
+
+import java.security.InvalidParameterException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.polarsys.esf.esflocalanalysis.IAbstractSFailureModeLAnalysis;
+import org.polarsys.esf.esflocalanalysis.IAbstractSLocalAnalysisElement;
+import org.polarsys.esf.esflocalanalysis.ISFearedEvent;
+import org.polarsys.esf.esflocalanalysis.ISFearedEventsFamily;
+import org.polarsys.esf.esflocalanalysis.ISFearedEventsLibrary;
+
+/**
+ * Utility class used with item of feared event library.
+ *
+ * @author $Author: jdumont $
+ * @version $Revision: 83 $
+ */
+public class FearedEventItemUtils
+    implements IFearedEventItemUtils {
+
+    /**
+     * Default constructor.
+     */
+    public FearedEventItemUtils() {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setSelected(final IAbstractSLocalAnalysisElement pObject, final boolean pValue) {
+        if (pObject instanceof ISFearedEvent) {
+            ((ISFearedEvent) pObject).setIsSelected(pValue);
+        } else if (pObject instanceof ISFearedEventsFamily) {
+            ((ISFearedEventsFamily) pObject).setIsSelected(pValue);
+        } else {
+            throw new InvalidParameterException();
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isSelected(final IAbstractSLocalAnalysisElement pObject) {
+        boolean vResult = false;
+
+        if (pObject instanceof ISFearedEvent) {
+            vResult = ((ISFearedEvent) pObject).isSelected();
+        } else if (pObject instanceof ISFearedEventsFamily) {
+            vResult = ((ISFearedEventsFamily) pObject).isSelected();
+        } else {
+            throw new InvalidParameterException();
+        }
+
+        return vResult;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Set<IAbstractSFailureModeLAnalysis> getFailureModesForPropagation(
+        final IAbstractSLocalAnalysisElement pFearedEventItem) {
+
+        Set<IAbstractSFailureModeLAnalysis> vReturnedSet = new HashSet<IAbstractSFailureModeLAnalysis>();
+
+        // Check if parameter is not null
+        if (pFearedEventItem != null) {
+
+            // Run exploration
+            extractAssociatedFailureModes(pFearedEventItem, vReturnedSet, false);
+        }
+
+        return vReturnedSet;
+    }
+
+    /**
+     * Recursive method to extract associated failure modes with <b>selected</b> feared events library items. Method
+     * fills a set of failure modes during exploration.
+     *
+     * <p>
+     * With a set, we are certain that there is not doublon.
+     * </p>
+     *
+     * @param pFearedEventsLibraryItem Feared events library to handle
+     * @param pAssociatedFailureModesSet Set to fill
+     * @param pSelectedParent <code>true</code> if ancestor of item is selected, otherwise <code>false</code>
+     */
+    private void extractAssociatedFailureModes(
+        final IAbstractSLocalAnalysisElement pFearedEventsLibraryItem,
+        final Set<IAbstractSFailureModeLAnalysis> pAssociatedFailureModesSet,
+        final boolean pSelectedParent) {
+
+        // If item is a library so root element
+        if (pFearedEventsLibraryItem instanceof ISFearedEventsLibrary) {
+
+            // Explore all family to extract linked selected item
+            for (ISFearedEvent vFearedEvent : ((ISFearedEventsLibrary) pFearedEventsLibraryItem)
+                .getSFearedEventsList()) {
+                extractAssociatedFailureModes(vFearedEvent, pAssociatedFailureModesSet, false);
+            }
+
+            // Then explore all feared events at root to extract selected feared events that is not contained in family
+            // children
+            for (ISFearedEventsFamily vFamily : ((ISFearedEventsLibrary) pFearedEventsLibraryItem)
+                .getSFearedEventsFamiliesList()) {
+                extractAssociatedFailureModes(vFamily, pAssociatedFailureModesSet, false);
+            }
+
+        } else if (pFearedEventsLibraryItem instanceof ISFearedEvent) {
+            // If item is a feared event,
+            // add associated failure mode if it or its parent is selected
+            if (pSelectedParent || ((ISFearedEvent) pFearedEventsLibraryItem).isSelected()) {
+                pAssociatedFailureModesSet
+                    .addAll(((ISFearedEvent) pFearedEventsLibraryItem).getSFailureModesLAnalysisList());
+            }
+
+        } else if (pFearedEventsLibraryItem instanceof ISFearedEventsFamily) {
+            // If item is a family
+
+            // Add associated failure if it or its parent is selected
+            boolean vSelectedFamily = ((ISFearedEventsFamily) pFearedEventsLibraryItem).isSelected();
+            if (vSelectedFamily || pSelectedParent) {
+                pAssociatedFailureModesSet
+                    .addAll(((ISFearedEventsFamily) pFearedEventsLibraryItem).getSFailureModesLAnalysisList());
+            }
+
+            // Pass selection state to children exploration
+            // First explore sub family
+            for (ISFearedEventsFamily vSubFamily : ((ISFearedEventsFamily) pFearedEventsLibraryItem)
+                .getSubFamiliesList()) {
+                extractAssociatedFailureModes(vSubFamily, pAssociatedFailureModesSet, vSelectedFamily);
+            }
+
+            // Then linked feared events
+            for (ISFearedEvent vFearedEvent : ((ISFearedEventsFamily) pFearedEventsLibraryItem)
+                .getAllSFearedEventsList()) {
+                extractAssociatedFailureModes(vFearedEvent, pAssociatedFailureModesSet, vSelectedFamily);
+            }
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isFamilyEmpty(final ISFearedEventsFamily pFamily) {
+
+        // Check if the family contains some feared events
+        boolean vEmpty = pFamily.getSFearedEventsList().isEmpty();
+
+        // If the family doesn't contain any feared event, check if it contains
+        // only empty sub families, as soon as one non empty sub family is found,
+        // the current family is not considered as empty
+        int vIndex = 0;
+        while (vEmpty && vIndex < pFamily.getSubFamiliesList().size()) {
+            vEmpty = isFamilyEmpty(pFamily.getSubFamiliesList().get(vIndex));
+
+            vIndex++;
+        }
+
+        return vEmpty;
+    }
+}
diff --git a/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/FearedEventUtilsFactory.java b/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/FearedEventUtilsFactory.java
new file mode 100644
index 0000000..fa4f304
--- /dev/null
+++ b/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/FearedEventUtilsFactory.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.localanalysis.profile.tools.util;
+
+/**
+ * Factory for utility classes about feared event items.
+ *
+ * @author $Author: jdumont $
+ * @version $Revision: 83 $
+ */
+public final class FearedEventUtilsFactory
+    implements IFearedEventUtilsFactory {
+
+    /**
+     * Utility class for feared event items.
+     */
+    private IFearedEventItemUtils mFearedEventItemUtils = null;
+
+    /**
+     * Default constructor.
+     *
+     * Private to avoid instantiation.
+     */
+    private FearedEventUtilsFactory() {
+    }
+
+    /**
+     * Create and initialise a new factory.
+     *
+     * @return A new factory.
+     */
+    public static IFearedEventUtilsFactory init() {
+        IFearedEventUtilsFactory vFactory = new FearedEventUtilsFactory();
+
+        vFactory.setFearedEventItemUtils(new FearedEventItemUtils());
+
+        return vFactory;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IFearedEventItemUtils getFearedEventItemUtils() {
+        return mFearedEventItemUtils;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setFearedEventItemUtils(final IFearedEventItemUtils pFearedEventItemUtils) {
+        mFearedEventItemUtils = pFearedEventItemUtils;
+    }
+}
diff --git a/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/IFearedEventItemUtils.java b/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/IFearedEventItemUtils.java
new file mode 100644
index 0000000..8c65fe3
--- /dev/null
+++ b/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/IFearedEventItemUtils.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.localanalysis.profile.tools.util;
+
+import java.util.Set;
+
+import org.polarsys.esf.esflocalanalysis.IAbstractSFailureModeLAnalysis;
+import org.polarsys.esf.esflocalanalysis.IAbstractSLocalAnalysisElement;
+import org.polarsys.esf.esflocalanalysis.ISFearedEventsFamily;
+
+/**
+ * Interface which offers facilities about Library items.
+ *
+ * @author $Author: jdumont $
+ * @version $Revision: 83 $
+ */
+public interface IFearedEventItemUtils {
+
+    /**
+     * Set the selected status.
+     *
+     * WARNING : concrete type of pObject must be {@link FearedEvent} or {@link FearedEventsFamily}
+     *
+     * @param pObject Target for which selected status will be modified
+     * @param pValue The value to set
+     */
+    void setSelected(IAbstractSLocalAnalysisElement pObject, boolean pValue);
+
+    /**
+     * Get if current item is selected.
+     *
+     * WARNING : concrete type of pObject must be {@link FearedEvent} or {@link FearedEventsFamily}
+     *
+     * @param pObject Object for which selected status is computed
+     * @return The selected status
+     */
+    boolean isSelected(IAbstractSLocalAnalysisElement pObject);
+
+    /**
+     * Get associated failure modes with <b>selected</b> feared events library items.
+     *
+     * @param pFearedEventItem Root element where exploration begin
+     * @return Set of found failure modes
+     */
+    Set<IAbstractSFailureModeLAnalysis> getFailureModesForPropagation(IAbstractSLocalAnalysisElement pFearedEventItem);
+
+    /**
+     * Recursive method which check if a family contains at least one feared event,
+     * or one non empty sub family. In these case, the given family is not considered as empty.
+     *
+     * @param pFamily The family to check
+     * @return <code>true</code> if the given family is empty
+     */
+    boolean isFamilyEmpty(final ISFearedEventsFamily pFamily);
+
+}
diff --git a/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/IFearedEventUtilsFactory.java b/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/IFearedEventUtilsFactory.java
new file mode 100644
index 0000000..58d45a8
--- /dev/null
+++ b/analysis/localanalysis/profile/org.polarsys.esf.localanalysis.profile.tools/src/main/java/org/polarsys/esf/localanalysis/profile/tools/util/IFearedEventUtilsFactory.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2016 ALL4TEC & CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * 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:
+ *     ALL4TEC & CEA LIST - initial API and implementation
+ ******************************************************************************/
+package org.polarsys.esf.localanalysis.profile.tools.util;
+
+/**
+ * Utility used with item of feared event library.
+ *
+ * @author $Author: jdumont $
+ * @version $Revision: 83 $
+ */
+public interface IFearedEventUtilsFactory {
+
+    /**
+     * @return The feared event item utility
+     */
+    IFearedEventItemUtils getFearedEventItemUtils();
+
+    /**
+     * @param pFearedEventItemUtils The feared event item utility class to set
+     */
+    void setFearedEventItemUtils(IFearedEventItemUtils pFearedEventItemUtils);
+
+}