本文整理汇总了Java中org.eclipse.emf.ecore.EObject.eContainingFeature方法的典型用法代码示例。如果您正苦于以下问题:Java EObject.eContainingFeature方法的具体用法?Java EObject.eContainingFeature怎么用?Java EObject.eContainingFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.ecore.EObject
的用法示例。
在下文中一共展示了EObject.eContainingFeature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exposeType
import org.eclipse.emf.ecore.EObject; //导入方法依赖的package包/类
/**
* If 'object' is a type or a constituent of a type (e.g. field of a class) in 'internalTypes', then move the type
* to 'exposedInternalTypes'.
*/
private static void exposeType(Object object) {
if (!(object instanceof EObject) || ((EObject) object).eIsProxy()) {
return;
}
// object might not be a type but reside inside a type, e.g. field of a class
// --> so search for the root, i.e. the ancestor directly below the TModule
EObject rootTMP = (EObject) object;
while (rootTMP != null && !(rootTMP.eContainer() instanceof TModule)) {
rootTMP = rootTMP.eContainer();
}
final EObject root = rootTMP; // must be final for the lambda below
if (root instanceof Type
&& root.eContainingFeature() == TypesPackage.eINSTANCE.getTModule_InternalTypes()) {
final TModule module = (TModule) root.eContainer();
EcoreUtilN4.doWithDeliver(false, () -> {
module.getExposedInternalTypes().add((Type) root);
}, module, root); // note: root already contained in resource, so suppress notifications also in root!
// everything referenced by the type we just moved to 'exposedInternalTypes' has to be exposed as well
// (this is required, for example, if 'root' is a structural type, see:
// org.eclipse.n4js.xpect.ui.tests/testdata_ui/typesystem/structuralTypeRefWithMembersAcrossFiles/Main.n4js.xt)
exposeTypesReferencedBy(root);
}
}