Java Code Examples for org.eclipse.emf.ecore.EDataType#setName()

The following examples show how to use org.eclipse.emf.ecore.EDataType#setName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScopesTest.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@Test public void testWithDifferentElements() throws Exception {
	EAttribute attr = EcoreFactory.eINSTANCE.createEAttribute();
	attr.setName("Foo");
	EDataType datatype = EcoreFactory.eINSTANCE.createEDataType();
	datatype.setName("Bar");
	
	ArrayList<EObject> list = new ArrayList<EObject>();
	list.add(attr);
	list.add(EcoreFactory.eINSTANCE.createEObject());
	list.add(datatype);
	
	Iterable<IEObjectDescription> iterable = Scopes.scopedElementsFor(list);
	Iterator<IEObjectDescription> iterator = iterable.iterator();
	IEObjectDescription next = iterator.next();
	assertEquals(FOO, next.getName());
	assertEquals(attr,next.getEObjectOrProxy());
	next = iterator.next();
	assertEquals(BAR, next.getName());
	assertEquals(datatype,next.getEObjectOrProxy());
	assertFalse(iterator.hasNext());
}
 
Example 2
Source File: EcoreUtilN4Test.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
private EDataType edt(String n) {
	EDataType d = EcoreFactory.eINSTANCE.createEDataType();
	d.setName(n);
	return d;
}
 
Example 3
Source File: NamesAreUniqueValidationHelperTest.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
private EDataType createEDataType() {
	EDataType result = EcoreFactory.eINSTANCE.createEDataType();
	result.setName(String.valueOf(created++));
	return result;
}
 
Example 4
Source File: EcoreUtil2Test.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
private EDataType createEDataType(String name, Class<?> instanceClass) {
	EDataType result = EcoreFactory.eINSTANCE.createEDataType();
	result.setName(name);
	result.setInstanceClass(instanceClass);
	return result;
}