Search in sources :

Example 1 with XtextCallHierarchyNode

use of org.eclipse.xtext.ui.editor.hierarchy.XtextCallHierarchyNode in project xtext-eclipse by eclipse.

the class XtextCallHierarchyBuilder method createChild.

@Override
protected IHierarchyNode createChild(final IEObjectDescription declaration, final IHierarchyNode parent) {
    final XtextCallHierarchyNode node = new XtextCallHierarchyNode();
    node.setParent(parent);
    node.setElement(declaration);
    node.setGrammarDescription(this.getGrammarDescription(declaration));
    node.setMayHaveChildren((this.isRule(declaration.getEClass()) && (!node.isRecursive())));
    return node;
}
Also used : XtextCallHierarchyNode(org.eclipse.xtext.ui.editor.hierarchy.XtextCallHierarchyNode)

Example 2 with XtextCallHierarchyNode

use of org.eclipse.xtext.ui.editor.hierarchy.XtextCallHierarchyNode in project xtext-eclipse by eclipse.

the class XtextCallHierarchyBuilderTest method internalToExpectation.

@Override
protected String internalToExpectation(final IHierarchyNode node, final IHierarchyBuilder builder) {
    final String superExpectation = super.internalToExpectation(node, builder);
    if ((node instanceof XtextCallHierarchyNode)) {
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("grammar: ");
        IEObjectDescription _grammarDescription = ((XtextCallHierarchyNode) node).getGrammarDescription();
        _builder.append(_grammarDescription);
        _builder.newLineIfNotEmpty();
        _builder.append(superExpectation);
        _builder.newLineIfNotEmpty();
        return _builder.toString();
    }
    return superExpectation;
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) XtextCallHierarchyNode(org.eclipse.xtext.ui.editor.hierarchy.XtextCallHierarchyNode) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription)

Example 3 with XtextCallHierarchyNode

use of org.eclipse.xtext.ui.editor.hierarchy.XtextCallHierarchyNode in project xtext-eclipse by eclipse.

the class XtextCallHierarchyBuilder method createRoot.

@Override
protected IHierarchyNode createRoot(final IEObjectDescription declaration) {
    final XtextCallHierarchyNode node = new XtextCallHierarchyNode();
    node.setElement(declaration);
    node.setGrammarDescription(this.getGrammarDescription(declaration));
    node.setMayHaveChildren(true);
    return node;
}
Also used : XtextCallHierarchyNode(org.eclipse.xtext.ui.editor.hierarchy.XtextCallHierarchyNode)

Aggregations

XtextCallHierarchyNode (org.eclipse.xtext.ui.editor.hierarchy.XtextCallHierarchyNode)3 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)1 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)1