Search in sources :

Example 71 with EClassifier

use of org.eclipse.emf.ecore.EClassifier in project xtext-core by eclipse.

the class NamesAreUniqueValidationHelperTest method testCreatedErrors_02_context.

@Test
public void testCreatedErrors_02_context() {
    maxCallCount = 0;
    ImmutableList<EClassifier> classifiers = ImmutableList.of(createEClass(), createEDataType());
    for (EClassifier classifier : classifiers) {
        classifier.setName("Same");
    }
    expected.addAll(classifiers);
    helper.checkUniqueNames(new LocalUniqueNameContext(classifiers, this), this);
    assertEquals(classifiers.size(), callCount);
    assertTrue(expected.isEmpty());
}
Also used : EClassifier(org.eclipse.emf.ecore.EClassifier) Test(org.junit.Test)

Example 72 with EClassifier

use of org.eclipse.emf.ecore.EClassifier in project xtext-core by eclipse.

the class TypeRefImpl method setClassifier.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setClassifier(EClassifier newClassifier) {
    EClassifier oldClassifier = classifier;
    classifier = newClassifier;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.TYPE_REF__CLASSIFIER, oldClassifier, classifier));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) EClassifier(org.eclipse.emf.ecore.EClassifier)

Example 73 with EClassifier

use of org.eclipse.emf.ecore.EClassifier in project xtext-core by eclipse.

the class TreeConstState method getTypesToCheck.

public Collection<TypeRef> getTypesToCheck() {
    Map<EClassifier, TypeRef> localTypes = Maps.newLinkedHashMap();
    for (TypeRef t : sortTypes(getTypes())) if (t != null)
        localTypes.put(t.getClassifier(), t);
    List<TreeConstTransition> incomming = getIncommingWithoutRuleCalls();
    if (incomming.isEmpty())
        return localTypes.values();
    for (TreeConstTransition t : incomming) for (TypeRef r : t.getSource().getTypes()) if (r != null && !localTypes.containsKey(r.getClassifier()))
        return localTypes.values();
    return Collections.emptyList();
}
Also used : TypeRef(org.eclipse.xtext.TypeRef) EClassifier(org.eclipse.emf.ecore.EClassifier)

Example 74 with EClassifier

use of org.eclipse.emf.ecore.EClassifier in project xtext-core by eclipse.

the class TypeRefImpl method setClassifier.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void setClassifier(EClassifier newClassifier) {
    EClassifier oldClassifier = classifier;
    classifier = newClassifier;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, XtextTerminalsTestLanguagePackage.TYPE_REF__CLASSIFIER, oldClassifier, classifier));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) EClassifier(org.eclipse.emf.ecore.EClassifier)

Example 75 with EClassifier

use of org.eclipse.emf.ecore.EClassifier in project Malai by arnobl.

the class InstrumentModelWizard method getInitialObjectNames.

/**
 * Returns the names of the types that can be created as the root object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Collection<String> getInitialObjectNames() {
    if (initialObjectNames == null) {
        initialObjectNames = new ArrayList<String>();
        for (EClassifier eClassifier : instrumentPackage.getEClassifiers()) {
            if (eClassifier instanceof EClass) {
                EClass eClass = (EClass) eClassifier;
                if (!eClass.isAbstract()) {
                    initialObjectNames.add(eClass.getName());
                }
            }
        }
        Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
    }
    return initialObjectNames;
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EClassifier(org.eclipse.emf.ecore.EClassifier)

Aggregations

EClassifier (org.eclipse.emf.ecore.EClassifier)153 EClass (org.eclipse.emf.ecore.EClass)94 Test (org.junit.Test)36 EPackage (org.eclipse.emf.ecore.EPackage)32 EReference (org.eclipse.emf.ecore.EReference)22 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)16 AbstractRule (org.eclipse.xtext.AbstractRule)14 EDataType (org.eclipse.emf.ecore.EDataType)13 EObject (org.eclipse.emf.ecore.EObject)13 XtextResource (org.eclipse.xtext.resource.XtextResource)10 EAttribute (org.eclipse.emf.ecore.EAttribute)8 EEnum (org.eclipse.emf.ecore.EEnum)8 Grammar (org.eclipse.xtext.Grammar)8 ParserRule (org.eclipse.xtext.ParserRule)8 ArrayList (java.util.ArrayList)7 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)7 Assignment (org.eclipse.xtext.Assignment)7 IScope (org.eclipse.xtext.scoping.IScope)6 HashSet (java.util.HashSet)5 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)5