Search in sources :

Example 1 with Model

use of org.eclipse.xtext.linking.bug289059Test.Model in project xtext-core by eclipse.

the class Bug289059TestLanguageSemanticSequencer 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 == Bug289059TestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug289059TestPackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case Bug289059TestPackage.UNASSIGNED_ACTION:
                sequence_UnassignedAction(context, (UnassignedAction) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) UnassignedAction(org.eclipse.xtext.linking.bug289059Test.UnassignedAction) Model(org.eclipse.xtext.linking.bug289059Test.Model) Parameter(org.eclipse.xtext.Parameter) UnassignedAction(org.eclipse.xtext.linking.bug289059Test.UnassignedAction) EPackage(org.eclipse.emf.ecore.EPackage)

Example 2 with Model

use of org.eclipse.xtext.linking.bug289059Test.Model in project xtext-core by eclipse.

the class ModelImpl method setReference.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setReference(Model newReference) {
    Model oldReference = reference;
    reference = newReference;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, Bug289059TestPackage.MODEL__REFERENCE, oldReference, reference));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) Model(org.eclipse.xtext.linking.bug289059Test.Model)

Example 3 with Model

use of org.eclipse.xtext.linking.bug289059Test.Model in project xtext-core by eclipse.

the class Bug289059Test method testModelLinked_01.

@Test
public void testModelLinked_01() throws Exception {
    String modelAsText = "model model";
    Model model = (Model) getModel(modelAsText);
    assertSame(model, model.getReference());
}
Also used : Model(org.eclipse.xtext.linking.bug289059Test.Model) Test(org.junit.Test)

Example 4 with Model

use of org.eclipse.xtext.linking.bug289059Test.Model in project xtext-core by eclipse.

the class Bug289059Test method testModelLinked_02.

@Test
public void testModelLinked_02() throws Exception {
    String modelAsText = "model enabled model";
    Model model = (Model) getModel(modelAsText);
    assertSame(model, model.getReference());
}
Also used : Model(org.eclipse.xtext.linking.bug289059Test.Model) Test(org.junit.Test)

Aggregations

Model (org.eclipse.xtext.linking.bug289059Test.Model)4 Test (org.junit.Test)2 EPackage (org.eclipse.emf.ecore.EPackage)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 UnassignedAction (org.eclipse.xtext.linking.bug289059Test.UnassignedAction)1