public TestStepContext getTestStepContext(final EObject eObject) { TestStepContext _xifexpression = null; if ((eObject instanceof TestStepContext)) { _xifexpression = ((TestStepContext)eObject); } else { _xifexpression = EcoreUtil2.<TestStepContext>getContainerOfType(eObject, TestStepContext.class); } return _xifexpression; }
public static List<Action> containedActions(EObject e) { List<Action> allContentsOfType = getAllContentsOfType(e, Action.class); return allContentsOfType; }
protected boolean isAssignable(final EClass superType, final EClassifier type) { if ((type instanceof EClass)) { return EcoreUtil2.isAssignableFrom(superType, ((EClass)type)); } return false; }
public IScope scope_ReferencedXMAComposite_xmaComposite(ReferencedXMAComposite referencedXMAComposite, EReference eReference) { ReferencedXMAPage containingPage = EcoreUtil2.getContainerOfType(referencedXMAComposite, ReferencedXMAPage.class); XMAPage xmaPage = containingPage.getXmaPage(); return new SimpleScope(Scopes.scopedElementsFor(EcoreUtil2.getAllContentsOfType(xmaPage, XMAComposite.class), guiDesignNameFunction)); }
if (EcoreUtil2.isAssignableFrom(EcorePackage.Literals.EPACKAGE, refType)) { PackageImport importDecl = EcoreUtil2.getContainerOfType(ctx, PackageImport.class); if (importDecl == null) { return IScope.NULLSCOPE; } else if (EcoreUtil2.isAssignableFrom(PatternLanguagePackage.Literals.PACKAGE_IMPORT, refType)) { return scope_PackageImport(ctx); } else if (EcoreUtil2.isAssignableFrom(EcorePackage.Literals.EENUM, refType)) { EnumValue containingValue = EcoreUtil2.getContainerOfType(ctx, EnumValue.class); if (containingValue != null) { return scope_EEnum(containingValue); } else if (EcoreUtil2.isAssignableFrom(EcorePackage.Literals.ECLASSIFIER, refType)) { ClassType containingClassDeclaration = EcoreUtil2.getContainerOfType(ctx, ClassType.class); if (containingClassDeclaration != null) { return scope_EClassifier(containingClassDeclaration); } else if (EcoreUtil2.isAssignableFrom(PatternLanguagePackage.Literals.VARIABLE, refType)) { PatternBody containingBody = EcoreUtil2.getContainerOfType(ctx, PatternBody.class); if (containingBody != null) { return scope_Variable((PatternBody) containingBody); AnnotationParameter containingAnnotationParameter = EcoreUtil2.getContainerOfType(ctx, AnnotationParameter.class); if (containingAnnotationParameter != null) { return scope_Variable(containingAnnotationParameter); } else if (EcoreUtil2.isAssignableFrom(EcorePackage.Literals.ESTRUCTURAL_FEATURE, refType)) { return scope_EStructuralFeature(ctx);
public DefaultReferenceDescription(EObject from, EObject to, EReference eReference, int i, URI containerEObjectURI) { this.sourceEObjectUri = EcoreUtil2.getPlatformResourceOrNormalizedURI(from); this.targetEObjectUri = EcoreUtil2.getPlatformResourceOrNormalizedURI(to); this.eReference = eReference; this.indexInList = i; this.containerEObjectURI = containerEObjectURI; }
public void setContext(Notifier ctx) { this.resourceSet = EcoreUtil2.getResourceSet(ctx); }
protected void resolveProxies(final Resource resource, final CancelIndicator monitor) { EcoreUtil2.resolveLazyCrossReferences(resource, monitor); }
protected void computeReferencedJvmTypeHighlighting(IHighlightedPositionAcceptor acceptor, EObject referencer, CancelIndicator cancelIndicator) { for (EReference reference : referencer.eClass().getEAllReferences()) { EClass referencedType = reference.getEReferenceType(); if (EcoreUtil2.isAssignableFrom(TypesPackage.Literals.JVM_TYPE, referencedType)) { List<EObject> referencedObjects = EcoreUtil2.getAllReferencedObjects(referencer, reference); if (referencedObjects.size() > 0) operationCanceledManager.checkCanceled(cancelIndicator); for (EObject referencedObject : referencedObjects) { EObject resolvedReferencedObject = EcoreUtil.resolve(referencedObject, referencer); if (resolvedReferencedObject != null && !resolvedReferencedObject.eIsProxy()) { highlightReferenceJvmType(acceptor, referencer, reference, resolvedReferencedObject); } } } } }
/** * @since 2.3 */ protected Iterable<URI> getTargetURIs(EObject target) { return singleton(EcoreUtil2.getPlatformResourceOrNormalizedURI(target)); }
public void setContext(Notifier ctx) { this.resourceSet = EcoreUtil2.getResourceSet(ctx); }
protected void doLinking() { doIndex(); for (Resource resource : sources) { EcoreUtil2.resolveLazyCrossReferences(resource, CancelIndicator.NullImpl); } }
public boolean shouldForceStatementMode(final EObject targetElement) { return (((targetElement != null) && (!((targetElement instanceof XAnnotation) || (targetElement instanceof XtendExecutable)))) && (EcoreUtil2.<XtendExecutable>getContainerOfType(targetElement, XtendExecutable.class) != null)); } }
public static List<RuleCall> containedRuleCalls(EObject e) { return getAllContentsOfType(e, RuleCall.class); }
/** * @Nullable */ protected String getTypeName(final EClass c, final EStructuralFeature referingFeature) { if ((referingFeature == XAnnotationsPackage.Literals.XANNOTATION__ANNOTATION_TYPE)) { return " to an annotation type"; } if ((c == TypesPackage.Literals.JVM_ENUMERATION_TYPE)) { return " to an enum type"; } boolean _isAssignableFrom = EcoreUtil2.isAssignableFrom(TypesPackage.Literals.JVM_TYPE, c); if (_isAssignableFrom) { return " to a type"; } if ((c == TypesPackage.Literals.JVM_OPERATION)) { return " to an operation"; } return ""; } }
protected Iterable<URI> getTargetURIs(EObject primaryTarget) { return singleton(EcoreUtil2.getPlatformResourceOrNormalizedURI(primaryTarget)); }
@Nullable private JvmAnnotationType findAnnotationType(Class<? extends Annotation> type, Notifier context) { ResourceSet resourceSet = EcoreUtil2.getResourceSet(context); if (resourceSet == null) return null; IJvmTypeProvider typeProvider = typeProviderFactory.findOrCreateTypeProvider(resourceSet); try { final JvmType result = typeProvider.findTypeByName(type.getName()); if (result instanceof JvmAnnotationType) return (JvmAnnotationType) result; return null; } catch (RuntimeException e) { return null; } }
private Resource getResource(URI modelUri) { Resource resource = this.resourceSet.getResource(modelUri, true); EcoreUtil2.resolveLazyCrossReferences(resource, CancelIndicator.NullImpl); return resource; }
private boolean isPrivateAPICaller(JvmIdentifiableElement element) { JvmMember featureContainer = EcoreUtil2.getContainerOfType(element, JvmMember.class); while (featureContainer != null) { if (this.annotations.findAnnotation(featureContainer, PrivateAPI.class.getName()) != null) { return true; } featureContainer = EcoreUtil2.getContainerOfType(featureContainer.eContainer(), JvmMember.class); } return false; }
public static List<Keyword> containedKeywords(EObject e) { return getAllContentsOfType(e, Keyword.class); }