Search in sources :

Example 11 with IXtendOutlineContext

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

the class XtendOutlineSourceTreeBuilder method buildDispatchers.

protected void buildDispatchers(final JvmDeclaredType inferredType, final JvmDeclaredType baseType, final IXtendOutlineContext context) {
    final Function1<JvmOperation, Boolean> _function = (JvmOperation it) -> {
        return Boolean.valueOf(this.dispatchHelper.isDispatcherFunction(it));
    };
    Iterable<JvmOperation> _filter = IterableExtensions.<JvmOperation>filter(inferredType.getDeclaredOperations(), _function);
    for (final JvmOperation dispatcher : _filter) {
        {
            final List<JvmOperation> dispatchCases = this.getDispatchCases(dispatcher, baseType, context);
            final IXtendOutlineContext dispatcherContext = this.xtendOutlineNodeBuilder.buildDispatcherNode(baseType, dispatcher, dispatchCases, context).markAsProcessed(dispatcher);
            for (final JvmOperation dispatchCase : dispatchCases) {
                EObject _elvis = null;
                XtendFunction _xtendFunction = this._iXtendJvmAssociations.getXtendFunction(dispatchCase);
                if (_xtendFunction != null) {
                    _elvis = _xtendFunction;
                } else {
                    _elvis = dispatchCase;
                }
                this.buildFeature(baseType, dispatchCase, _elvis, dispatcherContext).markAsProcessed(dispatchCase);
            }
        }
    }
}
Also used : JvmOperation(org.eclipse.xtext.common.types.JvmOperation) XtendFunction(org.eclipse.xtend.core.xtend.XtendFunction) IXtendOutlineContext(org.eclipse.xtend.ide.common.outline.IXtendOutlineContext) EObject(org.eclipse.emf.ecore.EObject) EList(org.eclipse.emf.common.util.EList) List(java.util.List)

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