use of org.eclipse.xtext.xbase.typesystem.override.IResolvedFeature in project xtext-xtend by eclipse.
the class AbstractMultiModeOutlineTreeProvider method computeDecoratedText.
protected Object computeDecoratedText(final Object modelElement, final int inheritanceDepth) {
Object supertext = super.getText(modelElement);
if (!(supertext instanceof StyledString)) {
return supertext;
}
StyledString styledText = (StyledString) supertext;
if (inheritanceDepth > 0) {
styledText = applyStylerToFirstSegment(styledText, ColoringLabelProvider.INHERITED_STYLER);
}
if (modelElement instanceof JvmIdentifiableElement) {
JvmIdentifiableElement jvmElement = (JvmIdentifiableElement) modelElement;
if (!getAssociations().getSourceElements(jvmElement).isEmpty() && !getAssociations().isPrimaryJvmElement(jvmElement)) {
styledText = applyStylerToFirstSegment(styledText, StyledString.QUALIFIER_STYLER);
}
}
if (isShowInherited()) {
if (modelElement instanceof IResolvedFeature) {
String qualifier = createQualifier((IResolvedFeature) modelElement);
appendQualifier(styledText, qualifier);
} else if (modelElement instanceof JvmMember) {
String qualifier = createQualifier((JvmMember) modelElement);
appendQualifier(styledText, qualifier);
} else if (modelElement instanceof XtendMember) {
XtendMember xtendMember = (XtendMember) modelElement;
if (xtendMember.eContainer() instanceof XtendTypeDeclaration) {
String qualifiedName = createQualifier((XtendTypeDeclaration) xtendMember.eContainer(), '.');
appendQualifier(styledText, qualifiedName);
} else if (xtendMember instanceof XtendTypeDeclaration) {
XtendFile xtendFile = EcoreUtil2.getContainerOfType(xtendMember, XtendFile.class);
String qualifiedName = xtendFile.getPackage() == null ? "(default package)" : xtendFile.getPackage();
appendQualifier(styledText, qualifiedName);
}
}
}
return styledText;
}
Aggregations