Esempio n. 1
0
 @Override
 protected void internalCreateChildren(DocumentRootNode parentNode, EObject modelElement) {
   if (modelElement instanceof XtendFile) {
     XtendFile xtendFile = (XtendFile) modelElement;
     if (xtendFile.getPackage() != null)
       factory.createEStructuralFeatureNode(
           parentNode,
           xtendFile,
           XtendPackage.Literals.XTEND_FILE__PACKAGE,
           images.forPackage(),
           xtendFile.getPackage(),
           true);
     if (xtendFile.getImportSection() != null
         && !xtendFile.getImportSection().getImportDeclarations().isEmpty())
       factory.createEStructuralFeatureNode(
           parentNode,
           xtendFile.getImportSection(),
           XtypePackage.Literals.XIMPORT_SECTION__IMPORT_DECLARATIONS,
           images.forImportContainer(),
           "import declarations",
           false);
     for (XtendTypeDeclaration xtendType : xtendFile.getXtendTypes()) {
       EObjectNode classNode = createNode(parentNode, xtendType);
       createFeatureNodes(classNode, xtendType);
     }
   }
 }
Esempio n. 2
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);
   }
 }