[496238] fixed the reordering of transitions from property sheet

The change transition priority command did only change the order in
the state's transition list but not in the overall ecc's transtion list.
For storing the latter is the important one. with this commit both lists
are now correctly updated.


Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=496238
Signed-off-by: Alois Zoitl <alois.zoitl@gmx.at>
diff --git a/plugins/org.eclipse.fordiac.ide.fbtypeeditor.ecc/src/org/eclipse/fordiac/ide/fbtypeeditor/ecc/commands/ChangeTransitionPriorityCommand.java b/plugins/org.eclipse.fordiac.ide.fbtypeeditor.ecc/src/org/eclipse/fordiac/ide/fbtypeeditor/ecc/commands/ChangeTransitionPriorityCommand.java
index a690983..b932463 100644
--- a/plugins/org.eclipse.fordiac.ide.fbtypeeditor.ecc/src/org/eclipse/fordiac/ide/fbtypeeditor/ecc/commands/ChangeTransitionPriorityCommand.java
+++ b/plugins/org.eclipse.fordiac.ide.fbtypeeditor.ecc/src/org/eclipse/fordiac/ide/fbtypeeditor/ecc/commands/ChangeTransitionPriorityCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2015 fortiss GmbH
+ * Copyright (c) 2015, 2017 fortiss GmbH
  * 
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Monika Wenger
+ *   Monika Wenger, Alois Zoitl
  *     - initial API and implementation and/or initial documentation
  *******************************************************************************/
 package org.eclipse.fordiac.ide.fbtypeeditor.ecc.commands;
@@ -18,37 +18,46 @@
 
 public class ChangeTransitionPriorityCommand extends Command {
 	protected final ECTransition transition;
-	protected ECState state;
-	protected int index;
-	protected boolean up;
+	protected final ECState state;
+	protected final boolean up;
+	protected final int oldStateIndex;
+	protected final int newStateIndex;
+	protected final int oldECCTransitionIndex;
+	protected int newECCTransitionIndex;
 
 	public ChangeTransitionPriorityCommand(final ECState state, final ECTransition transition, boolean up) {
 		this.transition = transition;
-		this.up = up;
 		this.state = state;
-		this.index = state.getOutTransitions().indexOf(transition);
+		this.up = up;
+		this.oldStateIndex = state.getOutTransitions().indexOf(transition);
+		newStateIndex = oldStateIndex + (up ? -1 : 1); 
+		oldECCTransitionIndex = transition.getECC().getECTransition().indexOf(transition);
 	}
 
 	@Override
 	public boolean canExecute() {
-		return state.getOutTransitions().size() > 1 && ( (up && index > 0) || (!up && index < state.getOutTransitions().size()));
+		return state.getOutTransitions().size() > 1 && ( (up && oldStateIndex > 0) || (!up && oldStateIndex < state.getOutTransitions().size()));
 	}
 
 	@Override
 	public void execute() {
-		state.getOutTransitions().remove(state.getOutTransitions().indexOf(transition));
-		state.getOutTransitions().add(up? (index - 1) : (index + 1), transition);
+		//it is better to calculate these values here as then we have the checks in canExecute performed and know new index is valid
+		ECTransition referenceTransition = state.getOutTransitions().get(newStateIndex);
+		newECCTransitionIndex = transition.getECC().getECTransition().indexOf(referenceTransition); 
+		redo();
 	}
 
 	@Override
 	public void redo() {
-		state.getOutTransitions().remove(state.getOutTransitions().indexOf(transition));
-		state.getOutTransitions().add(up? (index - 1) : (index + 1), transition);
+		//change order in state model
+		state.getOutTransitions().move(newStateIndex, transition);
+		//change order in overall transition list
+		transition.getECC().getECTransition().move(newECCTransitionIndex, transition);
 	}
 
 	@Override
 	public void undo() {
-		state.getOutTransitions().remove(state.getOutTransitions().indexOf(transition));
-		state.getOutTransitions().add(index, transition);
+		state.getOutTransitions().move(oldStateIndex, transition);
+		transition.getECC().getECTransition().move(oldECCTransitionIndex, transition);
 	}
 }
diff --git a/plugins/org.eclipse.fordiac.ide.model/model/lib.ecore b/plugins/org.eclipse.fordiac.ide.model/model/lib.ecore
index 70da6b3..5aed57e 100644
--- a/plugins/org.eclipse.fordiac.ide.model/model/lib.ecore
+++ b/plugins/org.eclipse.fordiac.ide.model/model/lib.ecore
@@ -296,6 +296,11 @@
         <details key="body" value="return org.eclipse.fordiac.ide.model.Annotations.GEN.getConditionText(this);"/>
       </eAnnotations>
     </eOperations>
+    <eOperations name="getECC" lowerBound="1" eType="#//ECC">
+      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+        <details key="body" value="return org.eclipse.fordiac.ide.model.Annotations.GEN.getECC(this);"/>
+      </eAnnotations>
+    </eOperations>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="comment" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
       <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
         <details key="kind" value="attribute"/>
