Search in sources :

Example 1 with IHierarchyNodeReference

use of org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNodeReference in project xtext-eclipse by eclipse.

the class AbstractHierarchyBuilderTest method internalToExpectation.

protected String internalToExpectation(IHierarchyNode node, IHierarchyBuilder builder) {
    StringConcatenation richString = new StringConcatenation();
    for (IHierarchyNodeReference location : node.getReferences()) {
        richString.append(toExpectation(location));
        richString.newLineIfNotEmpty();
    }
    if (node.mayHaveChildren()) {
        for (IHierarchyNode childNode : builder.buildChildren(node, null)) {
            richString.append(toExpectation(childNode, builder));
            richString.newLineIfNotEmpty();
        }
    }
    return richString.toString();
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) IHierarchyNode(org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNode) IHierarchyNodeReference(org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNodeReference)

Example 2 with IHierarchyNodeReference

use of org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNodeReference in project xtext-core by eclipse.

the class DefaultHierarchyNode method getNavigationElement.

@Override
public Object getNavigationElement() {
    Object _elvis = null;
    IHierarchyNodeReference _head = IterableExtensions.<IHierarchyNodeReference>head(this.references);
    if (_head != null) {
        _elvis = _head;
    } else {
        _elvis = this.element;
    }
    return _elvis;
}
Also used : IHierarchyNodeReference(org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNodeReference)

Aggregations

IHierarchyNodeReference (org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNodeReference)2 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)1 IHierarchyNode (org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNode)1