Search in sources :

Example 1 with IHierarchyNode

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

the class HierarchyLabelProvider method getImage.

@Override
public Image getImage(final Object element) {
    if ((element instanceof PendingUpdateAdapter)) {
        return null;
    }
    final Image image = this.globalDescriptionProvider.getImage(this.getDescription(element));
    if ((image == null)) {
        return null;
    }
    boolean _matched = false;
    if (element instanceof IHierarchyNode) {
        boolean _isRecursive = ((IHierarchyNode) element).isRecursive();
        if (_isRecursive) {
            _matched = true;
            return this.decorateRecursive(image);
        }
    }
    return image;
}
Also used : PendingUpdateAdapter(org.eclipse.ui.progress.PendingUpdateAdapter) IHierarchyNode(org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNode) Image(org.eclipse.swt.graphics.Image)

Example 2 with IHierarchyNode

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

the class DefaultCallHierarchyBuilder method buildRoots.

@Override
public Collection<IHierarchyNode> buildRoots(final URI rootURI, final IProgressMonitor monitor) {
    final IEObjectDescription rootDeclaration = this.findDeclaration(rootURI);
    if ((rootDeclaration == null)) {
        return CollectionLiterals.<IHierarchyNode>emptyList();
    }
    IHierarchyNode _createRoot = this.createRoot(rootDeclaration);
    return Collections.<IHierarchyNode>unmodifiableList(CollectionLiterals.<IHierarchyNode>newArrayList(_createRoot));
}
Also used : IHierarchyNode(org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNode) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription)

Example 3 with IHierarchyNode

use of org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNode 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 4 with IHierarchyNode

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

the class DefaultCallHierarchyBuilder method createChild.

protected IHierarchyNode createChild(final Map<URI, IHierarchyNode> children, final IEObjectDescription declaration, final IHierarchyNode parent) {
    if ((declaration == null)) {
        return null;
    }
    IHierarchyNode childNode = children.get(declaration.getEObjectURI());
    if ((childNode == null)) {
        childNode = this.createChild(declaration, parent);
        children.put(declaration.getEObjectURI(), childNode);
    }
    return childNode;
}
Also used : IHierarchyNode(org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNode)

Example 5 with IHierarchyNode

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

the class AbstractHierarchyBuilderTest method toExpectation.

protected String toExpectation(URI rootURI, IHierarchyBuilder builder) {
    StringConcatenation richString = new StringConcatenation();
    for (IHierarchyNode root : builder.buildRoots(rootURI, null)) {
        richString.append(toExpectation(root, builder));
        richString.newLineIfNotEmpty();
    }
    return richString.toString();
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) IHierarchyNode(org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNode)

Aggregations

IHierarchyNode (org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNode)7 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)2 Image (org.eclipse.swt.graphics.Image)1 PendingUpdateAdapter (org.eclipse.ui.progress.PendingUpdateAdapter)1 DefaultHierarchyRoot (org.eclipse.xtext.ide.editor.hierarchy.DefaultHierarchyRoot)1 IHierarchyNodeReference (org.eclipse.xtext.ide.editor.hierarchy.IHierarchyNodeReference)1 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)1