diff --git a/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/ECTransition.java b/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/ECTransition.java
index f358d67..5709be6 100644
--- a/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/ECTransition.java
+++ b/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/ECTransition.java
@@ -1,182 +1,191 @@
-/********************************************************************************

- * Copyright (c) 2008 - 2017 Profactor GmbH, TU Wien ACIN, fortiss GmbH

- * 

- * 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:

- *  Gerhard Ebenhofer, Alois Zoitl, Ingo Hegny, Monika Wenger

- *    - initial API and implementation and/or initial documentation

- ********************************************************************************/

-package org.eclipse.fordiac.ide.model.libraryElement;

-

-/**

- * <!-- begin-user-doc -->

- * A representation of the model object '<em><b>EC Transition</b></em>'.

- * <!-- end-user-doc -->

- *

- * <p>

- * The following features are supported:

- * </p>

- * <ul>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getComment <em>Comment</em>}</li>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getConditionExpression <em>Condition Expression</em>}</li>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getSource <em>Source</em>}</li>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getDestination <em>Destination</em>}</li>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getConditionEvent <em>Condition Event</em>}</li>

- * </ul>

- *

- * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition()

- * @model

- * @generated

- */

-public interface ECTransition extends PositionableElement {

-	/**

-	 * Returns the value of the '<em><b>Comment</b></em>' attribute.

-	 * <!-- begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>Comment</em>' attribute isn't clear,

-	 * there really should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * @return the value of the '<em>Comment</em>' attribute.

-	 * @see #setComment(String)

-	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_Comment()

-	 * @model dataType="org.eclipse.emf.ecore.xml.type.String"

-	 *        extendedMetaData="kind='attribute' name='Comment'"

-	 * @generated

-	 */

-	String getComment();

-

-	/**

-	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getComment <em>Comment</em>}' attribute.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @param value the new value of the '<em>Comment</em>' attribute.

-	 * @see #getComment()

-	 * @generated

-	 */

-	void setComment(String value);

-

-	/**

-	 * Returns the value of the '<em><b>Condition Expression</b></em>' attribute.

-	 * <!-- begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>Condition Expression</em>' attribute isn't clear,

-	 * there really should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * @return the value of the '<em>Condition Expression</em>' attribute.

-	 * @see #setConditionExpression(String)

-	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_ConditionExpression()

-	 * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"

-	 *        extendedMetaData="kind='attribute' name='Condition'"

-	 * @generated

-	 */

-	String getConditionExpression();

-

-	/**

-	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getConditionExpression <em>Condition Expression</em>}' attribute.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @param value the new value of the '<em>Condition Expression</em>' attribute.

-	 * @see #getConditionExpression()

-	 * @generated

-	 */

-	void setConditionExpression(String value);

-

-	/**

-	 * Returns the value of the '<em><b>Destination</b></em>' reference.

-	 * It is bidirectional and its opposite is '{@link org.eclipse.fordiac.ide.model.libraryElement.ECState#getInTransitions <em>In Transitions</em>}'.

-	 * <!-- begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>Destination</em>' attribute isn't clear,

-	 * there really should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * @return the value of the '<em>Destination</em>' reference.

-	 * @see #setDestination(ECState)

-	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_Destination()

-	 * @see org.eclipse.fordiac.ide.model.libraryElement.ECState#getInTransitions

-	 * @model opposite="inTransitions" required="true"

-	 * @generated

-	 */

-	ECState getDestination();

-

-	/**

-	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getDestination <em>Destination</em>}' reference.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @param value the new value of the '<em>Destination</em>' reference.

-	 * @see #getDestination()

-	 * @generated

-	 */

-	void setDestination(ECState value);

-

-	/**

-	 * Returns the value of the '<em><b>Condition Event</b></em>' reference.

-	 * <!-- begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>Condition Event</em>' reference isn't clear,

-	 * there really should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * @return the value of the '<em>Condition Event</em>' reference.

-	 * @see #setConditionEvent(Event)

-	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_ConditionEvent()

-	 * @model

-	 * @generated

-	 */

-	Event getConditionEvent();

-

-	/**

-	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getConditionEvent <em>Condition Event</em>}' reference.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @param value the new value of the '<em>Condition Event</em>' reference.

-	 * @see #getConditionEvent()

-	 * @generated

-	 */

-	void setConditionEvent(Event value);

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @model kind="operation" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"

-	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='return org.eclipse.fordiac.ide.model.Annotations.GEN.getConditionText(this);'"

-	 * @generated

-	 */

-	String getConditionText();

-

-	/**

-	 * Returns the value of the '<em><b>Source</b></em>' reference.

-	 * It is bidirectional and its opposite is '{@link org.eclipse.fordiac.ide.model.libraryElement.ECState#getOutTransitions <em>Out Transitions</em>}'.

-	 * <!-- begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>Source</em>' attribute isn't clear,

-	 * there really should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * @return the value of the '<em>Source</em>' reference.

-	 * @see #setSource(ECState)

-	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_Source()

-	 * @see org.eclipse.fordiac.ide.model.libraryElement.ECState#getOutTransitions

-	 * @model opposite="outTransitions" required="true"

-	 * @generated

-	 */

-	ECState getSource();

-

-	/**

-	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getSource <em>Source</em>}' reference.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @param value the new value of the '<em>Source</em>' reference.

-	 * @see #getSource()

-	 * @generated

-	 */

-	void setSource(ECState value);

-

-	

-} // ECTransition

