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());
}
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));
}
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();
}
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));
}
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;
}
Aggregations