本文整理汇总了Java中org.eclipse.emf.ecore.ENamedElement.setName方法的典型用法代码示例。如果您正苦于以下问题:Java ENamedElement.setName方法的具体用法?Java ENamedElement.setName怎么用?Java ENamedElement.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.ecore.ENamedElement
的用法示例。
在下文中一共展示了ENamedElement.setName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreatedErrors_03
import org.eclipse.emf.ecore.ENamedElement; //导入方法依赖的package包/类
@Test public void testCreatedErrors_03() {
maxCallCount = 0;
ImmutableList<ENamedElement> elements = ImmutableList.of(
createEClass(),
createEDataType(),
createEPackage()
);
for(ENamedElement classifier: elements) {
classifier.setName("Same");
}
expected.addAll(elements.subList(0, 2));
helper.checkUniqueNames(
Scopes.scopedElementsFor(elements),
this, this);
assertEquals(elements.size(), callCount);
assertTrue(expected.isEmpty());
}
示例2: testCreatedErrors_04
import org.eclipse.emf.ecore.ENamedElement; //导入方法依赖的package包/类
@Test public void testCreatedErrors_04() {
maxCallCount = 0;
ImmutableList<ENamedElement> elements = ImmutableList.of(
createEClass(),
createEDataType(),
createEPackage(),
createEPackage()
);
for(ENamedElement classifier: elements) {
classifier.setName("Same");
}
expected.addAll(elements);
helper.checkUniqueNames(
Scopes.scopedElementsFor(elements),
this, this);
assertEquals(elements.size(), callCount);
assertTrue(expected.isEmpty());
}
示例3: testCreatedErrors_05
import org.eclipse.emf.ecore.ENamedElement; //导入方法依赖的package包/类
@Test public void testCreatedErrors_05() {
maxCallCount = 0;
ImmutableList<ENamedElement> elements = ImmutableList.of(
createEPackage(),
createEDataType(),
createEPackage()
);
for(ENamedElement classifier: elements) {
classifier.setName("Same");
}
expected.add(elements.get(0));
expected.add(elements.get(2));
helper.checkUniqueNames(
Scopes.scopedElementsFor(elements),
this, this);
assertEquals(elements.size(), callCount);
assertTrue(expected.isEmpty());
}
示例4: testCreatedErrors_06
import org.eclipse.emf.ecore.ENamedElement; //导入方法依赖的package包/类
@Test public void testCreatedErrors_06() {
maxCallCount = 1;
ImmutableList<ENamedElement> elements = ImmutableList.of(
createEPackage(),
createEDataType(),
createEPackage()
);
for(ENamedElement classifier: elements) {
classifier.setName("Same");
}
try {
helper.checkUniqueNames(
Scopes.scopedElementsFor(elements),
this, this);
fail("cancellation expected");
} catch (OperationCanceledError e) {
}
assertEquals(1, callCount);
}
示例5: testCreatedErrors_07
import org.eclipse.emf.ecore.ENamedElement; //导入方法依赖的package包/类
@Test public void testCreatedErrors_07() {
maxCallCount = 0;
ImmutableList<ENamedElement> elements = ImmutableList.of(
createEPackage(),
createEDataType(),
EcoreFactory.eINSTANCE.createEEnumLiteral()
);
for(ENamedElement classifier: elements) {
classifier.setName("Same");
}
expected.add(elements.get(0));
expected.add(elements.get(2));
helper.checkUniqueNames(
Scopes.scopedElementsFor(elements),
this, this);
assertEquals(elements.size(), callCount);
assertTrue(expected.isEmpty());
}
示例6: createNamedElement
import org.eclipse.emf.ecore.ENamedElement; //导入方法依赖的package包/类
private ENamedElement createNamedElement(QualifiedName qualifiedName, EClass type, Resource resource) {
ENamedElement result = (ENamedElement) EcoreUtil.create(type);
if (qualifiedName != null)
result.setName(qualifiedName.getFirstSegment());
else
result.setName("" + nameCount++);
if (resource != null)
resource.getContents().add(result);
return result;
}
示例7: createElement
import org.eclipse.emf.ecore.ENamedElement; //导入方法依赖的package包/类
private ENamedElement createElement(EClass eclass) {
ENamedElement element = (ENamedElement) EcoreFactory.eINSTANCE.create(eclass);
element.setName(Integer.toString(objectCreationIndex++));
return element;
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:6,代码来源:TypeBasedDerivedStateComputerSorterTest.java