+/********************************************************************************
+ * Copyright (c) 2008 - 2017 Profactor GmbH, TU Wien ACIN, fortiss GmbH
+ * 
+ * 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:
+ *  Gerhard Ebenhofer, Alois Zoitl, Ingo Hegny, Monika Wenger
+ *    - initial API and implementation and/or initial documentation
+ ********************************************************************************/
+package org.eclipse.fordiac.ide.model.libraryElement;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>EC Transition</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getComment <em>Comment</em>}</li>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getConditionExpression <em>Condition Expression</em>}</li>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getSource <em>Source</em>}</li>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getDestination <em>Destination</em>}</li>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getConditionEvent <em>Condition Event</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition()
+ * @model
+ * @generated
+ */
+public interface ECTransition extends PositionableElement {
+	/**
+	 * Returns the value of the '<em><b>Comment</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Comment</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Comment</em>' attribute.
+	 * @see #setComment(String)
+	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_Comment()
+	 * @model dataType="org.eclipse.emf.ecore.xml.type.String"
+	 *        extendedMetaData="kind='attribute' name='Comment'"
+	 * @generated
+	 */
+	String getComment();
+
+	/**
+	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getComment <em>Comment</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Comment</em>' attribute.
+	 * @see #getComment()
+	 * @generated
+	 */
+	void setComment(String value);
+
+	/**
+	 * Returns the value of the '<em><b>Condition Expression</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Condition Expression</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Condition Expression</em>' attribute.
+	 * @see #setConditionExpression(String)
+	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_ConditionExpression()
+	 * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+	 *        extendedMetaData="kind='attribute' name='Condition'"
+	 * @generated
+	 */
+	String getConditionExpression();
+
+	/**
+	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getConditionExpression <em>Condition Expression</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Condition Expression</em>' attribute.
+	 * @see #getConditionExpression()
+	 * @generated
+	 */
+	void setConditionExpression(String value);
+
+	/**
+	 * Returns the value of the '<em><b>Destination</b></em>' reference.
+	 * It is bidirectional and its opposite is '{@link org.eclipse.fordiac.ide.model.libraryElement.ECState#getInTransitions <em>In Transitions</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Destination</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Destination</em>' reference.
+	 * @see #setDestination(ECState)
+	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_Destination()
+	 * @see org.eclipse.fordiac.ide.model.libraryElement.ECState#getInTransitions
+	 * @model opposite="inTransitions" required="true"
+	 * @generated
+	 */
+	ECState getDestination();
+
+	/**
+	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getDestination <em>Destination</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Destination</em>' reference.
+	 * @see #getDestination()
+	 * @generated
+	 */
+	void setDestination(ECState value);
+
+	/**
+	 * Returns the value of the '<em><b>Condition Event</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Condition Event</em>' reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Condition Event</em>' reference.
+	 * @see #setConditionEvent(Event)
+	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_ConditionEvent()
+	 * @model
+	 * @generated
+	 */
+	Event getConditionEvent();
+
+	/**
+	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getConditionEvent <em>Condition Event</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Condition Event</em>' reference.
+	 * @see #getConditionEvent()
+	 * @generated
+	 */
+	void setConditionEvent(Event value);
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @model kind="operation" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='return org.eclipse.fordiac.ide.model.Annotations.GEN.getConditionText(this);'"
+	 * @generated
+	 */
+	String getConditionText();
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @model kind="operation" required="true"
+	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='return org.eclipse.fordiac.ide.model.Annotations.GEN.getECC(this);'"
+	 * @generated
+	 */
+	ECC getECC();
+
+	/**
+	 * Returns the value of the '<em><b>Source</b></em>' reference.
+	 * It is bidirectional and its opposite is '{@link org.eclipse.fordiac.ide.model.libraryElement.ECState#getOutTransitions <em>Out Transitions</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Source</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Source</em>' reference.
+	 * @see #setSource(ECState)
+	 * @see org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage#getECTransition_Source()
+	 * @see org.eclipse.fordiac.ide.model.libraryElement.ECState#getOutTransitions
+	 * @model opposite="outTransitions" required="true"
+	 * @generated
+	 */
+	ECState getSource();
+
+	/**
+	 * Sets the value of the '{@link org.eclipse.fordiac.ide.model.libraryElement.ECTransition#getSource <em>Source</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Source</em>' reference.
+	 * @see #getSource()
+	 * @generated
+	 */
+	void setSource(ECState value);
+
+	
+} // ECTransition
diff --git a/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/impl/ECTransitionImpl.java b/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/impl/ECTransitionImpl.java
index 7650abc..a34a0d9 100644
--- a/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/impl/ECTransitionImpl.java
+++ b/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/impl/ECTransitionImpl.java
@@ -1,497 +1,507 @@
-/********************************************************************************

- * Copyright (c) 2008 - 2017 Profactor GmbH, TU Wien ACIN, fortiss GmbH

- * 

- * 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:

- *  Gerhard Ebenhofer, Alois Zoitl, Ingo Hegny, Monika Wenger

- *    - initial API and implementation and/or initial documentation

- ********************************************************************************/

