use of org.eclipse.n4js.organize.imports.ImportProvidedElement in project n4js by eclipse.
the class ImportProvidedElementLabelprovider method getText.
@Override
public String getText(Object element) {
if (element instanceof ImportableObject) {
ImportableObject io = (ImportableObject) element;
return getText(io.getTe());
}
if (element instanceof ImportProvidedElement) {
ImportProvidedElement ele = ((ImportProvidedElement) element);
TModule tm = ((ImportDeclaration) ele.getImportSpecifier().eContainer()).getModule();
return ele.getLocalName() + " from " + findLocation(tm);
}
if (element instanceof IEObjectDescription) {
IEObjectDescription ieod = (IEObjectDescription) element;
EObject eo = ieod.getEObjectOrProxy();
if (eo instanceof TExportableElement && !eo.eIsProxy()) {
return getText(eo);
}
return ieod.getName().getLastSegment() + " from " + qualifiedNameConverter.toString(ieod.getName().skipLast(1));
}
if (element instanceof TExportableElement) {
TExportableElement te = (TExportableElement) element;
return te.getName() + " (exported as " + te.getExportedName() + ") from " + findLocation(te.getContainingModule());
}
return n4Labelprovider.getText(element);
}
Aggregations