use of org.yakindu.sct.model.stext.stext.TransitionSpecification in project statecharts by Yakindu.
the class STextProposalProvider method completeKeyword.
/**
* Validates if a keyword should be viewed by the proposal view.
*
* Builds dependent on the ContentAssistContext a list with keywords which
* shouldn't be displayed by the proposal view.
*/
@Override
public void completeKeyword(Keyword keyword, ContentAssistContext contentAssistContext, ICompletionProposalAcceptor acceptor) {
List<Keyword> suppressKeywords = new ArrayList<Keyword>();
EObject rootModel = contentAssistContext.getRootModel();
if (rootModel instanceof TransitionSpecification) {
suppressKeywords(suppressKeywords, (TransitionSpecification) rootModel);
} else if (rootModel instanceof SimpleScope) {
suppressKeywords(suppressKeywords, (SimpleScope) rootModel);
} else if (rootModel instanceof StatechartSpecification) {
suppressKeywords(suppressKeywords, (StatechartSpecification) rootModel);
}
EObject currentModel = contentAssistContext.getCurrentModel();
if (currentModel instanceof InterfaceScope) {
suppressKeywords(suppressKeywords, (InterfaceScope) currentModel);
}
if (currentModel instanceof FeatureCall) {
suppressKeywords(suppressKeywords, (FeatureCall) currentModel);
}
if (currentModel instanceof ElementReferenceExpression) {
suppressKeywords(suppressKeywords, (ElementReferenceExpression) currentModel);
}
if (currentModel instanceof InternalScope) {
suppressKeywords(suppressKeywords, (InternalScope) currentModel);
}
if (!suppressKeywords.contains(keyword)) {
super.completeKeyword(keyword, contentAssistContext, new AcceptorDelegate(acceptor));
}
}
use of org.yakindu.sct.model.stext.stext.TransitionSpecification 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;
}
use of org.yakindu.sct.model.stext.stext.TransitionSpecification 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());
}
}
use of org.yakindu.sct.model.stext.stext.TransitionSpecification in project statecharts by Yakindu.
the class TransitionRootImpl method basicSetDef.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDef(TransitionSpecification newDef, NotificationChain msgs) {
TransitionSpecification oldDef = def;
def = newDef;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StextPackage.TRANSITION_ROOT__DEF, oldDef, newDef);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
Aggregations