use of org.eclipse.xtext.ui.codetemplates.templates.TemplateBody in project xtext-eclipse by eclipse.
the class SingleCodetemplateSemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == TemplatesPackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case TemplatesPackage.CODETEMPLATE:
sequence_Codetemplate(context, (Codetemplate) semanticObject);
return;
case TemplatesPackage.CODETEMPLATES:
sequence_Codetemplates(context, (Codetemplates) semanticObject);
return;
case TemplatesPackage.DOLLAR:
sequence_Dollar(context, (Dollar) semanticObject);
return;
case TemplatesPackage.LITERAL:
sequence_Literal(context, (Literal) semanticObject);
return;
case TemplatesPackage.TEMPLATE_BODY:
sequence_TemplateBody(context, (TemplateBody) semanticObject);
return;
case TemplatesPackage.VARIABLE:
sequence_Variable(context, (Variable) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.ui.codetemplates.templates.TemplateBody in project xtext-eclipse by eclipse.
the class CodetemplatesSemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == TemplatesPackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case TemplatesPackage.CODETEMPLATE:
sequence_Codetemplate(context, (Codetemplate) semanticObject);
return;
case TemplatesPackage.CODETEMPLATES:
sequence_Codetemplates(context, (Codetemplates) semanticObject);
return;
case TemplatesPackage.DOLLAR:
sequence_Dollar(context, (Dollar) semanticObject);
return;
case TemplatesPackage.LITERAL:
sequence_Literal(context, (Literal) semanticObject);
return;
case TemplatesPackage.TEMPLATE_BODY:
sequence_TemplateBody(context, (TemplateBody) semanticObject);
return;
case TemplatesPackage.VARIABLE:
sequence_Variable(context, (Variable) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.ui.codetemplates.templates.TemplateBody in project xtext-eclipse by eclipse.
the class AbstractTemplateProposalConflictHelper method initTokenSource.
@Override
protected void initTokenSource(String text, TokenSource tokenSource, ContentAssistContext context) {
EObject currentModel = context.getLastCompleteNode().getSemanticElement();
Variable variable = currentModel != null ? EcoreUtil2.getContainerOfType(currentModel, Variable.class) : null;
TemplateBody body = currentModel != null ? EcoreUtil2.getContainerOfType(currentModel, TemplateBody.class) : null;
Lexer lexer = (Lexer) tokenSource;
CharStream stream = new ANTLRStringStream(text);
lexer.setCharStream(stream);
initLexer(lexer, body != null, variable != null);
}
use of org.eclipse.xtext.ui.codetemplates.templates.TemplateBody in project xtext-eclipse by eclipse.
the class CodetemplateImpl method basicSetBody.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBody(TemplateBody newBody, NotificationChain msgs) {
TemplateBody oldBody = body;
body = newBody;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TemplatesPackage.CODETEMPLATE__BODY, oldBody, newBody);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
Aggregations