use of com.intellij.util.text.ElementPresentation in project intellij-community by JetBrains.
the class PsiDiffContentFactory method comparePsiElements.
@Nullable
public static DiffRequest comparePsiElements(@NotNull PsiElement psiElement1, @NotNull PsiElement psiElement2) {
if (!psiElement1.isValid() || !psiElement2.isValid())
return null;
Project project = psiElement1.getProject();
LOG.assertTrue(project == psiElement2.getProject());
DiffContent content1 = fromPsiElement(psiElement1);
DiffContent content2 = fromPsiElement(psiElement2);
if (content1 == null || content2 == null)
return null;
final ElementPresentation presentation1 = ElementPresentation.forElement(psiElement1);
final ElementPresentation presentation2 = ElementPresentation.forElement(psiElement2);
String title = DiffBundle.message("diff.element.qualified.name.vs.element.qualified.name.dialog.title", presentation1.getQualifiedName(), presentation2.getQualifiedName());
return new SimpleDiffRequest(title, content1, content2, presentation1.getQualifiedName(), presentation2.getQualifiedName());
}
Aggregations