Remove usage of deprecated method
This commit is contained in:
@@ -44,6 +44,7 @@ import com.intellij.refactoring.listeners.RefactoringEventListener
|
|||||||
import com.intellij.refactoring.ui.ConflictsDialog
|
import com.intellij.refactoring.ui.ConflictsDialog
|
||||||
import com.intellij.refactoring.util.ConflictsUtil
|
import com.intellij.refactoring.util.ConflictsUtil
|
||||||
import com.intellij.refactoring.util.RefactoringUIUtil
|
import com.intellij.refactoring.util.RefactoringUIUtil
|
||||||
|
import com.intellij.refactoring.rename.PsiElementRenameHandler
|
||||||
import com.intellij.ui.components.JBList
|
import com.intellij.ui.components.JBList
|
||||||
import com.intellij.usageView.UsageViewTypeLocation
|
import com.intellij.usageView.UsageViewTypeLocation
|
||||||
import com.intellij.util.VisibilityUtil
|
import com.intellij.util.VisibilityUtil
|
||||||
@@ -958,17 +959,20 @@ fun checkSuperMethodsWithPopup(
|
|||||||
append(" of ")
|
append(" of ")
|
||||||
append(SymbolPresentationUtil.getSymbolPresentableText(superClass))
|
append(SymbolPresentationUtil.getSymbolPresentableText(superClass))
|
||||||
}
|
}
|
||||||
val list = JBList<String>(renameBase, renameCurrent)
|
|
||||||
JBPopupFactory.getInstance()
|
JBPopupFactory.getInstance()
|
||||||
.createListPopupBuilder(list)
|
.createPopupChooserBuilder(listOf(renameBase, renameCurrent))
|
||||||
.setTitle(title)
|
.setTitle(title)
|
||||||
.setMovable(false)
|
.setMovable(false)
|
||||||
.setResizable(false)
|
.setResizable(false)
|
||||||
.setRequestFocus(true)
|
.setRequestFocus(true)
|
||||||
.setItemChoosenCallback {
|
.setItemChosenCallback { selected ->
|
||||||
val value = list.selectedValue ?: return@setItemChoosenCallback
|
if (selected == renameBase) {
|
||||||
val chosenElements = if (value == renameBase) deepestSuperMethods + declaration else listOf(declaration)
|
val ableToRename = declaration.project.let { project ->
|
||||||
action(chosenElements)
|
deepestSuperMethods.all { PsiElementRenameHandler.canRename(project, editor, it) }
|
||||||
|
}
|
||||||
|
if (ableToRename) action(deepestSuperMethods + declaration)
|
||||||
|
} else action(listOf(declaration))
|
||||||
}
|
}
|
||||||
.createPopup()
|
.createPopup()
|
||||||
.showInBestPositionFor(editor)
|
.showInBestPositionFor(editor)
|
||||||
|
|||||||
Reference in New Issue
Block a user