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;
}
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));
}
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();
}
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;
}
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();
}
Aggregations