use of org.eclipse.xtext.ui.editor.outline.impl.BackgroundOutlineTreeProvider in project osate2 by osate.
the class Aadl2OutlineTreeProvider method internalCreateChildren.
@Override
protected void internalCreateChildren(final IOutlineNode parentNode, final EObject modelElement) {
if (modelElement instanceof Element) {
final Element element = (Element) modelElement;
final EObject annexRoot = AnnexUtil.getAnnexRoot(element);
if (annexRoot != null) {
// delegate to annex specific outline tree provider
IParseResult annexParseResult = ParseResultHolder.Factory.INSTANCE.adapt(annexRoot).getParseResult();
if (annexParseResult != null) {
Injector injector = AnnexUtil.getInjector(annexParseResult);
if (injector != null) {
try {
final IOutlineTreeStructureProvider outlineTree = injector.getInstance(IOutlineTreeStructureProvider.class);
if (outlineTree instanceof BackgroundOutlineTreeProvider) {
outlineTree.createChildren(parentNode, element);
} else {
Aadl2Activator.getInstance().getLog().log(new Status(IStatus.ERROR, Aadl2Activator.PLUGIN_ID, IStatus.OK, "Annex outline tree structure provider '" + outlineTree.getClass().getCanonicalName() + "' does not implement BackgroundOutlineTreeProvider", null));
}
} catch (ConfigurationException e) {
// ignore: no outline provider for this annex
}
}
}
} else {
for (EObject childElement : element.getChildren()) {
if (childElement instanceof Realization || childElement instanceof TypeExtension || childElement instanceof ImplementationExtension || childElement instanceof ContainmentPathElement || childElement instanceof PropertyAssociation) {
continue;
}
if (element instanceof Connection && childElement instanceof ConnectedElement) {
continue;
}
createNode(parentNode, childElement);
}
}
}
}
Aggregations