Commit b10971a1 authored by De Viry Guilhem's avatar De Viry Guilhem

Ajout de tous les outils de création dans l'interface du plugin

parent 5107f66a
......@@ -59,7 +59,6 @@ public class StateItemProvider extends ItemProviderAdapter implements IEditingDo
addNamePropertyDescriptor(object);
addOwningFSMPropertyDescriptor(object);
addIncomingTransitionsPropertyDescriptor(object);
addOnEnteredActionsPropertyDescriptor(object);
addOnExitedActionsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
......@@ -110,21 +109,6 @@ public class StateItemProvider extends ItemProviderAdapter implements IEditingDo
FsmPackage.Literals.STATE__INCOMING_TRANSITIONS, true, false, true, null, null, null));
}
/**
* This adds a property descriptor for the On Entered Actions feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addOnEnteredActionsPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_State_onEnteredActions_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_State_onEnteredActions_feature",
"_UI_State_type"),
FsmPackage.Literals.STATE__ON_ENTERED_ACTIONS, true, false, true, null, null, null));
}
/**
* This adds a property descriptor for the On Exited Actions feature.
* <!-- begin-user-doc -->
......@@ -153,6 +137,7 @@ public class StateItemProvider extends ItemProviderAdapter implements IEditingDo
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(FsmPackage.Literals.STATE__OUTGOING_TRANSITIONS);
childrenFeatures.add(FsmPackage.Literals.STATE__ON_ENTERED_ACTIONS);
}
return childrenFeatures;
}
......@@ -220,6 +205,7 @@ public class StateItemProvider extends ItemProviderAdapter implements IEditingDo
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case FsmPackage.STATE__OUTGOING_TRANSITIONS:
case FsmPackage.STATE__ON_ENTERED_ACTIONS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
......@@ -239,6 +225,9 @@ public class StateItemProvider extends ItemProviderAdapter implements IEditingDo
newChildDescriptors.add(createChildParameter(FsmPackage.Literals.STATE__OUTGOING_TRANSITIONS,
FsmFactory.eINSTANCE.createTransition()));
newChildDescriptors.add(createChildParameter(FsmPackage.Literals.STATE__ON_ENTERED_ACTIONS,
FsmFactory.eINSTANCE.createAction()));
}
/**
......
This diff is collapsed.
......@@ -26,8 +26,10 @@
eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" upperBound="-1"
eType="#//Transition" eOpposite="#//Transition/target"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="onEnteredActions" eType="#//Action"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="onExitedActions" eType="#//Action"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="onEnteredActions" upperBound="-1"
eType="#//Action" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="onExitedActions" upperBound="-1"
eType="#//Action" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Transition">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
......@@ -48,5 +50,7 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Guard">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Dictionary" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"
defaultValueLiteral="new EMap&lt;new EString(), new EString()>()"/>
</eClassifiers>
</ecore:EPackage>
......@@ -26,7 +26,7 @@
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsm.ecore#//State/owningFSM"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference fsm.ecore#//State/outgoingTransitions"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsm.ecore#//State/incomingTransitions"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsm.ecore#//State/onEnteredActions"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference fsm.ecore#//State/onEnteredActions"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference fsm.ecore#//State/onExitedActions"/>
</genClasses>
<genClasses ecoreClass="fsm.ecore#//Transition">
......
......@@ -212,7 +212,7 @@ public interface FsmPackage extends EPackage {
int STATE__INCOMING_TRANSITIONS = 3;
/**
* The feature id for the '<em><b>On Entered Actions</b></em>' reference.
* The feature id for the '<em><b>On Entered Actions</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
......@@ -221,7 +221,7 @@ public interface FsmPackage extends EPackage {
int STATE__ON_ENTERED_ACTIONS = 4;
/**
* The feature id for the '<em><b>On Exited Actions</b></em>' reference.
* The feature id for the '<em><b>On Exited Actions</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
......@@ -604,10 +604,10 @@ public interface FsmPackage extends EPackage {
EReference getState_IncomingTransitions();
/**
* Returns the meta object for the reference '{@link fr.supelec.plong9.fsm.State#getOnEnteredActions <em>On Entered Actions</em>}'.
* Returns the meta object for the containment reference list '{@link fr.supelec.plong9.fsm.State#getOnEnteredActions <em>On Entered Actions</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>On Entered Actions</em>'.
* @return the meta object for the containment reference list '<em>On Entered Actions</em>'.
* @see fr.supelec.plong9.fsm.State#getOnEnteredActions()
* @see #getState()
* @generated
......@@ -615,10 +615,10 @@ public interface FsmPackage extends EPackage {
EReference getState_OnEnteredActions();
/**
* Returns the meta object for the reference '{@link fr.supelec.plong9.fsm.State#getOnExitedActions <em>On Exited Actions</em>}'.
* Returns the meta object for the containment reference list '{@link fr.supelec.plong9.fsm.State#getOnExitedActions <em>On Exited Actions</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>On Exited Actions</em>'.
* @return the meta object for the containment reference list '<em>On Exited Actions</em>'.
* @see fr.supelec.plong9.fsm.State#getOnExitedActions()
* @see #getState()
* @generated
......@@ -912,7 +912,7 @@ public interface FsmPackage extends EPackage {
EReference STATE__INCOMING_TRANSITIONS = eINSTANCE.getState_IncomingTransitions();
/**
* The meta object literal for the '<em><b>On Entered Actions</b></em>' reference feature.
* The meta object literal for the '<em><b>On Entered Actions</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
......@@ -920,7 +920,7 @@ public interface FsmPackage extends EPackage {
EReference STATE__ON_ENTERED_ACTIONS = eINSTANCE.getState_OnEnteredActions();
/**
* The meta object literal for the '<em><b>On Exited Actions</b></em>' reference feature.
* The meta object literal for the '<em><b>On Exited Actions</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
......
......@@ -119,55 +119,35 @@ public interface State extends EObject {
EList<Transition> getIncomingTransitions();
/**
* Returns the value of the '<em><b>On Entered Actions</b></em>' reference.
* Returns the value of the '<em><b>On Entered Actions</b></em>' containment reference list.
* The list contents are of type {@link fr.supelec.plong9.fsm.Action}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>On Entered Actions</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>On Entered Actions</em>' reference.
* @see #setOnEnteredActions(Action)
* @return the value of the '<em>On Entered Actions</em>' containment reference list.
* @see fr.supelec.plong9.fsm.FsmPackage#getState_OnEnteredActions()
* @model
* @generated
*/
Action getOnEnteredActions();
/**
* Sets the value of the '{@link fr.supelec.plong9.fsm.State#getOnEnteredActions <em>On Entered Actions</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>On Entered Actions</em>' reference.
* @see #getOnEnteredActions()
* @model containment="true"
* @generated
*/
void setOnEnteredActions(Action value);
EList<Action> getOnEnteredActions();
/**
* Returns the value of the '<em><b>On Exited Actions</b></em>' reference.
* Returns the value of the '<em><b>On Exited Actions</b></em>' containment reference list.
* The list contents are of type {@link fr.supelec.plong9.fsm.Action}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>On Exited Actions</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>On Exited Actions</em>' reference.
* @see #setOnExitedActions(Action)
* @return the value of the '<em>On Exited Actions</em>' containment reference list.
* @see fr.supelec.plong9.fsm.FsmPackage#getState_OnExitedActions()
* @model
* @generated
*/
Action getOnExitedActions();
/**
* Sets the value of the '{@link fr.supelec.plong9.fsm.State#getOnExitedActions <em>On Exited Actions</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>On Exited Actions</em>' reference.
* @see #getOnExitedActions()
* @model containment="true"
* @generated
*/
void setOnExitedActions(Action value);
EList<Action> getOnExitedActions();
} // State
......@@ -538,11 +538,11 @@ public class FsmPackageImpl extends EPackageImpl implements FsmPackage {
initEReference(getState_IncomingTransitions(), this.getTransition(), this.getTransition_Target(),
"incomingTransitions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getState_OnEnteredActions(), this.getAction(), null, "onEnteredActions", null, 0, 1, State.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getState_OnExitedActions(), this.getAction(), null, "onExitedActions", null, 0, 1, State.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
initEReference(getState_OnEnteredActions(), this.getAction(), null, "onEnteredActions", null, 0, -1,
State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getState_OnExitedActions(), this.getAction(), null, "onExitedActions", null, 0, -1, State.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(transitionEClass, Transition.class, "Transition", !IS_ABSTRACT, !IS_INTERFACE,
......
......@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
......@@ -86,24 +87,24 @@ public class StateImpl extends MinimalEObjectImpl.Container implements State {
protected EList<Transition> incomingTransitions;
/**
* The cached value of the '{@link #getOnEnteredActions() <em>On Entered Actions</em>}' reference.
* The cached value of the '{@link #getOnEnteredActions() <em>On Entered Actions</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOnEnteredActions()
* @generated
* @ordered
*/
protected Action onEnteredActions;
protected EList<Action> onEnteredActions;
/**
* The cached value of the '{@link #getOnExitedActions() <em>On Exited Actions</em>}' reference.
* The cached value of the '{@link #getOnExitedActions() <em>On Exited Actions</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOnExitedActions()
* @generated
* @ordered
*/
protected Action onExitedActions;
protected EList<Action> onExitedActions;
/**
* <!-- begin-user-doc -->
......@@ -221,15 +222,10 @@ public class StateImpl extends MinimalEObjectImpl.Container implements State {
* <!-- end-user-doc -->
* @generated
*/
public Action getOnEnteredActions() {
if (onEnteredActions != null && onEnteredActions.eIsProxy()) {
InternalEObject oldOnEnteredActions = (InternalEObject) onEnteredActions;
onEnteredActions = (Action) eResolveProxy(oldOnEnteredActions);
if (onEnteredActions != oldOnEnteredActions) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmPackage.STATE__ON_ENTERED_ACTIONS,
oldOnEnteredActions, onEnteredActions));
}
public EList<Action> getOnEnteredActions() {
if (onEnteredActions == null) {
onEnteredActions = new EObjectContainmentEList<Action>(Action.class, this,
FsmPackage.STATE__ON_ENTERED_ACTIONS);
}
return onEnteredActions;
}
......@@ -239,63 +235,14 @@ public class StateImpl extends MinimalEObjectImpl.Container implements State {
* <!-- end-user-doc -->
* @generated
*/
public Action basicGetOnEnteredActions() {
return onEnteredActions;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOnEnteredActions(Action newOnEnteredActions) {
Action oldOnEnteredActions = onEnteredActions;
onEnteredActions = newOnEnteredActions;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FsmPackage.STATE__ON_ENTERED_ACTIONS,
oldOnEnteredActions, onEnteredActions));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Action getOnExitedActions() {
if (onExitedActions != null && onExitedActions.eIsProxy()) {
InternalEObject oldOnExitedActions = (InternalEObject) onExitedActions;
onExitedActions = (Action) eResolveProxy(oldOnExitedActions);
if (onExitedActions != oldOnExitedActions) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmPackage.STATE__ON_EXITED_ACTIONS,
oldOnExitedActions, onExitedActions));
}
public EList<Action> getOnExitedActions() {
if (onExitedActions == null) {
onExitedActions = new EObjectContainmentEList<Action>(Action.class, this,
FsmPackage.STATE__ON_EXITED_ACTIONS);
}
return onExitedActions;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Action basicGetOnExitedActions() {
return onExitedActions;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOnExitedActions(Action newOnExitedActions) {
Action oldOnExitedActions = onExitedActions;
onExitedActions = newOnExitedActions;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FsmPackage.STATE__ON_EXITED_ACTIONS,
oldOnExitedActions, onExitedActions));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -333,6 +280,10 @@ public class StateImpl extends MinimalEObjectImpl.Container implements State {
return ((InternalEList<?>) getOutgoingTransitions()).basicRemove(otherEnd, msgs);
case FsmPackage.STATE__INCOMING_TRANSITIONS:
return ((InternalEList<?>) getIncomingTransitions()).basicRemove(otherEnd, msgs);
case FsmPackage.STATE__ON_ENTERED_ACTIONS:
return ((InternalEList<?>) getOnEnteredActions()).basicRemove(otherEnd, msgs);
case FsmPackage.STATE__ON_EXITED_ACTIONS:
return ((InternalEList<?>) getOnExitedActions()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
......@@ -368,13 +319,9 @@ public class StateImpl extends MinimalEObjectImpl.Container implements State {
case FsmPackage.STATE__INCOMING_TRANSITIONS:
return getIncomingTransitions();
case FsmPackage.STATE__ON_ENTERED_ACTIONS:
if (resolve)
return getOnEnteredActions();
return basicGetOnEnteredActions();
return getOnEnteredActions();
case FsmPackage.STATE__ON_EXITED_ACTIONS:
if (resolve)
return getOnExitedActions();
return basicGetOnExitedActions();
return getOnExitedActions();
}
return super.eGet(featureID, resolve, coreType);
}
......@@ -403,10 +350,12 @@ public class StateImpl extends MinimalEObjectImpl.Container implements State {
getIncomingTransitions().addAll((Collection<? extends Transition>) newValue);
return;
case FsmPackage.STATE__ON_ENTERED_ACTIONS:
setOnEnteredActions((Action) newValue);
getOnEnteredActions().clear();
getOnEnteredActions().addAll((Collection<? extends Action>) newValue);
return;
case FsmPackage.STATE__ON_EXITED_ACTIONS:
setOnExitedActions((Action) newValue);
getOnExitedActions().clear();
getOnExitedActions().addAll((Collection<? extends Action>) newValue);
return;
}
super.eSet(featureID, newValue);
......@@ -433,10 +382,10 @@ public class StateImpl extends MinimalEObjectImpl.Container implements State {
getIncomingTransitions().clear();
return;
case FsmPackage.STATE__ON_ENTERED_ACTIONS:
setOnEnteredActions((Action) null);
getOnEnteredActions().clear();
return;
case FsmPackage.STATE__ON_EXITED_ACTIONS:
setOnExitedActions((Action) null);
getOnExitedActions().clear();
return;
}
super.eUnset(featureID);
......@@ -459,9 +408,9 @@ public class StateImpl extends MinimalEObjectImpl.Container implements State {
case FsmPackage.STATE__INCOMING_TRANSITIONS:
return incomingTransitions != null && !incomingTransitions.isEmpty();
case FsmPackage.STATE__ON_ENTERED_ACTIONS:
return onEnteredActions != null;
return onEnteredActions != null && !onEnteredActions.isEmpty();
case FsmPackage.STATE__ON_EXITED_ACTIONS:
return onExitedActions != null;
return onExitedActions != null && !onExitedActions.isEmpty();
}
return super.eIsSet(featureID);
}
......
<?xml version="1.0" encoding="ASCII"?>
<fsm:FSM xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:fsm="http://fr.supelec.plong9.fsm" name="myFsm" initialState="//@ownedStates.0" currentState="//@ownedStates.0" finalState="//@ownedStates.3">
<ownedStates name="s1">
<outgoingTransitions name="t1" actions="//@ownedActions.2 //@ownedActions.4" guard="//@ownedGuards.2" event="//@ownedEvents.0" target="//@ownedStates.1"/>
<outgoingTransitions name="t1" actions="//@ownedActions.2" guard="//@ownedGuards.2" event="//@ownedEvents.0" target="//@ownedStates.1"/>
<onEnteredActions name="A5"/>
<onEnteredActions name="A7"/>
</ownedStates>
<ownedStates name="s2" incomingTransitions="//@ownedStates.0/@outgoingTransitions.0 //@ownedStates.2/@outgoingTransitions.0">
<outgoingTransitions name="t2" actions="//@ownedActions.0" guard="//@ownedGuards.1" event="//@ownedEvents.2" target="//@ownedStates.2"/>
<outgoingTransitions name="t2" actions="//@ownedActions.0" guard="//@ownedGuards.1" event="//@ownedEvents.1" target="//@ownedStates.2"/>
</ownedStates>
<ownedStates name="s3" incomingTransitions="//@ownedStates.1/@outgoingTransitions.0">
<outgoingTransitions name="t3" actions="//@ownedActions.5 //@ownedActions.1" guard="//@ownedGuards.3" event="//@ownedEvents.1" target="//@ownedStates.1"/>
<outgoingTransitions name="t4" actions="//@ownedActions.3" guard="//@ownedGuards.0" event="//@ownedEvents.3" target="//@ownedStates.3"/>
<outgoingTransitions name="t3" actions="//@ownedActions.1 //@ownedActions.3" guard="//@ownedGuards.3" event="//@ownedEvents.1" target="//@ownedStates.1"/>
<outgoingTransitions name="t4" guard="//@ownedGuards.0" event="//@ownedEvents.3" target="//@ownedStates.3"/>
</ownedStates>
<ownedStates name="s4" incomingTransitions="//@ownedStates.2/@outgoingTransitions.1"/>
<ownedEvents name="E1"/>
<ownedEvents name="E2"/>
<ownedEvents name="E3"/>
<ownedEvents name="E4"/>
<ownedEvents name="E8"/>
<ownedActions name="A1"/>
<ownedActions name="A2"/>
<ownedActions name="A3"/>
<ownedActions name="A4"/>
<ownedActions name="A5"/>
<ownedActions name="A6"/>
<ownedActions name="A8"/>
<ownedGuards name="G1"/>
<ownedGuards name="G2"/>
<ownedGuards name="G3"/>
<ownedGuards name="G5"/>
<ownedGuards name="G6"/>
<ownedGuards name="G4"/>
</fsm:FSM>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment