Search in sources :

Example 1 with IXtendOutlineContext

use of org.eclipse.xtend.ide.common.outline.IXtendOutlineContext in project xtext-xtend by eclipse.

the class AbstractXtendOutlineTreeBuilder method buildMembers.

protected void buildMembers(final JvmDeclaredType inferredType, final JvmDeclaredType baseType, @Extension final IXtendOutlineContext context) {
    EList<JvmMember> _members = inferredType.getMembers();
    for (final JvmMember member : _members) {
        boolean _isProcessed = context.isProcessed(member);
        boolean _not = (!_isProcessed);
        if (_not) {
            if ((member instanceof JvmDeclaredType)) {
                boolean _isShowInherited = context.isShowInherited();
                if (_isShowInherited) {
                    final IXtendOutlineContext typeContext = context.newContext();
                    final EObject sourceElement = this._iXtendJvmAssociations.getPrimarySourceElement(member);
                    if ((sourceElement instanceof XtendTypeDeclaration)) {
                        this.buildType(sourceElement, typeContext);
                    } else {
                        this.buildJvmType(((JvmDeclaredType) member), typeContext);
                    }
                } else {
                    this.buildJvmType(((JvmDeclaredType) member), context);
                }
            } else {
                if ((member instanceof JvmFeature)) {
                    boolean _skipFeature = this.skipFeature(((JvmFeature) member));
                    boolean _not_1 = (!_skipFeature);
                    if (_not_1) {
                        final IXtendOutlineContext featureContext = this.buildFeature(baseType, ((JvmFeature) member), member, context);
                        final Consumer<JvmGenericType> _function = (JvmGenericType it) -> {
                            this.buildJvmType(it, featureContext.newContext());
                        };
                        ((JvmFeature) member).getLocalClasses().forEach(_function);
                    }
                }
            }
            context.markAsProcessed(member);
        }
    }
    boolean _isShowInherited_1 = context.isShowInherited();
    if (_isShowInherited_1) {
        this.buildInheritedMembers(inferredType, context);
    }
}
Also used : JvmFeature(org.eclipse.xtext.common.types.JvmFeature) IXtendOutlineContext(org.eclipse.xtend.ide.common.outline.IXtendOutlineContext) EObject(org.eclipse.emf.ecore.EObject) XtendTypeDeclaration(org.eclipse.xtend.core.xtend.XtendTypeDeclaration) JvmGenericType(org.eclipse.xtext.common.types.JvmGenericType) JvmDeclaredType(org.eclipse.xtext.common.types.JvmDeclaredType) JvmMember(org.eclipse.xtext.common.types.JvmMember)

Example 2 with IXtendOutlineContext

use of org.eclipse.xtend.ide.common.outline.IXtendOutlineContext in project xtext-xtend by eclipse.

the class AbstractXtendOutlineTreeBuilder method buildJvmType.

protected void buildJvmType(final JvmDeclaredType typeElement, final IXtendOutlineContext context) {
    final IXtendOutlineContext jvmTypeContext = this.xtendOutlineNodeBuilder.buildXtendNode(typeElement, context);
    boolean _isProcessed = jvmTypeContext.isProcessed(typeElement);
    boolean _not = (!_isProcessed);
    if (_not) {
        jvmTypeContext.markAsProcessed(typeElement);
        this.buildMembers(typeElement, typeElement, jvmTypeContext);
    }
}
Also used : IXtendOutlineContext(org.eclipse.xtend.ide.common.outline.IXtendOutlineContext)

Example 3 with IXtendOutlineContext

use of org.eclipse.xtend.ide.common.outline.IXtendOutlineContext in project xtext-xtend by eclipse.

the class XtendOutlineSourceTreeBuilder method buildLocalClasses.

protected void buildLocalClasses(final JvmFeature jvmFeature, final IXtendOutlineContext context) {
    boolean _isEmpty = jvmFeature.getLocalClasses().isEmpty();
    boolean _not = (!_isEmpty);
    if (_not) {
        EList<JvmGenericType> _localClasses = jvmFeature.getLocalClasses();
        for (final JvmGenericType jvmGenericType : _localClasses) {
            {
                final IXtendOutlineContext typeContext = context.newContext();
                Set<EObject> _sourceElements = this._iXtendJvmAssociations.getSourceElements(jvmGenericType);
                for (final EObject sourceElement : _sourceElements) {
                    this.buildType(sourceElement, typeContext);
                }
            }
        }
    }
}
Also used : Set(java.util.Set) IXtendOutlineContext(org.eclipse.xtend.ide.common.outline.IXtendOutlineContext) EObject(org.eclipse.emf.ecore.EObject) JvmGenericType(org.eclipse.xtext.common.types.JvmGenericType)

Example 4 with IXtendOutlineContext

use of org.eclipse.xtend.ide.common.outline.IXtendOutlineContext in project xtext-xtend by eclipse.

the class AbstractMultiModeOutlineTreeProvider method internalCreateChildren.

@Override
public void internalCreateChildren(DocumentRootNode parentNode, EObject modelElement) {
    IXtendOutlineContext context = newContext(parentNode);
    xtendOutlineTreeBuilder.build(modelElement, context);
}
Also used : IXtendOutlineContext(org.eclipse.xtend.ide.common.outline.IXtendOutlineContext)

Example 5 with IXtendOutlineContext

use of org.eclipse.xtend.ide.common.outline.IXtendOutlineContext in project xtext-xtend by eclipse.

the class AbstractMultiModeOutlineTreeProvider method internalCreateChildren.

@Override
protected void internalCreateChildren(IOutlineNode parentNode, EObject modelElement) {
    IXtendOutlineContext context = newContext(parentNode);
    xtendOutlineTreeBuilder.build(modelElement, context);
}
Also used : IXtendOutlineContext(org.eclipse.xtend.ide.common.outline.IXtendOutlineContext)

Aggregations

IXtendOutlineContext (org.eclipse.xtend.ide.common.outline.IXtendOutlineContext)11 EObject (org.eclipse.emf.ecore.EObject)4 JvmDeclaredType (org.eclipse.xtext.common.types.JvmDeclaredType)4 List (java.util.List)2 EList (org.eclipse.emf.common.util.EList)2 JvmGenericType (org.eclipse.xtext.common.types.JvmGenericType)2 Set (java.util.Set)1 Consumer (java.util.function.Consumer)1 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)1 StyledString (org.eclipse.jface.viewers.StyledString)1 XtendFile (org.eclipse.xtend.core.xtend.XtendFile)1 XtendFunction (org.eclipse.xtend.core.xtend.XtendFunction)1 XtendMember (org.eclipse.xtend.core.xtend.XtendMember)1 XtendTypeDeclaration (org.eclipse.xtend.core.xtend.XtendTypeDeclaration)1 JvmFeature (org.eclipse.xtext.common.types.JvmFeature)1 JvmMember (org.eclipse.xtext.common.types.JvmMember)1 JvmOperation (org.eclipse.xtext.common.types.JvmOperation)1 JvmType (org.eclipse.xtext.common.types.JvmType)1 IOutlineNode (org.eclipse.xtext.ui.editor.outline.IOutlineNode)1 DocumentRootNode (org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode)1