Search in sources :

Example 1 with IOutlineNode

use of org.eclipse.xtext.ui.editor.outline.IOutlineNode in project xtext-xtend by eclipse.

the class AbstractMultiModeOutlineTreeProvider method buildImportSectionNode.

@Override
public IXtendOutlineContext buildImportSectionNode(XtendFile xtendFile, IXtendOutlineContext context) {
    EclipseXtendOutlineContext eclipseXtendOutlineContext = (EclipseXtendOutlineContext) context;
    IOutlineNode parentNode = eclipseXtendOutlineContext.getParentNode();
    EStructuralFeatureNode node = getOutlineNodeFactory().createEStructuralFeatureNode(parentNode, xtendFile.getImportSection(), XtypePackage.Literals.XIMPORT_SECTION__IMPORT_DECLARATIONS, images.forImportContainer(), "import declarations", false);
    return eclipseXtendOutlineContext.withParentNode(node);
}
Also used : EStructuralFeatureNode(org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode) IOutlineNode(org.eclipse.xtext.ui.editor.outline.IOutlineNode)

Example 2 with IOutlineNode

use of org.eclipse.xtext.ui.editor.outline.IOutlineNode in project xtext-xtend by eclipse.

the class AbstractMultiModeOutlineTreeProvider method buildFeatureNode.

@Override
public IXtendOutlineContext buildFeatureNode(JvmDeclaredType inferredType, EObject semanticFeature, IXtendOutlineContext context) {
    EclipseXtendOutlineContext eclipseXtendOutlineContext = (EclipseXtendOutlineContext) context;
    IOutlineNode parentNode = eclipseXtendOutlineContext.getParentNode();
    int inheritanceDepth = eclipseXtendOutlineContext.getInheritanceDepth();
    XtendFeatureNode featureNode = createNodeForFeature(parentNode, inferredType, semanticFeature, inheritanceDepth);
    return eclipseXtendOutlineContext.withParentNode(featureNode);
}
Also used : IOutlineNode(org.eclipse.xtext.ui.editor.outline.IOutlineNode)

Example 3 with IOutlineNode

use of org.eclipse.xtext.ui.editor.outline.IOutlineNode in project xtext-xtend by eclipse.

the class AbstractMultiModeOutlineTreeProvider method buildPackageNode.

@Override
public IXtendOutlineContext buildPackageNode(XtendFile xtendFile, IXtendOutlineContext context) {
    EclipseXtendOutlineContext eclipseXtendOutlineContext = (EclipseXtendOutlineContext) context;
    IOutlineNode parentNode = eclipseXtendOutlineContext.getParentNode();
    String primaryPackage = xtendFile.getPackage();
    EStructuralFeatureNode node = getOutlineNodeFactory().createEStructuralFeatureNode(parentNode, xtendFile, XtendPackage.Literals.XTEND_FILE__PACKAGE, images.forPackage(), primaryPackage, true);
    return eclipseXtendOutlineContext.withParentNode(node);
}
Also used : EStructuralFeatureNode(org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode) StyledString(org.eclipse.jface.viewers.StyledString) IOutlineNode(org.eclipse.xtext.ui.editor.outline.IOutlineNode)

Example 4 with IOutlineNode

use of org.eclipse.xtext.ui.editor.outline.IOutlineNode in project xtext-xtend by eclipse.

the class AbstractMultiModeOutlineTreeProvider method buildResolvedFeatureNode.

@Override
public IXtendOutlineContext buildResolvedFeatureNode(JvmDeclaredType inferredType, IResolvedFeature resolvedFeature, IXtendOutlineContext context) {
    EclipseXtendOutlineContext eclipseXtendOutlineContext = (EclipseXtendOutlineContext) context;
    IOutlineNode parentNode = eclipseXtendOutlineContext.getParentNode();
    int inheritanceDepth = eclipseXtendOutlineContext.getInheritanceDepth();
    XtendFeatureNode node = createNodeForResolvedFeature(parentNode, inferredType, resolvedFeature, inheritanceDepth);
    return eclipseXtendOutlineContext.withParentNode(node);
}
Also used : IOutlineNode(org.eclipse.xtext.ui.editor.outline.IOutlineNode)

Example 5 with IOutlineNode

use of org.eclipse.xtext.ui.editor.outline.IOutlineNode in project xtext-xtend by eclipse.

the class AbstractMultiModeOutlineTreeProvider method buildDispatcherNode.

@Override
public IXtendOutlineContext buildDispatcherNode(JvmDeclaredType baseType, JvmFeature dispatcher, List<JvmOperation> dispatchCases, IXtendOutlineContext context) {
    EclipseXtendOutlineContext eclipseXtendOutlineContext = (EclipseXtendOutlineContext) context;
    IOutlineNode parentNode = eclipseXtendOutlineContext.getParentNode();
    int inheritanceDepth = eclipseXtendOutlineContext.getInheritanceDepth();
    XtendFeatureNode dispatcherNode = createNodeForFeature(parentNode, baseType, dispatcher, inheritanceDepth);
    dispatcherNode.setDispatch(true);
    if (isInheritsDispatchCases(baseType, dispatchCases)) {
        dispatcherNode.setImageDescriptor(images.forDispatcherFunction(dispatcher.getVisibility(), adornments.get(dispatcher) | JavaElementImageDescriptor.OVERRIDES));
    }
    return eclipseXtendOutlineContext.withParentNode(dispatcherNode);
}
Also used : IOutlineNode(org.eclipse.xtext.ui.editor.outline.IOutlineNode)

Aggregations

IOutlineNode (org.eclipse.xtext.ui.editor.outline.IOutlineNode)13 EObjectNode (org.eclipse.xtext.ui.editor.outline.impl.EObjectNode)4 StyledString (org.eclipse.jface.viewers.StyledString)2 EStructuralFeatureNode (org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode)2 ITextRegion (org.eclipse.xtext.util.ITextRegion)2 EObject (org.eclipse.emf.ecore.EObject)1 ITextSelection (org.eclipse.jface.text.ITextSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 XtendFile (org.eclipse.xtend.core.xtend.XtendFile)1 IXtendOutlineContext (org.eclipse.xtend.ide.common.outline.IXtendOutlineContext)1 JvmDeclaredType (org.eclipse.xtext.common.types.JvmDeclaredType)1 XtextEditor (org.eclipse.xtext.ui.editor.XtextEditor)1 XtextDocument (org.eclipse.xtext.ui.editor.model.XtextDocument)1 IOutlineTreeProvider (org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider)1 DocumentRootNode (org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode)1 TextRegion (org.eclipse.xtext.util.TextRegion)1 Test (org.junit.Test)1