Пример #1
0
 protected XtendFeatureNode createNodeForFeature(
     IOutlineNode parentNode,
     final JvmDeclaredType inferredType,
     JvmFeature jvmFeature,
     EObject semanticFeature,
     int inheritanceDepth) {
   final boolean synthetic = typeExtensions.isSynthetic(jvmFeature);
   Object text = getText(synthetic ? jvmFeature : semanticFeature);
   ImageDescriptor image = getImageDescriptor(synthetic ? jvmFeature : semanticFeature);
   if (jvmFeature.getDeclaringType() != inferredType) {
     if (getCurrentMode() == SHOW_INHERITED_MODE) {
       StyledString label =
           (text instanceof StyledString)
               ? (StyledString) text
               : new StyledString(text.toString());
       label.append(
           new StyledString(
               " - " + jvmFeature.getDeclaringType().getIdentifier(),
               StyledString.COUNTER_STYLER));
       return factory.createXtendFeatureNode(
           parentNode, jvmFeature, image, label, true, synthetic, inheritanceDepth);
     }
     return null;
   } else {
     return factory.createXtendFeatureNode(
         parentNode, semanticFeature, image, text, true, synthetic, inheritanceDepth);
   }
 }
Пример #2
0
 public void testOverriddenExtensionMethods_02() throws Exception {
   XbaseScopeProvider provider = get(XbaseScopeProvider.class);
   XExpression expression = expression("(null as java.util.Collection<String>).map(null)", true);
   IScope scope =
       provider.getScope(expression, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE);
   Iterable<IEObjectDescription> elements = scope.getElements(QualifiedName.create("map"));
   assertEquals(elements.toString(), 1, size(elements));
   IEObjectDescription description = elements.iterator().next();
   JvmFeature feature = (JvmFeature) description.getEObjectOrProxy();
   assertEquals(
       IterableExtensions.class.getCanonicalName(), feature.getDeclaringType().getIdentifier());
 }