-package org.eclipse.fordiac.ide.model.libraryElement.impl;

-

-import org.eclipse.emf.common.notify.Notification;

-import org.eclipse.emf.common.notify.NotificationChain;

-import org.eclipse.emf.ecore.EClass;

-import org.eclipse.emf.ecore.InternalEObject;

-import org.eclipse.emf.ecore.impl.ENotificationImpl;

-import org.eclipse.fordiac.ide.model.libraryElement.ECState;

-import org.eclipse.fordiac.ide.model.libraryElement.ECTransition;

-import org.eclipse.fordiac.ide.model.libraryElement.Event;

-import org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage;

-

-/**

- * <!-- begin-user-doc -->

- * An implementation of the model object '<em><b>EC Transition</b></em>'.

- * <!-- end-user-doc -->

- * <p>

- * The following features are implemented:

- * </p>

- * <ul>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getComment <em>Comment</em>}</li>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getConditionExpression <em>Condition Expression</em>}</li>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getSource <em>Source</em>}</li>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getDestination <em>Destination</em>}</li>

- *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getConditionEvent <em>Condition Event</em>}</li>

- * </ul>

- *

- * @generated

- */

-public class ECTransitionImpl extends PositionableElementImpl implements ECTransition {

-	/**

-	 * The default value of the '{@link #getComment() <em>Comment</em>}' attribute.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @see #getComment()

-	 * @generated

-	 * @ordered

-	 */

-	protected static final String COMMENT_EDEFAULT = null;

-

-	/**

-	 * The cached value of the '{@link #getComment() <em>Comment</em>}' attribute.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @see #getComment()

-	 * @generated

-	 * @ordered

-	 */

-	protected String comment = COMMENT_EDEFAULT;

-

-	/**

-	 * The default value of the '{@link #getConditionExpression() <em>Condition Expression</em>}' attribute.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @see #getConditionExpression()

-	 * @generated

-	 * @ordered

-	 */

-	protected static final String CONDITION_EXPRESSION_EDEFAULT = null;

-

-	/**

-	 * The cached value of the '{@link #getConditionExpression() <em>Condition Expression</em>}' attribute.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @see #getConditionExpression()

-	 * @generated

-	 * @ordered

-	 */

-	protected String conditionExpression = CONDITION_EXPRESSION_EDEFAULT;

-

-	/**

-	 * The cached value of the '{@link #getSource() <em>Source</em>}' reference.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @see #getSource()

-	 * @generated

-	 * @ordered

-	 */

-	protected ECState source;

-

-	/**

-	 * The cached value of the '{@link #getDestination() <em>Destination</em>}' reference.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @see #getDestination()

-	 * @generated

-	 * @ordered

-	 */

-	protected ECState destination;

-

-	/**

-	 * The cached value of the '{@link #getConditionEvent() <em>Condition Event</em>}' reference.

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @see #getConditionEvent()

-	 * @generated

-	 * @ordered

-	 */

-	protected Event conditionEvent;

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	protected ECTransitionImpl() {

-		super();

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	@Override

-	protected EClass eStaticClass() {

-		return LibraryElementPackage.Literals.EC_TRANSITION;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public String getComment() {

-		return comment;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public void setComment(String newComment) {

-		String oldComment = comment;

-		comment = newComment;

-		if (eNotificationRequired())

-			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__COMMENT, oldComment, comment));

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public String getConditionExpression() {

-		return conditionExpression;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public void setConditionExpression(String newConditionExpression) {

-		String oldConditionExpression = conditionExpression;

-		conditionExpression = newConditionExpression;

-		if (eNotificationRequired())

-			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION, oldConditionExpression, conditionExpression));

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public ECState getDestination() {

-		if (destination != null && destination.eIsProxy()) {

-			InternalEObject oldDestination = (InternalEObject)destination;

-			destination = (ECState)eResolveProxy(oldDestination);

-			if (destination != oldDestination) {

-				if (eNotificationRequired())

-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LibraryElementPackage.EC_TRANSITION__DESTINATION, oldDestination, destination));

-			}

-		}

-		return destination;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public ECState basicGetDestination() {

-		return destination;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public NotificationChain basicSetDestination(ECState newDestination, NotificationChain msgs) {

-		ECState oldDestination = destination;

-		destination = newDestination;

-		if (eNotificationRequired()) {

-			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__DESTINATION, oldDestination, newDestination);

-			if (msgs == null) msgs = notification; else msgs.add(notification);

-		}

-		return msgs;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public void setDestination(ECState newDestination) {

-		if (newDestination != destination) {

-			NotificationChain msgs = null;

-			if (destination != null)

-				msgs = ((InternalEObject)destination).eInverseRemove(this, LibraryElementPackage.EC_STATE__IN_TRANSITIONS, ECState.class, msgs);

-			if (newDestination != null)

-				msgs = ((InternalEObject)newDestination).eInverseAdd(this, LibraryElementPackage.EC_STATE__IN_TRANSITIONS, ECState.class, msgs);

-			msgs = basicSetDestination(newDestination, msgs);

-			if (msgs != null) msgs.dispatch();

-		}

-		else if (eNotificationRequired())

-			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__DESTINATION, newDestination, newDestination));

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public Event getConditionEvent() {

-		if (conditionEvent != null && conditionEvent.eIsProxy()) {

-			InternalEObject oldConditionEvent = (InternalEObject)conditionEvent;

-			conditionEvent = (Event)eResolveProxy(oldConditionEvent);

-			if (conditionEvent != oldConditionEvent) {

-				if (eNotificationRequired())

-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT, oldConditionEvent, conditionEvent));

-			}

-		}

-		return conditionEvent;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public Event basicGetConditionEvent() {

-		return conditionEvent;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public void setConditionEvent(Event newConditionEvent) {

-		Event oldConditionEvent = conditionEvent;

-		conditionEvent = newConditionEvent;

-		if (eNotificationRequired())

-			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT, oldConditionEvent, conditionEvent));

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public String getConditionText() {

-		return org.eclipse.fordiac.ide.model.Annotations.GEN.getConditionText(this);

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	@Override

-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {

-		switch (featureID) {

-			case LibraryElementPackage.EC_TRANSITION__SOURCE:

-				if (source != null)

-					msgs = ((InternalEObject)source).eInverseRemove(this, LibraryElementPackage.EC_STATE__OUT_TRANSITIONS, ECState.class, msgs);

-				return basicSetSource((ECState)otherEnd, msgs);

-			case LibraryElementPackage.EC_TRANSITION__DESTINATION:

-				if (destination != null)

-					msgs = ((InternalEObject)destination).eInverseRemove(this, LibraryElementPackage.EC_STATE__IN_TRANSITIONS, ECState.class, msgs);

-				return basicSetDestination((ECState)otherEnd, msgs);

-		}

-		return super.eInverseAdd(otherEnd, featureID, msgs);

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	@Override

-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {

-		switch (featureID) {

-			case LibraryElementPackage.EC_TRANSITION__SOURCE:

-				return basicSetSource(null, msgs);

-			case LibraryElementPackage.EC_TRANSITION__DESTINATION:

-				return basicSetDestination(null, msgs);

-		}

-		return super.eInverseRemove(otherEnd, featureID, msgs);

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public ECState getSource() {

-		if (source != null && source.eIsProxy()) {

-			InternalEObject oldSource = (InternalEObject)source;

-			source = (ECState)eResolveProxy(oldSource);

-			if (source != oldSource) {

-				if (eNotificationRequired())

-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LibraryElementPackage.EC_TRANSITION__SOURCE, oldSource, source));

-			}

-		}

-		return source;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public ECState basicGetSource() {

-		return source;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public NotificationChain basicSetSource(ECState newSource, NotificationChain msgs) {

-		ECState oldSource = source;

-		source = newSource;

-		if (eNotificationRequired()) {

-			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__SOURCE, oldSource, newSource);

-			if (msgs == null) msgs = notification; else msgs.add(notification);

-		}

-		return msgs;

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	public void setSource(ECState newSource) {

-		if (newSource != source) {

-			NotificationChain msgs = null;

-			if (source != null)

-				msgs = ((InternalEObject)source).eInverseRemove(this, LibraryElementPackage.EC_STATE__OUT_TRANSITIONS, ECState.class, msgs);

-			if (newSource != null)

-				msgs = ((InternalEObject)newSource).eInverseAdd(this, LibraryElementPackage.EC_STATE__OUT_TRANSITIONS, ECState.class, msgs);

-			msgs = basicSetSource(newSource, msgs);

-			if (msgs != null) msgs.dispatch();

-		}

-		else if (eNotificationRequired())

-			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__SOURCE, newSource, newSource));

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	@Override

-	public Object eGet(int featureID, boolean resolve, boolean coreType) {

-		switch (featureID) {

-			case LibraryElementPackage.EC_TRANSITION__COMMENT:

-				return getComment();

-			case LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION:

-				return getConditionExpression();

-			case LibraryElementPackage.EC_TRANSITION__SOURCE:

-				if (resolve) return getSource();

-				return basicGetSource();

-			case LibraryElementPackage.EC_TRANSITION__DESTINATION:

-				if (resolve) return getDestination();

-				return basicGetDestination();

-			case LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT:

-				if (resolve) return getConditionEvent();

-				return basicGetConditionEvent();

-		}

-		return super.eGet(featureID, resolve, coreType);

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	@Override

-	public void eSet(int featureID, Object newValue) {

-		switch (featureID) {

-			case LibraryElementPackage.EC_TRANSITION__COMMENT:

-				setComment((String)newValue);

-				return;

-			case LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION:

-				setConditionExpression((String)newValue);

-				return;

-			case LibraryElementPackage.EC_TRANSITION__SOURCE:

-				setSource((ECState)newValue);

-				return;

-			case LibraryElementPackage.EC_TRANSITION__DESTINATION:

-				setDestination((ECState)newValue);

-				return;

-			case LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT:

-				setConditionEvent((Event)newValue);

-				return;

-		}

-		super.eSet(featureID, newValue);

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	@Override

-	public void eUnset(int featureID) {

-		switch (featureID) {

-			case LibraryElementPackage.EC_TRANSITION__COMMENT:

-				setComment(COMMENT_EDEFAULT);

-				return;

-			case LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION:

-				setConditionExpression(CONDITION_EXPRESSION_EDEFAULT);

-				return;

-			case LibraryElementPackage.EC_TRANSITION__SOURCE:

-				setSource((ECState)null);

-				return;

-			case LibraryElementPackage.EC_TRANSITION__DESTINATION:

-				setDestination((ECState)null);

-				return;

-			case LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT:

-				setConditionEvent((Event)null);

-				return;

-		}

-		super.eUnset(featureID);

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	@Override

-	public boolean eIsSet(int featureID) {

-		switch (featureID) {

-			case LibraryElementPackage.EC_TRANSITION__COMMENT:

-				return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);

-			case LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION:

-				return CONDITION_EXPRESSION_EDEFAULT == null ? conditionExpression != null : !CONDITION_EXPRESSION_EDEFAULT.equals(conditionExpression);

-			case LibraryElementPackage.EC_TRANSITION__SOURCE:

-				return source != null;

-			case LibraryElementPackage.EC_TRANSITION__DESTINATION:

-				return destination != null;

-			case LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT:

-				return conditionEvent != null;

-		}

-		return super.eIsSet(featureID);

-	}

-

-	/**

-	 * <!-- begin-user-doc -->

-	 * <!-- end-user-doc -->

-	 * @generated

-	 */

-	@Override

-	public String toString() {

-		if (eIsProxy()) return super.toString();

-

-		StringBuffer result = new StringBuffer(super.toString());

-		result.append(" (comment: ");

-		result.append(comment);

-		result.append(", conditionExpression: ");

-		result.append(conditionExpression);

-		result.append(')');

-		return result.toString();

-	}

-	

-

-} //ECTransitionImpl

+/********************************************************************************
+ * Copyright (c) 2008 - 2017 Profactor GmbH, TU Wien ACIN, fortiss GmbH
+ * 
+ * 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:
+ *  Gerhard Ebenhofer, Alois Zoitl, Ingo Hegny, Monika Wenger
+ *    - initial API and implementation and/or initial documentation
+ ********************************************************************************/
+package org.eclipse.fordiac.ide.model.libraryElement.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.fordiac.ide.model.libraryElement.ECC;
+import org.eclipse.fordiac.ide.model.libraryElement.ECState;
+import org.eclipse.fordiac.ide.model.libraryElement.ECTransition;
+import org.eclipse.fordiac.ide.model.libraryElement.Event;
+import org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EC Transition</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getComment <em>Comment</em>}</li>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getConditionExpression <em>Condition Expression</em>}</li>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getSource <em>Source</em>}</li>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getDestination <em>Destination</em>}</li>
+ *   <li>{@link org.eclipse.fordiac.ide.model.libraryElement.impl.ECTransitionImpl#getConditionEvent <em>Condition Event</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class ECTransitionImpl extends PositionableElementImpl implements ECTransition {
+	/**
+	 * The default value of the '{@link #getComment() <em>Comment</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getComment()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final String COMMENT_EDEFAULT = null;
+
+	/**
+	 * The cached value of the '{@link #getComment() <em>Comment</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getComment()
+	 * @generated
+	 * @ordered
+	 */
+	protected String comment = COMMENT_EDEFAULT;
+
+	/**
+	 * The default value of the '{@link #getConditionExpression() <em>Condition Expression</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getConditionExpression()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final String CONDITION_EXPRESSION_EDEFAULT = null;
+
+	/**
+	 * The cached value of the '{@link #getConditionExpression() <em>Condition Expression</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getConditionExpression()
+	 * @generated
+	 * @ordered
+	 */
+	protected String conditionExpression = CONDITION_EXPRESSION_EDEFAULT;
+
+	/**
+	 * The cached value of the '{@link #getSource() <em>Source</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getSource()
+	 * @generated
+	 * @ordered
+	 */
+	protected ECState source;
+
+	/**
+	 * The cached value of the '{@link #getDestination() <em>Destination</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getDestination()
+	 * @generated
+	 * @ordered
+	 */
+	protected ECState destination;
+
+	/**
+	 * The cached value of the '{@link #getConditionEvent() <em>Condition Event</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getConditionEvent()
+	 * @generated
+	 * @ordered
+	 */
+	protected Event conditionEvent;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected ECTransitionImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return LibraryElementPackage.Literals.EC_TRANSITION;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public String getComment() {
+		return comment;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setComment(String newComment) {
+		String oldComment = comment;
+		comment = newComment;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__COMMENT, oldComment, comment));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public String getConditionExpression() {
+		return conditionExpression;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setConditionExpression(String newConditionExpression) {
+		String oldConditionExpression = conditionExpression;
+		conditionExpression = newConditionExpression;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION, oldConditionExpression, conditionExpression));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ECState getDestination() {
+		if (destination != null && destination.eIsProxy()) {
+			InternalEObject oldDestination = (InternalEObject)destination;
+			destination = (ECState)eResolveProxy(oldDestination);
+			if (destination != oldDestination) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LibraryElementPackage.EC_TRANSITION__DESTINATION, oldDestination, destination));
+			}
+		}
+		return destination;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ECState basicGetDestination() {
+		return destination;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetDestination(ECState newDestination, NotificationChain msgs) {
+		ECState oldDestination = destination;
+		destination = newDestination;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__DESTINATION, oldDestination, newDestination);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setDestination(ECState newDestination) {
+		if (newDestination != destination) {
+			NotificationChain msgs = null;
+			if (destination != null)
+				msgs = ((InternalEObject)destination).eInverseRemove(this, LibraryElementPackage.EC_STATE__IN_TRANSITIONS, ECState.class, msgs);
+			if (newDestination != null)
+				msgs = ((InternalEObject)newDestination).eInverseAdd(this, LibraryElementPackage.EC_STATE__IN_TRANSITIONS, ECState.class, msgs);
+			msgs = basicSetDestination(newDestination, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__DESTINATION, newDestination, newDestination));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Event getConditionEvent() {
+		if (conditionEvent != null && conditionEvent.eIsProxy()) {
+			InternalEObject oldConditionEvent = (InternalEObject)conditionEvent;
+			conditionEvent = (Event)eResolveProxy(oldConditionEvent);
+			if (conditionEvent != oldConditionEvent) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT, oldConditionEvent, conditionEvent));
+			}
+		}
+		return conditionEvent;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Event basicGetConditionEvent() {
+		return conditionEvent;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setConditionEvent(Event newConditionEvent) {
+		Event oldConditionEvent = conditionEvent;
+		conditionEvent = newConditionEvent;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT, oldConditionEvent, conditionEvent));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public String getConditionText() {
+		return org.eclipse.fordiac.ide.model.Annotations.GEN.getConditionText(this);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ECC getECC() {
+		return org.eclipse.fordiac.ide.model.Annotations.GEN.getECC(this);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case LibraryElementPackage.EC_TRANSITION__SOURCE:
+				if (source != null)
+					msgs = ((InternalEObject)source).eInverseRemove(this, LibraryElementPackage.EC_STATE__OUT_TRANSITIONS, ECState.class, msgs);
+				return basicSetSource((ECState)otherEnd, msgs);
+			case LibraryElementPackage.EC_TRANSITION__DESTINATION:
+				if (destination != null)
+					msgs = ((InternalEObject)destination).eInverseRemove(this, LibraryElementPackage.EC_STATE__IN_TRANSITIONS, ECState.class, msgs);
+				return basicSetDestination((ECState)otherEnd, msgs);
+		}
+		return super.eInverseAdd(otherEnd, featureID, msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case LibraryElementPackage.EC_TRANSITION__SOURCE:
+				return basicSetSource(null, msgs);
+			case LibraryElementPackage.EC_TRANSITION__DESTINATION:
+				return basicSetDestination(null, msgs);
+		}
+		return super.eInverseRemove(otherEnd, featureID, msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ECState getSource() {
+		if (source != null && source.eIsProxy()) {
+			InternalEObject oldSource = (InternalEObject)source;
+			source = (ECState)eResolveProxy(oldSource);
+			if (source != oldSource) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LibraryElementPackage.EC_TRANSITION__SOURCE, oldSource, source));
+			}
+		}
+		return source;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public ECState basicGetSource() {
+		return source;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetSource(ECState newSource, NotificationChain msgs) {
+		ECState oldSource = source;
+		source = newSource;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__SOURCE, oldSource, newSource);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setSource(ECState newSource) {
+		if (newSource != source) {
+			NotificationChain msgs = null;
+			if (source != null)
+				msgs = ((InternalEObject)source).eInverseRemove(this, LibraryElementPackage.EC_STATE__OUT_TRANSITIONS, ECState.class, msgs);
+			if (newSource != null)
+				msgs = ((InternalEObject)newSource).eInverseAdd(this, LibraryElementPackage.EC_STATE__OUT_TRANSITIONS, ECState.class, msgs);
+			msgs = basicSetSource(newSource, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, LibraryElementPackage.EC_TRANSITION__SOURCE, newSource, newSource));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eGet(int featureID, boolean resolve, boolean coreType) {
+		switch (featureID) {
+			case LibraryElementPackage.EC_TRANSITION__COMMENT:
+				return getComment();
+			case LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION:
+				return getConditionExpression();
+			case LibraryElementPackage.EC_TRANSITION__SOURCE:
+				if (resolve) return getSource();
+				return basicGetSource();
+			case LibraryElementPackage.EC_TRANSITION__DESTINATION:
+				if (resolve) return getDestination();
+				return basicGetDestination();
+			case LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT:
+				if (resolve) return getConditionEvent();
+				return basicGetConditionEvent();
+		}
+		return super.eGet(featureID, resolve, coreType);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eSet(int featureID, Object newValue) {
+		switch (featureID) {
+			case LibraryElementPackage.EC_TRANSITION__COMMENT:
+				setComment((String)newValue);
+				return;
+			case LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION:
+				setConditionExpression((String)newValue);
+				return;
+			case LibraryElementPackage.EC_TRANSITION__SOURCE:
+				setSource((ECState)newValue);
+				return;
+			case LibraryElementPackage.EC_TRANSITION__DESTINATION:
+				setDestination((ECState)newValue);
+				return;
+			case LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT:
+				setConditionEvent((Event)newValue);
+				return;
+		}
+		super.eSet(featureID, newValue);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eUnset(int featureID) {
+		switch (featureID) {
+			case LibraryElementPackage.EC_TRANSITION__COMMENT:
+				setComment(COMMENT_EDEFAULT);
+				return;
+			case LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION:
+				setConditionExpression(CONDITION_EXPRESSION_EDEFAULT);
+				return;
+			case LibraryElementPackage.EC_TRANSITION__SOURCE:
+				setSource((ECState)null);
+				return;
+			case LibraryElementPackage.EC_TRANSITION__DESTINATION:
+				setDestination((ECState)null);
+				return;
+			case LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT:
+				setConditionEvent((Event)null);
+				return;
+		}
+		super.eUnset(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public boolean eIsSet(int featureID) {
+		switch (featureID) {
+			case LibraryElementPackage.EC_TRANSITION__COMMENT:
+				return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
+			case LibraryElementPackage.EC_TRANSITION__CONDITION_EXPRESSION:
+				return CONDITION_EXPRESSION_EDEFAULT == null ? conditionExpression != null : !CONDITION_EXPRESSION_EDEFAULT.equals(conditionExpression);
+			case LibraryElementPackage.EC_TRANSITION__SOURCE:
+				return source != null;
+			case LibraryElementPackage.EC_TRANSITION__DESTINATION:
+				return destination != null;
+			case LibraryElementPackage.EC_TRANSITION__CONDITION_EVENT:
+				return conditionEvent != null;
+		}
+		return super.eIsSet(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String toString() {
+		if (eIsProxy()) return super.toString();
+
+		StringBuffer result = new StringBuffer(super.toString());
+		result.append(" (comment: ");
+		result.append(comment);
+		result.append(", conditionExpression: ");
+		result.append(conditionExpression);
+		result.append(')');
+		return result.toString();
+	}
+	
+
+} //ECTransitionImpl
diff --git a/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/impl/LibraryElementPackageImpl.java b/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/impl/LibraryElementPackageImpl.java
index fc2546c..8e0a48d 100644
--- a/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/impl/LibraryElementPackageImpl.java
+++ b/plugins/org.eclipse.fordiac.ide.model/src-gen/org/eclipse/fordiac/ide/model/libraryElement/impl/LibraryElementPackageImpl.java
@@ -3144,6 +3144,8 @@
 
 		addEOperation(ecTransitionEClass, theXMLTypePackage.getString(), "getConditionText", 1, 1, IS_UNIQUE, IS_ORDERED);
 
+		addEOperation(ecTransitionEClass, this.getECC(), "getECC", 1, 1, IS_UNIQUE, IS_ORDERED);
+
 		initEClass(eventEClass, Event.class, "Event", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getEvent_With(), this.getWith(), null, "with", null, 0, -1, Event.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
diff --git a/plugins/org.eclipse.fordiac.ide.model/src/org/eclipse/fordiac/ide/model/Annotations.java b/plugins/org.eclipse.fordiac.ide.model/src/org/eclipse/fordiac/ide/model/Annotations.java
index b182f16..aa84cdb 100644
--- a/plugins/org.eclipse.fordiac.ide.model/src/org/eclipse/fordiac/ide/model/Annotations.java
+++ b/plugins/org.eclipse.fordiac.ide.model/src/org/eclipse/fordiac/ide/model/Annotations.java
@@ -161,15 +161,20 @@
 			retVal = event.getName();
 		}
 		if(expression !=  null){
-			if(expression.equals("1")){
+			if(expression.equals("1")){ //$NON-NLS-1$
 				retVal = expression;
-			}else if (!expression.equals("")){
-				retVal += "[" + expression + "]";
+			}else if (!expression.equals("")){ //$NON-NLS-1$
+				retVal += "[" + expression + "]"; //$NON-NLS-1$ //$NON-NLS-2$
 			}
 		}		
 		return retVal;
 	}
 	
+	public ECC getECC(ECTransition ecTransition) {
+		return (ECC)ecTransition.eContainer();
+	}
+
+	
 	//*** FB ***//
 	public FBType getFBType(FB fb) {
 		LibraryElement type = fb.getType();