Search in sources :

Example 1 with StateSpecification

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

the class StextImportAwareScopeProvider method internalGetImportedNamespaceResolvers.

@Override
protected List<ImportNormalizer> internalGetImportedNamespaceResolvers(final EObject context, boolean ignoreCase) {
    List<ImportNormalizer> importedNamespaceResolvers = Lists.newArrayList();
    List<ImportScope> importScopes = null;
    if (context instanceof StateSpecification || context instanceof TransitionSpecification) {
        importScopes = EcoreUtil2.getAllContentsOfType(getStatechart(context), ImportScope.class);
    } else {
        importScopes = EcoreUtil2.getAllContentsOfType(context, ImportScope.class);
    }
    for (ImportScope scope : importScopes) {
        importedNamespaceResolvers.addAll(createNamespaceResolver(scope, ignoreCase));
    }
    return importedNamespaceResolvers;
}
Also used : StateSpecification(org.yakindu.sct.model.stext.stext.StateSpecification) ImportNormalizer(org.eclipse.xtext.scoping.impl.ImportNormalizer) ImportScope(org.yakindu.sct.model.stext.stext.ImportScope) TransitionSpecification(org.yakindu.sct.model.stext.stext.TransitionSpecification)

Example 2 with StateSpecification

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

the class StateRootImpl method basicSetDef.

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

Example 3 with StateSpecification

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

the class StextResource method parseState.

protected void parseState(State state) {
    IParseResult parseResult = parse(state, StateSpecification.class.getSimpleName());
    StateSpecification rootASTElement = (StateSpecification) parseResult.getRootASTElement();
    state.getScopes().clear();
    if (rootASTElement.getScope() != null) {
        state.getScopes().add(rootASTElement.getScope());
    }
}
Also used : StateSpecification(org.yakindu.sct.model.stext.stext.StateSpecification) IParseResult(org.eclipse.xtext.parser.IParseResult)

Aggregations

StateSpecification (org.yakindu.sct.model.stext.stext.StateSpecification)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 IParseResult (org.eclipse.xtext.parser.IParseResult)1 ImportNormalizer (org.eclipse.xtext.scoping.impl.ImportNormalizer)1 ImportScope (org.yakindu.sct.model.stext.stext.ImportScope)1 TransitionSpecification (org.yakindu.sct.model.stext.stext.TransitionSpecification)1