Search in sources :

Example 1 with UsageViewManager

use of com.intellij.usages.UsageViewManager in project intellij-community by JetBrains.

the class InheritanceToDelegationProcessor method showObjectUpcastedUsageView.

private void showObjectUpcastedUsageView(final ObjectUpcastedUsageInfo[] usages) {
    UsageViewPresentation presentation = new UsageViewPresentation();
    presentation.setTargetsNodeText(RefactoringBundle.message("replacing.inheritance.with.delegation"));
    presentation.setCodeUsagesString(RefactoringBundle.message("instances.casted.to.java.lang.object"));
    final String upcastedString = RefactoringBundle.message("instances.upcasted.to.object");
    presentation.setUsagesString(upcastedString);
    presentation.setTabText(upcastedString);
    UsageViewManager manager = UsageViewManager.getInstance(myProject);
    manager.showUsages(new UsageTarget[] { new PsiElement2UsageTargetAdapter(myClass) }, UsageInfoToUsageConverter.convert(new PsiElement[] { myClass }, usages), presentation);
    WindowManager.getInstance().getStatusBar(myProject).setInfo(RefactoringBundle.message("instances.upcasted.to.java.lang.object.found"));
}
Also used : UsageViewPresentation(com.intellij.usages.UsageViewPresentation) UsageViewManager(com.intellij.usages.UsageViewManager) PsiElement2UsageTargetAdapter(com.intellij.find.findUsages.PsiElement2UsageTargetAdapter)

Aggregations

PsiElement2UsageTargetAdapter (com.intellij.find.findUsages.PsiElement2UsageTargetAdapter)1 UsageViewManager (com.intellij.usages.UsageViewManager)1 UsageViewPresentation (com.intellij.usages.UsageViewPresentation)1