Search in sources :

Example 1 with TransitionReaction

use of org.yakindu.sct.model.stext.stext.TransitionReaction in project statecharts by Yakindu.

the class StextResource method parseTransition.

protected void parseTransition(Transition transition) {
    IParseResult parseResult = parse(transition, TransitionSpecification.class.getSimpleName());
    TransitionSpecification rootASTElement = (TransitionSpecification) parseResult.getRootASTElement();
    transition.getProperties().clear();
    if (rootASTElement.getReaction() != null) {
        TransitionReaction reaction = rootASTElement.getReaction();
        transition.setEffect(reaction.getEffect());
        transition.setTrigger(reaction.getTrigger());
        transition.getProperties().addAll(reaction.getProperties());
    }
}
Also used : TransitionSpecification(org.yakindu.sct.model.stext.stext.TransitionSpecification) IParseResult(org.eclipse.xtext.parser.IParseResult) TransitionReaction(org.yakindu.sct.model.stext.stext.TransitionReaction)

Example 2 with TransitionReaction

use of org.yakindu.sct.model.stext.stext.TransitionReaction in project statecharts by Yakindu.

the class TransitionSpecificationImpl method basicSetReaction.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetReaction(TransitionReaction newReaction, NotificationChain msgs) {
    TransitionReaction oldReaction = reaction;
    reaction = newReaction;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StextPackage.TRANSITION_SPECIFICATION__REACTION, oldReaction, newReaction);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) TransitionReaction(org.yakindu.sct.model.stext.stext.TransitionReaction)

Aggregations

TransitionReaction (org.yakindu.sct.model.stext.stext.TransitionReaction)2 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 IParseResult (org.eclipse.xtext.parser.IParseResult)1 TransitionSpecification (org.yakindu.sct.model.stext.stext.TransitionSpecification)1